Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
idyno.SimTimer Class Reference

Class to create and keep track of the timestep and simulation time course. More...

Public Member Functions

 SimTimer (XMLParser localRoot)
 Parses simulation time step information from the XML protocol file. More...
 
void setTimerState (String infoFile)
 Set the state of the simulation timer from information in an XML file. More...
 
double returnSimulationLength ()
 Returns the length of the simulation in hours. More...
 

Static Public Member Functions

static void applyTimeStep ()
 Computes the current simulation time step and increments the simulation clock. More...
 
static void updateTimeStep (World aWorld)
 If adaptive timesteps are enabled, updates the timestep for a given simulation world. More...
 
static void reset ()
 Resets the simulation timestep and counters to zero. More...
 
static double getCurrentTime ()
 Return the time spent since the beginning of the simulation (in hours) More...
 
static int getCurrentIter ()
 Returns the current iteration of the simulation. More...
 
static double getCurrentTimeStep ()
 Returns the currrent timestep, in hours. More...
 
static void setCurrentTimeStep (double dt)
 Sets the current timestep to a new double value. Used in adaptive timestep scenarios. More...
 
static boolean simIsFinished ()
 Determine whether or not the simulation has finished. More...
 
static boolean isDuringNextStep (double aDate)
 Determines if a set time (such as an agent birthday) is within the next timestep. More...
 
static boolean isCurrentTimeStepInSetInRange (double start, double end)
 Determines if the simulation time is within a set range of hours. More...
 

Public Attributes

double _statedTimeStep
 

Detailed Description

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

Constructor & Destructor Documentation

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
localRootThe SIMULATOR mark-up within the XML file - containing the timestep parameters.

Member Function Documentation

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
startHour at which event should start to occur
endHour 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
aDateThe 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
dtThe 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
infoFileName 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
aWorldThe simulation world being modelled under an adaptive timestep

Member Data Documentation

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: