CYCLUS
Public Member Functions | List of all members
cyclus::Timer Class Reference

Detailed Description

Controls simulation timestepping and inter-timestep phases.

Definition at line 22 of file timer.h.

#include <timer.h>

Public Member Functions

int dur ()
 
void Initialize (Context *ctx, SimInfo si)
 
void KillSim ()
 
void RegisterTimeListener (TimeListener *agent)
 
void Reset ()
 
void RunSim ()
 
void SchedBuild (Agent *parent, std::string proto_name, int t)
 
void SchedDecom (Agent *m, int time)
 
void Snapshot ()
 
int time ()
 
 Timer ()
 
void UnregisterTimeListener (TimeListener *tl)
 

Constructor & Destructor Documentation

cyclus::Timer::Timer ( )

Definition at line 241 of file timer.cc.

Member Function Documentation

int cyclus::Timer::dur ( )

Returns the duration of the simulation this Timer's timing.

Returns
the duration, in months

Definition at line 237 of file timer.cc.

void cyclus::Timer::Initialize ( Context ctx,
SimInfo  si 
)

Sets intial time-related parameters for the simulation.

Parameters
ctxsimulation context

Definition at line 222 of file timer.cc.

void cyclus::Timer::KillSim ( )
inline

Schedules the simulation to be terminated at the end of this timestep.

Definition at line 60 of file timer.h.

void cyclus::Timer::RegisterTimeListener ( TimeListener agent)

Registers an agent to receive tick/tock notifications every timestep.

Agents should register from their Deploy method.

Definition at line 165 of file timer.cc.

void cyclus::Timer::Reset ( )

resets all data (registered listeners, etc.) to empty or initial state

Definition at line 215 of file timer.cc.

void cyclus::Timer::RunSim ( )

Runs the simulation.

Definition at line 14 of file timer.cc.

void cyclus::Timer::SchedBuild ( Agent parent,
std::string  proto_name,
int  t 
)

Schedules the named prototype to be built for the specified parent at timestep t.

Definition at line 173 of file timer.cc.

void cyclus::Timer::SchedDecom ( Agent m,
int  time 
)

Schedules the given Agent to be decommissioned at the specified timestep t.

Definition at line 180 of file timer.cc.

void cyclus::Timer::Snapshot ( )
inline

Schedules a snapshot of simulation state to output database to occur at the beginning of the next timestep.

Definition at line 57 of file timer.h.

int cyclus::Timer::time ( )

Returns the current time, in months since the simulation started.

Returns
the current time

Definition at line 211 of file timer.cc.

void cyclus::Timer::UnregisterTimeListener ( TimeListener tl)

Removes an agent from receiving tick/tock notifications.

Agents should unregister from their Decommission method.

Definition at line 169 of file timer.cc.


The documentation for this class was generated from the following files: