libemc::Simulator Class Reference
[The Libemc Module]

The interface to the simulator. More...

#include <Simulator.hpp>

Collaboration diagram for libemc::Simulator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const libecs::PolymorphMap getClassInfo (libecs::StringCref aClasstype, libecs::StringCref aClassname)
const libecs::PolymorphMap getClassInfo (libecs::StringCref aClasstype, libecs::StringCref aClassname, const libecs::Integer forceReload)
Stepper methods.
void createStepper (libecs::StringCref aClassname, libecs::StringCref anId)
 Create a new Stepper in the model.
void deleteStepper (libecs::StringCref anID)
 Delete a Stepper.
const libecs::Polymorph getStepperList () const
 List Steppers in the model.
const libecs::Polymorph getStepperPropertyList (libecs::StringCref aStepperID) const
 List names of properties of a Stepper.
const libecs::Polymorph getStepperPropertyAttributes (libecs::StringCref aStepperID, libecs::StringCref aPropertyName) const
 Get attributes of a property of a Stepper.
void setStepperProperty (libecs::StringCref aStepperID, libecs::StringCref aPropertyName, libecs::PolymorphCref aValue)
 Set a property value of a Stepper.
const libecs::Polymorph getStepperProperty (libecs::StringCref aStepperID, libecs::StringCref aPropertyName) const
 Get a value of a property from a Stepper.
void loadStepperProperty (libecs::StringCref aStepperID, libecs::StringCref aPropertyName, libecs::PolymorphCref aValue)
 Load a property value of a Stepper.
const libecs::Polymorph saveStepperProperty (libecs::StringCref aStepperID, libecs::StringCref aPropertyName) const
 Get a value of a property from an Stepper.
const libecs::String getStepperClassName (libecs::StringCref aStepperID) const
 Get class name of a Stepper.
Entity methods.
void createEntity (libecs::StringCref aClassname, libecs::StringCref aFullIDString)
 Create a new Entity in the model.
void deleteEntity (libecs::StringCref aFullIDString)
 Delete an Entity.
const libecs::Polymorph getEntityList (libecs::StringCref anEntityTypeString, libecs::StringCref aSystemPathString) const
 Get a list of Entities in a System.
const libecs::Polymorph getEntityPropertyList (libecs::StringCref aFullIDString) const
 List names of properties of an Entity.
const bool isEntityExist (libecs::StringCref aFullIDString) const
 Check if an Entity object specified by a FullID exists in the model.
void setEntityProperty (libecs::StringCref aFullPNString, libecs::PolymorphCref aValue)
 Set a property value of an Entity.
const libecs::Polymorph getEntityProperty (libecs::StringCref aFullPNString) const
 Get a value of a property from an Entity.
void loadEntityProperty (libecs::StringCref aFullPNString, libecs::PolymorphCref aValue)
 Load a property value of an Entity.
const libecs::Polymorph saveEntityProperty (libecs::StringCref aFullPNString) const
 Save a value of a property from an Entity.
const libecs::Polymorph getEntityPropertyAttributes (libecs::StringCref aFullPNString) const
 Get attributes of a property of an Entity.
const libecs::String getEntityClassName (libecs::StringCref aFullIDString) const
 Get class name of an Entity.
Logger methods.
void createLogger (libecs::StringCref aFullPNString)
 Create a Logger.
void createLogger (libecs::StringCref aFullPNString, libecs::Polymorph aParamList)
 Create a Logger with parameters.
const libecs::Polymorph getLoggerList () const
 List Loggers in the simulator.
const libecs::DataPointVectorSharedPtr getLoggerData (libecs::StringCref aFullPNString) const
const libecs::DataPointVectorSharedPtr getLoggerData (libecs::StringCref aFullPNString, libecs::RealCref aStartTime, libecs::RealCref anEndTime) const
const libecs::DataPointVectorSharedPtr getLoggerData (libecs::StringCref aFullPNString, libecs::RealCref aStartTime, libecs::RealCref anEndTime, libecs::RealCref anInterval) const
const libecs::Real getLoggerStartTime (libecs::StringCref aFullPNString) const
const libecs::Real getLoggerEndTime (libecs::StringCref aFullPNString) const
void setLoggerMinimumInterval (libecs::StringCref aFullPNString, libecs::RealCref anInterval)
const libecs::Real getLoggerMinimumInterval (libecs::StringCref aFullPNString) const
void setLoggerPolicy (libecs::StringCref aFullPNString, libecs::Polymorph aParamList)
libecs::Polymorph getLoggerPolicy (libecs::StringCref aFullPNString) const
const libecs::Integer getLoggerSize (libecs::StringCref aFullPNString) const
Simulator methods.
void step (const libecs::Integer aNumSteps=1)
 Conduct a step of the simulation.
const libecs::Polymorph getNextEvent () const
const libecs::Real getCurrentTime () const
 Get current time of the simulator.
void run ()
 Run the simulation.
void run (const libecs::Real aDuration)
 Run the simulation with a duration.
void stop ()
 Stop the simulation.
void setEventChecker (EventCheckerSharedPtr aEventChecker)
 Set a pending event checker.
void setEventHandler (EventHandlerSharedPtrCref anEventHandler)
 Set an event handler.
const libecs::Polymorph getDMInfo ()

Detailed Description

The interface to the simulator.

Simulator class provides a unified API to the libecs, C++ library for cell modeling and simulation.

Unlike libecs::Model class, this API does involve only standard C++ types/classes, and doesn't depend on libecs classes. An only exception is Polymorph class.

The public API methods are classified into these four groups:

See also:
The Libecs library

Model

SimulatorImplementation


Member Function Documentation

void libemc::Simulator::createStepper ( libecs::StringCref  aClassname,
libecs::StringCref  anId 
) [inline]

Create a new Stepper in the model.

Parameters:
aClassname a classname of the Stepper to create.
anID an ID of the Stepper.
aParameterList a list of parameters to give to the Stepper

void libemc::Simulator::deleteStepper ( libecs::StringCref  anID  )  [inline]

Delete a Stepper.

This method is not supported yet.

const libecs::Polymorph libemc::Simulator::getStepperList (  )  const [inline]

List Steppers in the model.

a list of Steppers.

const libecs::Polymorph libemc::Simulator::getStepperPropertyList ( libecs::StringCref  aStepperID  )  const [inline]

List names of properties of a Stepper.

Returns:
a list of properties of a Stepper.

const libecs::Polymorph libemc::Simulator::getStepperPropertyAttributes ( libecs::StringCref  aStepperID,
libecs::StringCref  aPropertyName 
) const [inline]

Get attributes of a property of a Stepper.

The attributes are returned as a form of boolean 2-tuple ( setable, getable ). ( 1, 0 ) means that the property is setable but not getable,,, and so on.

Returns:
Stepper property attributes.

void libemc::Simulator::setStepperProperty ( libecs::StringCref  aStepperID,
libecs::StringCref  aPropertyName,
libecs::PolymorphCref  aValue 
) [inline]

Set a property value of a Stepper.

Parameters:
aStepperID the Stepper ID.
aValue the value to set as a Polymorph.

const libecs::Polymorph libemc::Simulator::getStepperProperty ( libecs::StringCref  aStepperID,
libecs::StringCref  aPropertyName 
) const [inline]

Get a value of a property from a Stepper.

Parameters:
aStepperID the Stepper ID.
aPropertyName the name of the property.
Returns:
the property value as a reference counted pointor of a Polymorph.

void libemc::Simulator::loadStepperProperty ( libecs::StringCref  aStepperID,
libecs::StringCref  aPropertyName,
libecs::PolymorphCref  aValue 
) [inline]

Load a property value of a Stepper.

Parameters:
aStepperID the Stepper ID.
aValue the value to set as a Polymorph.

const libecs::Polymorph libemc::Simulator::saveStepperProperty ( libecs::StringCref  aStepperID,
libecs::StringCref  aPropertyName 
) const [inline]

Get a value of a property from an Stepper.

Parameters:
aStepperID the Stepper ID.
aPropertyName the name of the property.
Returns:
the property value as a reference counted pointor of a Polymorph.

const libecs::String libemc::Simulator::getStepperClassName ( libecs::StringCref  aStepperID  )  const [inline]

Get class name of a Stepper.

Parameters:
aStepperID the Stepper ID.
Returns:
the class name.

void libemc::Simulator::createEntity ( libecs::StringCref  aClassname,
libecs::StringCref  aFullIDString 
) [inline]

Create a new Entity in the model.

Parameters:
aClassname a classname of the Entity to create.
aFullIDString FullID of the Entity.
aName a name of the Entity.

void libemc::Simulator::deleteEntity ( libecs::StringCref  aFullIDString  )  [inline]

Delete an Entity.

This method is not supported yet.

const libecs::Polymorph libemc::Simulator::getEntityList ( libecs::StringCref  anEntityTypeString,
libecs::StringCref  aSystemPathString 
) const [inline]

Get a list of Entities in a System.

Parameters:
anEntityTypeString an EntityType as a string
aSystemPathString a SystemPath of the System.
Returns:
the list of IDs of Entities.

const libecs::Polymorph libemc::Simulator::getEntityPropertyList ( libecs::StringCref  aFullIDString  )  const [inline]

List names of properties of an Entity.

Returns:
a list of properties of an Entity.

const bool libemc::Simulator::isEntityExist ( libecs::StringCref  aFullIDString  )  const [inline]

Check if an Entity object specified by a FullID exists in the model.

Parameters:
aFullIDString a FullID string to be checked.
Returns:
true if the Entity exists, false if not.

void libemc::Simulator::setEntityProperty ( libecs::StringCref  aFullPNString,
libecs::PolymorphCref  aValue 
) [inline]

Set a property value of an Entity.

Parameters:
aFullPNString a FullPN of the Property to set.
aValue the value to be set.

const libecs::Polymorph libemc::Simulator::getEntityProperty ( libecs::StringCref  aFullPNString  )  const [inline]

Get a value of a property from an Entity.

Parameters:
aFullPNString a FullPN of the property.
Returns:
the property value.

void libemc::Simulator::loadEntityProperty ( libecs::StringCref  aFullPNString,
libecs::PolymorphCref  aValue 
) [inline]

Load a property value of an Entity.

Parameters:
aFullPNString a FullPN of the Property to set.
aValue the value to be set.

const libecs::Polymorph libemc::Simulator::saveEntityProperty ( libecs::StringCref  aFullPNString  )  const [inline]

Save a value of a property from an Entity.

Parameters:
aFullPNString a FullPN of the property.
Returns:
the property value.

const libecs::Polymorph libemc::Simulator::getEntityPropertyAttributes ( libecs::StringCref  aFullPNString  )  const [inline]

Get attributes of a property of an Entity.

The attributes are returned as a form of boolean 2-tuple ( setable, getable ). ( 1, 0 ) means that the property is setable but not getable,,, and so on.

Returns:
Entity property attributes.

const libecs::String libemc::Simulator::getEntityClassName ( libecs::StringCref  aFullIDString  )  const [inline]

Get class name of an Entity.

Parameters:
aFullIDString a FullID of the Entity.
Returns:
the class name.

void libemc::Simulator::createLogger ( libecs::StringCref  aFullPNString  )  [inline]

Create a Logger.

If the Logger already exists, this method does nothing.

Parameters:
aFullPNString a FullPN of the PropertySlot which the Logger is observing, as a String
Returns:
a borrowed pointer to the Logger

void libemc::Simulator::createLogger ( libecs::StringCref  aFullPNString,
libecs::Polymorph  aParamList 
) [inline]

Create a Logger with parameters.

First parameter - minimum log interval dimension 0 - none, 1 - by step, 2 - by time Second parameter - behaviour when run out of disk - 0 - throw exception, 1 - overwrite data Third parameter - minimum log interval

If the Logger already exists, this method does nothing.

Parameters:
aFullPNString a FullPN of the PropertySlot which the Logger is observing, as a String
Returns:
a borrowed pointer to the Logger

const libecs::Polymorph libemc::Simulator::getLoggerList (  )  const [inline]

List Loggers in the simulator.

Returns:
a list of Loggers.

const libecs::Real libemc::Simulator::getCurrentTime (  )  const [inline]

Get current time of the simulator.

Returns:
current time of the simulator

void libemc::Simulator::run (  )  [inline]

Run the simulation.

Note:
Both the EventChecker and the EventHandler must be set before calling this method.
See also:
setEventChecker

setEventHandler

void libemc::Simulator::run ( const libecs::Real  aDuration  )  [inline]

Run the simulation with a duration.

Parameters:
a duration of the simulation run.

void libemc::Simulator::stop (  )  [inline]

Stop the simulation.

Usually this is called from the EventHandler.

void libemc::Simulator::setEventChecker ( EventCheckerSharedPtr  aEventChecker  )  [inline]

Set a pending event checker.

The event checker must be a subclass of EventChecker class.

This is usually used to set to form a mainloop of GUI toolkit. If you are using gtk, the event checker would call gtk_events_pending() function.

While the simulation is running by the run() method, the function object given by this method is called once in several simulation steps. If it returns true, the EventHandler given by setEventHandler() method is called.

Parameters:
aEventChecker a function object of the event checker
See also:
EventChecker

setEventHandler

void libemc::Simulator::setEventHandler ( EventHandlerSharedPtrCref  anEventHandler  )  [inline]

Set an event handler.

The event handler must be a subclass of EventHandler class.

If you are using gtk, it would call gtk_main_iteration() function.

Parameters:
anEventHandler a function object of the event handler
See also:
EventHandler

setEventChecker


The documentation for this class was generated from the following file:
Generated on Mon Dec 18 07:30:21 2006 for E-CELL C++ libraries (libecs and libemc) 3.1.105 by  doxygen 1.5.1