#include <SimEngine.h>
Public Member Functions | |
SimEngine (int id, SpikeScheduler &ss, SimNetwork &net) | |
Set up new simulation engine. | |
virtual | ~SimEngine () |
Destructor. | |
virtual void | reset ()=0 |
Reset all sim elements; i.e. set the simulation time back to zero. | |
virtual void | initialize ()=0 |
Initializes the engine and all the objects it contains, so that they are ready for simulation. | |
virtual void | advance (int nSteps=1)=0 |
Advance all elements by a certain number of time steps. | |
virtual void | advanceSeveralStepsWithinACycle (int nsteps)=0 |
virtual void | finalizeCycle ()=0 |
virtual void | advanceOneFullCycle ()=0 |
Advance all elements for one cycle (equal to minDelay time steps). | |
virtual void | addObject (SimObjectFactory const &objFactory, SimObject::ID &id)=0 |
Add a new object to the simulation engine. | |
virtual void | mount (const SimObjectFactory &objFactory, const SimObject::ID &mountpoint, SimObject::ID &gid)=0 |
virtual void | insert (const SimObjectFactory &objFactory, const SimObject::ID &container, SimObject::ID &gid)=0 |
virtual SimObject * | getObject (const SimObject::ID &id)=0 |
Get a pointer of a object identified by the id and type. | |
engineid_t | getLocalEid () const |
SpikeScheduler * | getSpikeScheduler () const |
virtual void | seed (vector< uint32 > const &noiseSeed)=0 |
virtual void | seed (uint32 noiseSeed)=0 |
virtual void | noiseRandEngineOutput (vector< uint32 > &r) |
Protected Attributes | |
int | default_steps_per_cycle |
engineid_t | eid |
The ID of the simulation engine. | |
SpikeScheduler & | spikeScheduler |
The spike scheduler to use. | |
SimNetwork & | network |
Friends | |
class | SimObject |
Classes | |
class | ID |
Definition at line 23 of file SimEngine.h.
SimEngine::SimEngine | ( | int | id, | |
SpikeScheduler & | ss, | |||
SimNetwork & | net | |||
) |
virtual SimEngine::~SimEngine | ( | ) | [inline, virtual] |
virtual void SimEngine::reset | ( | ) | [pure virtual] |
Reset all sim elements; i.e. set the simulation time back to zero.
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedSimEngine::reset().
virtual void SimEngine::initialize | ( | ) | [pure virtual] |
Initializes the engine and all the objects it contains, so that they are ready for simulation.
Includes reset() operation inside.
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedSingleThreadNetwork::_initialize_(), DistributedMultiThreadNetwork::_initialize_(), and DistributedSimEngine::initialize().
virtual void SimEngine::advance | ( | int | nSteps = 1 |
) | [pure virtual] |
Advance all elements by a certain number of time steps.
nSteps | number of time steps to advance |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
virtual void SimEngine::advanceSeveralStepsWithinACycle | ( | int | nsteps | ) | [pure virtual] |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedSimEngine::advance(), and DistributedSimEngine::advanceSeveralStepsWithinACycle().
virtual void SimEngine::finalizeCycle | ( | ) | [pure virtual] |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedSimEngine::advance(), and DistributedSimEngine::finalizeCycle().
virtual void SimEngine::advanceOneFullCycle | ( | ) | [pure virtual] |
Advance all elements for one cycle (equal to minDelay time steps).
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedSimEngine::advance(), and DistributedSimEngine::advanceOneFullCycle().
virtual void SimEngine::addObject | ( | SimObjectFactory const & | objFactory, | |
SimObject::ID & | id | |||
) | [pure virtual] |
Add a new object to the simulation engine.
obj | Pointer to the object to add | |
id | Resulting identifier of the object. id.type and id.localid are set. |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedNetwork::_addObject_(), and DistributedSimEngine::addObject().
virtual void SimEngine::mount | ( | const SimObjectFactory & | objFactory, | |
const SimObject::ID & | mountpoint, | |||
SimObject::ID & | gid | |||
) | [pure virtual] |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedNetwork::_mount_(), and DistributedSimEngine::mount().
virtual void SimEngine::insert | ( | const SimObjectFactory & | objFactory, | |
const SimObject::ID & | container, | |||
SimObject::ID & | gid | |||
) | [pure virtual] |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedNetwork::_insert_(), and DistributedSimEngine::insert().
virtual SimObject* SimEngine::getObject | ( | const SimObject::ID & | id | ) | [pure virtual] |
Get a pointer of a object identified by the id and type.
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedSingleThreadNetwork::_addSpikeMessage_(), DistributedMultiThreadNetwork::_addSpikeMessage_(), DistributedNetwork::_connect_(), DistributedSingleThreadNetwork::_getObject_(), DistributedMultiThreadNetwork::_getObject_(), SingleThreadNetwork::addLocalSpikeMessage(), MultiThreadNetwork::addLocalSpikeMessage(), DistributedNetwork::getFirstSenderSpikePort(), and DistributedSimEngine::getObject().
engineid_t SimEngine::getLocalEid | ( | ) | const [inline] |
Definition at line 112 of file SimEngine.h.
References eid.
Referenced by SpikeOutputPort::setSpikeByOffsetFraction().
SpikeScheduler* SimEngine::getSpikeScheduler | ( | ) | const [inline] |
Definition at line 114 of file SimEngine.h.
References spikeScheduler.
Referenced by SpikeOutputPort::setSpikeByOffsetFraction().
virtual void SimEngine::seed | ( | vector< uint32 > const & | noiseSeed | ) | [pure virtual] |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
Referenced by DistributedNetwork::seed_noise_rng().
virtual void SimEngine::seed | ( | uint32 | noiseSeed | ) | [pure virtual] |
Implemented in DistributedSimEngine, MultiThreadSimEngine, and SingleThreadSimEngine.
virtual void SimEngine::noiseRandEngineOutput | ( | vector< uint32 > & | r | ) | [inline, virtual] |
friend class SimObject [friend] |
Definition at line 130 of file SimEngine.h.
int SimEngine::default_steps_per_cycle [protected] |
Definition at line 118 of file SimEngine.h.
Referenced by MultiThreadSimEngine::advance(), DistributedSimEngine::advance(), SingleThreadSimEngine::advanceOneFullCycle(), and MultiThreadSimEngine::advanceOneFullCycle().
engineid_t SimEngine::eid [protected] |
The ID of the simulation engine.
Definition at line 125 of file SimEngine.h.
Referenced by SingleThreadSimEngine::advance(), and getLocalEid().
SpikeScheduler& SimEngine::spikeScheduler [protected] |
The spike scheduler to use.
Definition at line 128 of file SimEngine.h.
Referenced by SingleThreadSimEngine::advance(), SingleThreadSimEngine::advanceOneFullCycle(), MultiThreadSimEngine::finalizeCycle(), getSpikeScheduler(), and MultiThreadSimEngine::MultiThreadSimEngine().
SimNetwork& SimEngine::network [protected] |
Definition at line 131 of file SimEngine.h.
Referenced by SingleThreadSimEngine::addObject(), SingleThreadSimEngine::advance(), SingleThreadSimEngine::initialize(), SingleThreadSimEngine::one_way_link(), MultiThreadSimEngine::one_way_link(), SingleThreadSimEngine::reset(), SingleThreadSimEngine::two_way_link(), and MultiThreadSimEngine::two_way_link().