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

◆ Timer()

cyclus::Timer::Timer ( )

Definition at line 258 of file timer.cc.

Member Function Documentation

◆ dur()

int cyclus::Timer::dur ( )

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

Returns
the duration, in months

Definition at line 254 of file timer.cc.

◆ Initialize()

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

Sets intial time-related parameters for the simulation.

Parameters
ctxsimulation context

Definition at line 239 of file timer.cc.

◆ KillSim()

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.

◆ RegisterTimeListener()

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 182 of file timer.cc.

◆ Reset()

void cyclus::Timer::Reset ( )

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

Definition at line 232 of file timer.cc.

◆ RunSim()

void cyclus::Timer::RunSim ( )

Runs the simulation.

Definition at line 16 of file timer.cc.

◆ SchedBuild()

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 190 of file timer.cc.

◆ SchedDecom()

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

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

Definition at line 197 of file timer.cc.

◆ Snapshot()

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.

◆ time()

int cyclus::Timer::time ( )

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

Returns
the current time

Definition at line 228 of file timer.cc.

◆ UnregisterTimeListener()

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

Removes an agent from receiving tick/tock notifications.

Agents should unregister from their Decommission method.

Definition at line 186 of file timer.cc.


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