Bpp/Simulation Simulator | C++ |
|  |
This module provides classes to define the basic functionalities of a simulator. This section allows you to access the C++ source files of the module. This module is part of Bpp/Simulation . The files listed below are included in the interface part of the module. So any module dependent of this module is also dependent of the files listed here. The files listed below are needed by the implementation part of the module. But a module dependent of this module is not necessary dependent of the files listed here. <jirk/java/lang/thread.hpp>
<jirk/java/lang/string.hpp>
<jirk/java/lang/system.hpp>
<bpp/modules.hpp>
The namespaces listed below are integrated in this module. That means any element declared in one of those namespaces can now be directly used by or from this module. Here are listed the errors that are supported or generated by the module. To use one of them, you do not have to specify the namespace of the module. erEmptySimulationScheduler The simulation scheduler is empty.
erInvalidSimulationDate The simulation date is not valid.
erSimulationNotRunning The simulation is not running.
erSimulationRunning The simulation is running.
erEndMeasureParameterMissing The end_measure parameter is missing in the experiment file.
erEndRunningParameterMissing The end_running parameter is missing in the experiment file.
erReplicationParameterMissing The replication parameter is missing in the experiment file.
erStartMeasureParameterMissing The start_measure parameter is missing in the experiment file.
erStartRunningParameterMissing The start_running parameter is missing in the experiment file.
Here are listed the classes provided by the module. To use one of them, you have to specify the namespace of the module. class clScheduler
Represents the scheduler of a simulator. It manages the time advance and the execution of the events in a simulation. class clSimulator : public clStillObject
Represents a simulator. It allows to perform a full simulation experiment. tyBoolean informationDisplayed() Indicates if the simulator must display information. Reading access only.
tyBoolean graphic() Indicates if the simulator must provide a graphical animation. Reading access only.
jirk::bpp::simulation::jaSimulatorFrame frame() Java frame where the simulation is animated. Reading access only.
clString dataLocation() Location of the data files used by the simulation. Reading access only.
clParameterX parameters() Parameters read from the experiment file. Reading access only.
clRandomGenerator randomGenerator() Random generator used for the simulation. Reading and writing access.
tyBoolean running() Indicates if the simulator is running. Reading access only.
tyCardinal startRunningDate() Start date of the simulation running. Reading access only.
tyCardinal endRunningDate() End date of the simulation running. Reading access only.
tyCardinal startMeasureDate() Start date of the statistical measures in the simulation. Reading access only.
tyCardinal endMeasureDate() End date of the statistical measures in the simulation. Reading access only.
tyCardinal nbReplication() Number of replications of the simulation experiment. Reading access only.
tyCardinal date() Current date of the simulation. Only relevant when the simulator is running. Reading access only.
tyCardinal replication() Current replication of the simulation experiment. Only relevant when the simulator is running. Reading access only.
public_property template <X(parameterize)> void newObject(prClass ** agPointer,X(signature)) Pattern to generate methods that build objects using constructors with X arguments.
public_property template <X(parameterize)> inline void schedule(tyCardinal agDate,prClass * agObject,void (prClass::*agMethod)(void),tyCardinal agMethodNo,X(signature)) Pattern to generate methods that schedule method call events (with X arguments).
public_property template <class prClass> void newObject(prClass ** agPointer) Builds a new simulation object using the default constructor.
public_property template <class prClass> inline void schedule(tyCardinal agDate,prClass * agObject,void (prClass::*agMethod)(void),tyCardinal agMethodNo) Schedules a method call event in the simulator. The method has no argument.
inline void clSimulator::setMeasureRange(tyCardinal agStartDate,tyCardinal agEndDate) Sets the measure range of a simulation, it indicates the date the statistical measures will start and the date it will end. If the end date is set to 0, that means the measures are collected until the end of the simulation.
inline void clSimulator::setNbReplication(tyCardinal agNbReplication) Sets the number of replications of the simulation experiment.
inline void clSimulator::setRunningRange(tyCardinal agStartDate,tyCardinal agEndDate) Sets the running range of a simulation, it indicates the date the simulation will start and the date it will end. If the end date is set to 0, that means the simulation will stop when no event is scheduled anymore.
inline tyBoolean clSimulator::measuring(void) const Indicates if the date of the simulation is in the measure range.
inline tyBoolean clSimulator::paused(void) const Indicates if the simulation is paused.
inline tyBoolean clSimulator::stopped(void) const Indicates if the simulation has been stopped.
inline clString clSimulator::imageFile(tyCardinal agClassNo) const Returns the location of the file containing the image that represents a given class of simulation objects.
inline tcString clSimulator::parameter(tcString agParameter) const Returns the value, read from the experiment file, of a given parameter.
inline tyBoolean clSimulator::parameterExists(tcString agParameter) const Indicates if a given parameter can be read from the experiment file.
inline void clSimulator::deleteObject(clObject * agObject) Destructs a simulation object.
property clSimulator::clSimulator(java::jyObject agFrame,tcString agExperimentFile,tyBoolean agInformationDisplayed) Builds a simulator that can provide a graphical animation in a Java frame of class SimulatorFrame (nil means there is no graphical animation). The file describing the simulation experiment must be provided. Detailed information can be displayed concerning the running of the experiment (default is not).
property clSimulator::~clSimulator(void) Destructs the simulator.
property void clSimulator::afterEvent(void) Is called after each time advance. It can be overloaded, but the overload version must call this method after the execution of its own instructions. Protected method.
property void clSimulator::beforeEvent(void) Is called before each time advance. It can be overloaded, but the overload version must call this method before executing anything else. Protected method.
property void clSimulator::endExperiment(void) Is called at the end of the simulation experiment. It can be overloaded, but the overload version must call this method after the execution of its own instructions. Protected method.
property void clSimulator::startExperiment(void) Is called at the start of the simulation experiment. It can be overloaded, but the overload version must call this method before executing anything else. Protected method.
property void clSimulator::endReplication(void) Is called at the end of a replication of the simulation experiment. It can be overloaded, but the overload version must call this method after the execution of its own instructions. Protected method.
property void clSimulator::startReplication(void) Is called at the start of a new replication of the simulation experiment. It can be overloaded, but the overload version must call this method before executing anything else. Protected method.
property void clSimulator::run(void) Runs the simulation experiment.
| | Copyright (c) 1999-2016 - Bruno Bachelet - bruno@nawouak.net - http://www.nawouak.net | Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. See this license for more details (http://www.gnu.org). |
|
| |