public abstract class AbstractMultiTermination extends java.lang.Object implements MultiTermination
Modifier and Type | Field and Description |
---|---|
protected int |
counter |
float |
DEF_W |
protected int |
dimensions |
protected Integrator |
integ |
protected DynamicalSystem |
lti |
static java.lang.String |
me |
protected java.util.HashMap<java.lang.String,Termination> |
myTerminations |
protected TimeSeries |
myValue |
protected java.util.Map<java.lang.String,java.lang.Float[]> |
myWeights |
protected java.lang.String |
name |
protected java.util.LinkedList<Termination> |
orderedTerminations |
protected Node |
parent |
Constructor and Description |
---|
AbstractMultiTermination(NeuralModule parent,
java.lang.String name,
Integrator integ,
DynamicalSystem lti2) |
Modifier and Type | Method and Description |
---|---|
Termination |
addTermination()
Add new weighted termination with the default weight (1).
|
Termination |
addTermination(float weight)
Specify the weight of this newly created Termination, if the
Terminaion is multi-dimensional, weight will be applied on all dimensions.
|
abstract Termination |
addTermination(java.lang.Float[] weights)
Specify the weight matrix for this newly created weighted Termination.
|
protected void |
checkDimensions(java.lang.Float[] weights) |
protected java.lang.String |
generateName()
This method generates unique name for my Termination based on
the name of MultiTermination.
|
protected java.lang.Float[] |
generateWeights(float weight) |
int |
getDimension()
NUmber of values passed through multiTerminations, the same
as dimensions of all child Terminations.
|
java.lang.String |
getName() |
Node |
getNode()
Get parent Node of my all Terminations.
|
TimeSeries |
getOutput()
Get output of this MultiTermination
|
java.util.HashMap<java.lang.String,Termination> |
getTerminations() |
protected java.lang.Float[] |
readWeights(java.lang.String name) |
void |
reset(boolean randomize) |
void |
run(float startTime,
float endTime)
Connect data on all its Terminations, terminations are ran by
the NeuralModule to which they are registered (too).
|
protected abstract void |
runAllTerminations(float startTime,
float endTime)
Runs all its Terminations.
|
protected abstract void |
runCombineValues(float startTime,
float endTime)
Collects data from its Terminations and sets its own value
|
public static final java.lang.String me
protected final java.util.LinkedList<Termination> orderedTerminations
protected final java.util.Map<java.lang.String,java.lang.Float[]> myWeights
protected final java.util.HashMap<java.lang.String,Termination> myTerminations
protected int counter
protected final java.lang.String name
protected final int dimensions
protected final Node parent
public final float DEF_W
protected TimeSeries myValue
protected final Integrator integ
protected final DynamicalSystem lti
public AbstractMultiTermination(NeuralModule parent, java.lang.String name, Integrator integ, DynamicalSystem lti2)
public java.util.HashMap<java.lang.String,Termination> getTerminations()
getTerminations
in interface MultiTermination
public void run(float startTime, float endTime) throws SimulationException
run
in interface MultiTermination
startTime
- simulation time at which running starts (s)endTime
- simulation time at which running ends (s)SimulationException
- if a problem is encountered while trying to runpublic void reset(boolean randomize)
reset
in interface Resettable
randomize
- True indicates that the object should be reset to a
randomly selected initial state (the object must be aware of the
distribution from which to draw from). False indicates that the
object should be reset to a fixed initial state (which it must
also know). Some objects may not support randomization of the initial
state, in which case a fixed state will be used in either case.public java.lang.String getName()
getName
in interface MultiTermination
protected abstract void runAllTerminations(float startTime, float endTime) throws SimulationException
startTime
- endTime
- SimulationException
protected abstract void runCombineValues(float startTime, float endTime) throws SimulationException
startTime
- endTime
- SimulationException
protected java.lang.String generateName()
public Termination addTermination(float weight) throws StructuralException
MultiTermination
addTermination
in interface MultiTermination
weight
- the termination can be weighterStructuralException
public abstract Termination addTermination(java.lang.Float[] weights) throws StructuralException
MultiTermination
addTermination
in interface MultiTermination
weights
- weight matrixStructuralException
public Termination addTermination() throws StructuralException
MultiTermination
addTermination
in interface MultiTermination
StructuralException
protected void checkDimensions(java.lang.Float[] weights) throws StructuralException
StructuralException
protected java.lang.Float[] readWeights(java.lang.String name) throws SimulationException
SimulationException
protected java.lang.Float[] generateWeights(float weight)
public Node getNode()
MultiTermination
getNode
in interface MultiTermination
public int getDimension()
MultiTermination
getDimension
in interface MultiTermination
public TimeSeries getOutput()
MultiTermination
getOutput
in interface MultiTermination