49 std::set<Agent*>::iterator
it;
52 if (
a->lifetime() != -1 &&
context()->
time() >=
a->exit_time()) {
54 if (
fac ==
NULL ||
fac->CheckDecommissionCondition()) {
56 <<
" has reached the end of its lifetime";
The abstract base class used by all types of agents that live and interact in a simulation.
virtual void InitFrom(QueryableBackend *b)
Intializes an agent's internal state from the database.
const std::string prototype() const
Returns the agent's prototype.
virtual void Build(Agent *parent)
Called when the agent enters the smiulation as an active participant and is only ever called once.
Context * context() const
Returns this agent's simulation context.
const std::set< Agent * > & children() const
Returns a list of children this agent has.
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
std::string kind_
describes the agent subclass (e.g.
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
virtual std::string str()
Description of this agent.
A simulation context provides access to necessary simulation-global functions and state.
virtual int time()
Returns the current simulation timestep.
void RegisterTimeListener(TimeListener *tl)
Registers an agent to receive tick/tock notifications every timestep.
void SchedDecom(Agent *m, int time=-1)
Schedules the given Agent to be decommissioned at the specified timestep t.
void UnregisterTimeListener(TimeListener *tl)
Removes an agent from receiving tick/tock notifications.
The Facility class is the abstract class/interface used by all facility agents.
The Institution class is the abstract class/interface used by all institution agents.
virtual ~Institution()
every agent should be destructable
virtual void Decommission()
Decommissions the agent, removing it from the simulation.
virtual std::string str()
every agent should be able to print a verbose description
virtual void EnterNotify()
Called to give the agent an opportunity to register for services (e.g.
virtual void Build(Agent *parent)
perform all tasks required when an inst enters the simulation
virtual void InitFrom(QueryableBackend *b)
Intializes an agent's internal state from the database.
Institution(Context *ctx)
Default constructor for Institution Class.
virtual void Tock()
Simulation agents do their end-of-timestep activities in the Tock method.
Code providing rudimentary logging capability for the Cyclus core.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
@ LEV_INFO3
Information helpful for simulation users and developers alike.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters