Miind
|
#include <libs/MPILib/include/DelayAlgorithm.hpp>
Public Types | |
typedef Weight | WeightType |
Public Member Functions | |
DelayAlgorithm (Time t_delay) | |
virtual | ~DelayAlgorithm () |
virtual DelayAlgorithm< Weight > * | clone () const |
virtual void | configure (const SimulationRunParameter &simParam) |
virtual void | evolveNodeState (const std::vector< Rate > &nodeVector, const std::vector< Weight > &weightVector, Time time) |
virtual void | evolveNodeState (const std::vector< Rate > &nodeVector, const std::vector< Weight > &weightVector, Time time, const std::vector< NodeType > &typeVector) |
std::valarray< double > & | getArrayInterpretation (AlgorithmGrid &grid) const |
std::valarray< double > & | getArrayState (AlgorithmGrid &grid) const |
virtual Rate | getCurrentRate () const |
virtual Time | getCurrentTime () const |
Time | getDelayTime () const |
virtual AlgorithmGrid | getGrid (NodeId, bool b_state) const |
Number & | getStateSize (AlgorithmGrid &grid) const |
Number | getStateSize (const AlgorithmGrid &grid) const |
virtual void | prepareEvolve (const std::vector< Rate > &nodeVector, const std::vector< Weight > &weightVector, const std::vector< NodeType > &typeVector) |
Private Types | |
typedef std::pair< Rate, Time > | rate_time_pair |
Private Member Functions | |
Rate | CalculateDelayedRate () |
Rate | Interpolate () const |
Private Attributes | |
std::deque< rate_time_pair > | _queue |
Rate | _rate_current |
Time | _t_current |
Time | _t_delay |
This algorithm is effectively a pipeline with a preselected delay.
In some simulations connections must be implemented with time delays. If that needs to be done with high precision, create a node, configure it with a DelayAlgorithm, connected the output to be delayed to this node and connect the output of this node to the node specified by the original connection. At the moment this is the only way to implement delays. Please note that it is expected that the node that carries this algorithm expects one and only one input node.
Definition at line 43 of file DelayAlgorithm.hpp.
|
private |
Definition at line 109 of file DelayAlgorithm.hpp.
|
inherited |
Definition at line 41 of file AlgorithmInterface.hpp.
MPILib::algorithm::DelayAlgorithm< Weight >::DelayAlgorithm | ( | Time | t_delay | ) |
Create algorithm with a delay time
t_delay | The delay time |
Definition at line 31 of file DelayAlgorithmCode.hpp.
|
virtual |
virtual destructor
Definition at line 37 of file DelayAlgorithmCode.hpp.
|
private |
Definition at line 91 of file DelayAlgorithmCode.hpp.
References i.
|
virtual |
Cloning operation, to provide each DynamicNode with its own Algorithm instance. Clients use the naked pointer at their own risk.
Implements MPILib::AlgorithmInterface< Weight >.
Definition at line 41 of file DelayAlgorithmCode.hpp.
|
virtual |
Configure the Algorithm
simParam | The simulation parameter |
Implements MPILib::AlgorithmInterface< Weight >.
Definition at line 45 of file DelayAlgorithmCode.hpp.
References MPILib::SimulationRunParameter::getTBegin().
|
virtual |
Evolve the node state. Overwrite this method if your algorithm does not need to know the NodeTypes.
nodeVector | Vector of the node States. If the size its different from 1, results are undefined. In Debug builds an assert will be triggered. |
weightVector | Vector of the weights of the nodes. It must have length one. The numerial value of the weight will be ignored. |
time | Time point of the algorithm |
Reimplemented from MPILib::AlgorithmInterface< Weight >.
Definition at line 50 of file DelayAlgorithmCode.hpp.
|
inlinevirtualinherited |
Evolve the node state. In the default case it simply calls envolveNodeState without the NodeTypes. However if an algorithm needs the nodeTypes of the precursors overwrite this function.
nodeVector | Vector of the node States |
weightVector | Vector of the weights of the nodes |
time | Time point of the algorithm |
typeVector | Vector of the NodeTypes of the precursors |
Definition at line 83 of file AlgorithmInterface.hpp.
References MPILib::AlgorithmInterface< WeightValue >::evolveNodeState().
|
inlineinherited |
Definition at line 125 of file AlgorithmInterface.hpp.
References MPILib::AlgorithmGrid::getArrayInterpretation().
|
inlineinherited |
Definition at line 120 of file AlgorithmInterface.hpp.
References MPILib::AlgorithmGrid::getArrayState().
|
virtual |
The calculated rate of the node
Implements MPILib::AlgorithmInterface< Weight >.
Definition at line 79 of file DelayAlgorithmCode.hpp.
|
virtual |
The current time
Implements MPILib::AlgorithmInterface< Weight >.
Definition at line 74 of file DelayAlgorithmCode.hpp.
|
inline |
Gets the delay time determining this algorithm. Does not need to be virtual, as it is not part of the AlgorithmInterface
Definition at line 101 of file DelayAlgorithm.hpp.
References MPILib::algorithm::DelayAlgorithm< Weight >::_t_delay.
|
virtual |
Stores the algorithm state in a Algorithm Grid
Implements MPILib::AlgorithmInterface< Weight >.
Definition at line 85 of file DelayAlgorithmCode.hpp.
|
inlineinherited |
Definition at line 130 of file AlgorithmInterface.hpp.
References MPILib::AlgorithmGrid::getStateSize().
|
inlineinherited |
Definition at line 135 of file AlgorithmInterface.hpp.
References MPILib::AlgorithmGrid::getStateSize().
|
private |
Definition at line 105 of file DelayAlgorithmCode.hpp.
|
inlinevirtualinherited |
prepare the Evolve method
nodeVector | Vector of the node States |
weightVector | Vector of the weights of the nodes |
typeVector | Vector of the NodeTypes of the precursors |
Definition at line 95 of file AlgorithmInterface.hpp.
|
private |
Definition at line 115 of file DelayAlgorithm.hpp.
|
private |
Definition at line 113 of file DelayAlgorithm.hpp.
|
private |
Definition at line 111 of file DelayAlgorithm.hpp.
|
private |
Definition at line 112 of file DelayAlgorithm.hpp.
Referenced by MPILib::algorithm::DelayAlgorithm< Weight >::getDelayTime().