#include <Simulator.hpp>
Collaboration diagram for libemc::Simulator:
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 () |
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:
Model
void libemc::Simulator::createStepper | ( | libecs::StringCref | aClassname, | |
libecs::StringCref | anId | |||
) | [inline] |
Create a new Stepper in the model.
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.
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.
void libemc::Simulator::setStepperProperty | ( | libecs::StringCref | aStepperID, | |
libecs::StringCref | aPropertyName, | |||
libecs::PolymorphCref | aValue | |||
) | [inline] |
Set a property value of a Stepper.
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.
aStepperID | the Stepper ID. | |
aPropertyName | the name of the property. |
void libemc::Simulator::loadStepperProperty | ( | libecs::StringCref | aStepperID, | |
libecs::StringCref | aPropertyName, | |||
libecs::PolymorphCref | aValue | |||
) | [inline] |
Load a property value of a Stepper.
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.
aStepperID | the Stepper ID. | |
aPropertyName | the name of the property. |
const libecs::String libemc::Simulator::getStepperClassName | ( | libecs::StringCref | aStepperID | ) | const [inline] |
Get class name of a Stepper.
aStepperID | the Stepper ID. |
void libemc::Simulator::createEntity | ( | libecs::StringCref | aClassname, | |
libecs::StringCref | aFullIDString | |||
) | [inline] |
Create a new Entity in the model.
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.
anEntityTypeString | an EntityType as a string | |
aSystemPathString | a SystemPath of the System. |
const libecs::Polymorph libemc::Simulator::getEntityPropertyList | ( | libecs::StringCref | aFullIDString | ) | const [inline] |
List names 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.
aFullIDString | a FullID string to be checked. |
void libemc::Simulator::setEntityProperty | ( | libecs::StringCref | aFullPNString, | |
libecs::PolymorphCref | aValue | |||
) | [inline] |
Set a property value of an Entity.
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.
aFullPNString | a FullPN of the property. |
void libemc::Simulator::loadEntityProperty | ( | libecs::StringCref | aFullPNString, | |
libecs::PolymorphCref | aValue | |||
) | [inline] |
Load a property value of an Entity.
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.
aFullPNString | a FullPN of the property. |
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.
const libecs::String libemc::Simulator::getEntityClassName | ( | libecs::StringCref | aFullIDString | ) | const [inline] |
Get class name of an Entity.
aFullIDString | a FullID of the Entity. |
void libemc::Simulator::createLogger | ( | libecs::StringCref | aFullPNString | ) | [inline] |
Create a Logger.
If the Logger already exists, this method does nothing.
aFullPNString | a FullPN of the PropertySlot which the Logger is observing, as a String |
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.
aFullPNString | a FullPN of the PropertySlot which the Logger is observing, as a String |
const libecs::Polymorph libemc::Simulator::getLoggerList | ( | ) | const [inline] |
List Loggers in the simulator.
const libecs::Real libemc::Simulator::getCurrentTime | ( | ) | const [inline] |
Get current time of the simulator.
void libemc::Simulator::run | ( | ) | [inline] |
Run the simulation.
void libemc::Simulator::run | ( | const libecs::Real | aDuration | ) | [inline] |
Run the simulation with a duration.
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.
aEventChecker | a function object of the event checker |
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.
anEventHandler | a function object of the event handler |