SingleThreadSimEngine Class Reference

Simulation engine running in a single thread of execution. More...

#include <SingleThreadSimEngine.h>

Inheritance diagram for SingleThreadSimEngine:

Inheritance graph
[legend]
Collaboration diagram for SingleThreadSimEngine:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SingleThreadSimEngine (int ID, SpikeScheduler &scheduler, AnalogMessageDispatcher &analogMsgDispatcher, SimNetwork &net)
virtual ~SingleThreadSimEngine ()
SimObjectPoolgetPool ()
virtual void reset ()
 Reset all sim elements; i.e. set the simulation time back to zero.
virtual void initialize ()
 Initializes the engine and all the objects it contains, so that they are ready for simulation.
virtual void advance (int nSteps=1)
 Advance all elements by a certain number of time steps.
virtual void advanceOneFullCycle ()
 Advance all elements for one cycle (equal to minDelay time steps).
virtual void advanceSeveralStepsWithinACycle (int nsteps)
virtual void finalizeCycle ()
virtual void addObject (SimObjectFactory const &objFactory, SimObject::ID &id)
 Add a new object to the simulation engine.
virtual SimObjectgetObject (const SimObject::ID &id)
 Get a pointer of a object identified by the id and type.
virtual void mount (const SimObjectFactory &objFactory, const SimObject::ID &mountpoint, SimObject::ID &gid)
virtual void insert (const SimObjectFactory &objFactory, const SimObject::ID &container, SimObject::ID &gid)
void two_way_link (const SimObject::ID &o1, const SimObject::ID &o2)
 Make two way tight coupling between to objects.
void one_way_link (const SimObject::ID &src, const SimObject::ID &dst)
 Make one way tight coupling between to objects.
const TimegetSimulationTime () const
Seed the random number engine for noise in the simulation objects
virtual void seed (vector< uint32 > const &noiseSeed)
virtual void seed (uint32 noiseSeed)
ThreadSpecificRandomEngineTypenoiseRandomEngine () const

Protected Member Functions

void addSpikePorts (SimObject *obj, SimObject::ID &id)


Detailed Description

Simulation engine running in a single thread of execution.

Definition at line 20 of file SingleThreadSimEngine.h.


Constructor & Destructor Documentation

SingleThreadSimEngine::SingleThreadSimEngine ( int  ID,
SpikeScheduler scheduler,
AnalogMessageDispatcher analogMsgDispatcher,
SimNetwork net 
)

Definition at line 16 of file SingleThreadSimEngine.cpp.

References RandomEngineBoostImplementation< boost_engine >::seed(), SimNetwork::simParameter(), and SimParameter::simulationRNGSeed.

Here is the call graph for this function:

SingleThreadSimEngine::~SingleThreadSimEngine (  )  [virtual]

Definition at line 32 of file SingleThreadSimEngine.cpp.

References theThreadSpecificRandomEngine, and ThreadSpecificRandomEngine::unset().

Here is the call graph for this function:


Member Function Documentation

SimObjectPool* SingleThreadSimEngine::getPool (  )  [inline]

Definition at line 29 of file SingleThreadSimEngine.h.

void SingleThreadSimEngine::reset (  )  [virtual]

void SingleThreadSimEngine::initialize (  )  [virtual]

Initializes the engine and all the objects it contains, so that they are ready for simulation.

Includes reset() operation inside.

Implements SimEngine.

Definition at line 143 of file SingleThreadSimEngine.cpp.

References SimObjectPool::beginObject(), SimObjectPool::endObject(), SimNetwork::initialized, SimEngine::network, SimObjectPool::numOfTypes(), ThreadSpecificRandomEngine::set(), and theThreadSpecificRandomEngine.

Referenced by SingleThreadNetwork::_initialize_(), reset(), and SimEngineInitializeJob::start().

Here is the call graph for this function:

void SingleThreadSimEngine::advance ( int  nSteps = 1  )  [virtual]

void SingleThreadSimEngine::advanceOneFullCycle (  )  [virtual]

Advance all elements for one cycle (equal to minDelay time steps).

Implements SimEngine.

Definition at line 229 of file SingleThreadSimEngine.cpp.

References advance(), SimEngine::default_steps_per_cycle, SpikeScheduler::nextCycle(), and SimEngine::spikeScheduler.

Here is the call graph for this function:

void SingleThreadSimEngine::advanceSeveralStepsWithinACycle ( int  nsteps  )  [virtual]

Implements SimEngine.

Definition at line 235 of file SingleThreadSimEngine.cpp.

References advance().

Here is the call graph for this function:

void SingleThreadSimEngine::finalizeCycle (  )  [virtual]

Implements SimEngine.

Definition at line 240 of file SingleThreadSimEngine.cpp.

void SingleThreadSimEngine::addObject ( SimObjectFactory const &  objFactory,
SimObject::ID id 
) [virtual]

Add a new object to the simulation engine.

Parameters:
obj Pointer to the object to add
id Resulting identifier of the object. id.type and id.localid are set.

Implements SimEngine.

Definition at line 48 of file SingleThreadSimEngine.cpp.

References SimObjectPool::addObject(), addSpikePorts(), SimObjectPool::getObject(), SimObjectFactory::getObjectTypeID(), SimNetwork::getObjectVariationRNDEngine(), and SimEngine::network.

Referenced by SingleThreadNetwork::_addObject_(), STAnalogMessageCreator::addAnalogMessage(), insert(), and mount().

Here is the call graph for this function:

SimObject * SingleThreadSimEngine::getObject ( const SimObject::ID id  )  [inline, virtual]

void SingleThreadSimEngine::mount ( const SimObjectFactory objFactory,
const SimObject::ID mountpoint,
SimObject::ID gid 
) [virtual]

Implements SimEngine.

Definition at line 75 of file SingleThreadSimEngine.cpp.

References addObject(), and one_way_link().

Referenced by SingleThreadNetwork::_mount_().

Here is the call graph for this function:

void SingleThreadSimEngine::insert ( const SimObjectFactory objFactory,
const SimObject::ID container,
SimObject::ID gid 
) [virtual]

Implements SimEngine.

Definition at line 81 of file SingleThreadSimEngine.cpp.

References addObject(), and two_way_link().

Referenced by SingleThreadNetwork::_insert_().

Here is the call graph for this function:

void SingleThreadSimEngine::two_way_link ( const SimObject::ID o1,
const SimObject::ID o2 
)

Make two way tight coupling between to objects.

Definition at line 87 of file SingleThreadSimEngine.cpp.

References SimObjectPool::getObject(), SimObject::incoming(), SimObject::ID::localid, SimEngine::network, SimObject::outgoing(), and SimObject::ID::type.

Referenced by insert().

Here is the call graph for this function:

void SingleThreadSimEngine::one_way_link ( const SimObject::ID src,
const SimObject::ID dst 
)

Make one way tight coupling between to objects.

Definition at line 100 of file SingleThreadSimEngine.cpp.

References SimObjectPool::getObject(), SimObject::incoming(), SimObject::ID::localid, SimEngine::network, SimObject::outgoing(), and SimObject::ID::type.

Referenced by mount().

Here is the call graph for this function:

void SingleThreadSimEngine::seed ( vector< uint32 > const &  noiseSeed  )  [virtual]

Implements SimEngine.

Definition at line 38 of file SingleThreadSimEngine.cpp.

References RandomEngineBoostImplementation< boost_engine >::seed().

Referenced by SingleThreadNetwork::seed_noise_rng().

Here is the call graph for this function:

void SingleThreadSimEngine::seed ( uint32  noiseSeed  )  [virtual]

Implements SimEngine.

Definition at line 43 of file SingleThreadSimEngine.cpp.

References RandomEngineBoostImplementation< boost_engine >::seed().

Here is the call graph for this function:

ThreadSpecificRandomEngineType* SingleThreadSimEngine::noiseRandomEngine (  )  const [inline]

Definition at line 63 of file SingleThreadSimEngine.h.

const Time& SingleThreadSimEngine::getSimulationTime (  )  const [inline]

Definition at line 66 of file SingleThreadSimEngine.h.

void SingleThreadSimEngine::addSpikePorts ( SimObject obj,
SimObject::ID id 
) [protected]


The documentation for this class was generated from the following files:

Generated on Wed Jul 9 16:34:54 2008 for PCSIM by  doxygen 1.5.5