Class to create and keep track of the timestep and simulation time course.
More...
Class to create and keep track of the timestep and simulation time course.
Class to create and keep track of the timestep and simulation time course
- Author
- Andreas Dötsch (andre.nosp@m.as.d.nosp@m.oetsc.nosp@m.h@he.nosp@m.lmhol.nosp@m.tz-h.nosp@m.zi.de), Helmholtz Centre for Infection Research (Germany)
-
Laurent Lardon (lardo.nosp@m.nl@s.nosp@m.upagr.nosp@m.o.in.nosp@m.ra.fr), INRA, France
idyno.SimTimer.SimTimer |
( |
XMLParser |
localRoot | ) |
|
Parses simulation time step information from the XML protocol file.
The timeStep markup within the protocol file specified all parameters for the time-stepping of the simulation. This action is controlled by an object of this SimTimer class. There is a choice of using an adaptive or set timestep, specified by setting the adaptive parameter to true or false respectively. If an adaptive timestep is used, three timeStep parameters are set to control the initial, minimum, and maximum values the timestep may take. The simulation then determines during runtime the timestep that should be used. On the other hand, if this is set to false, the simulation runs at one timestep - that set in the parameter timeStepIni. A further parameter is read in, endOfSimulation, that specifies when the simulation should end
- Parameters
-
localRoot | The SIMULATOR mark-up within the XML file - containing the timestep parameters. |
static void idyno.SimTimer.applyTimeStep |
( |
| ) |
|
|
static |
Computes the current simulation time step and increments the simulation clock.
Computes the current simulation time step and increments the simulation clock. First method called by the simulation step method
static int idyno.SimTimer.getCurrentIter |
( |
| ) |
|
|
static |
Returns the current iteration of the simulation.
Returns the current iteration of the simulation
- Returns
- Integer value noting the current iteration of the simulation
static double idyno.SimTimer.getCurrentTime |
( |
| ) |
|
|
static |
Return the time spent since the beginning of the simulation (in hours)
Utility method that returns the time spent since the beginning of the simulation (in hours)
- Returns
- Double value that specifies the time spent since the beginning of the simulation (in hours)
static double idyno.SimTimer.getCurrentTimeStep |
( |
| ) |
|
|
static |
Returns the currrent timestep, in hours.
Returns the currrent timestep, in hours
- Returns
- Double value stating the current simulation timestep
static boolean idyno.SimTimer.isCurrentTimeStepInSetInRange |
( |
double |
start, |
|
|
double |
end |
|
) |
| |
|
static |
Determines if the simulation time is within a set range of hours.
Determines if the simulation time is within a set range of hours. Useful for determining whether an event can occur in a set window (i.e. cell entry)
- Parameters
-
start | Hour at which event should start to occur |
end | Hour at which event should cease to occur |
- Returns
- Boolean stating whether this event should occur in the next timestep
static boolean idyno.SimTimer.isDuringNextStep |
( |
double |
aDate | ) |
|
|
static |
Determines if a set time (such as an agent birthday) is within the next timestep.
Determines if a set time (such as an agent birthday) is within the next timestep. Used to determine when agents enter the simulation
- Parameters
-
aDate | The timestep at which an event is set to happen |
- Returns
- Boolean stating whether this event should occur in the next timestep
static void idyno.SimTimer.reset |
( |
| ) |
|
|
static |
Resets the simulation timestep and counters to zero.
Sets simulation time step and counters to zero.
double idyno.SimTimer.returnSimulationLength |
( |
| ) |
|
Returns the length of the simulation in hours.
Returns the length of the simulation in hours
- Returns
- Length of the simulation in hours
static void idyno.SimTimer.setCurrentTimeStep |
( |
double |
dt | ) |
|
|
static |
Sets the current timestep to a new double value. Used in adaptive timestep scenarios.
Sets the current timestep to a new double value. Used in adaptive timestep scenarios
- Parameters
-
dt | The double value to assign to the simulation timestep |
void idyno.SimTimer.setTimerState |
( |
String |
infoFile | ) |
|
Set the state of the simulation timer from information in an XML file.
Set the state of the simulation timer from information in an XML file
- Parameters
-
infoFile | Name of the XML file containing the sim timer information |
static boolean idyno.SimTimer.simIsFinished |
( |
| ) |
|
|
static |
Determine whether or not the simulation has finished.
Determine whether or not the simulation has finished
- Returns
- Boolean stating whether or not the simulation has finished
static void idyno.SimTimer.updateTimeStep |
( |
World |
aWorld | ) |
|
|
static |
If adaptive timesteps are enabled, updates the timestep for a given simulation world.
If adaptive timesteps are enabled, updates the timestep for a given simulation world
- Parameters
-
aWorld | The simulation world being modelled under an adaptive timestep |
double idyno.SimTimer._statedTimeStep |
As _dT changes throughout the simulation, statedTimeStep holds the value that was originally read into _dT
The documentation for this class was generated from the following file: