1 #ifndef CYCLUS_SRC_AGENT_H_ 2 #define CYCLUS_SRC_AGENT_H_ 9 #include <boost/shared_ptr.hpp> 31 virtual const int id()
const = 0;
40 typedef std::map<std::string, std::vector<Resource::Ptr> >
Inventories;
53 friend class ::SimInitTest;
87 virtual Agent* Clone() = 0;
209 virtual void Snapshot(
DbInit di) = 0;
237 virtual void InitInv(Inventories& inv) = 0;
271 virtual Inventories SnapshotInv() = 0;
279 std::vector<std::string> GetTreePrintOuts(
Agent* m);
284 bool InFamilyTree(
Agent* other);
289 bool AncestorOf(
Agent* other);
294 bool DecendentOf(
Agent* other);
310 virtual void EnterNotify();
324 virtual void Decommission();
354 virtual const int id()
const {
return id_; }
379 inline const int parent_id()
const {
return parent_id_; }
389 void lifetime(
int n_timesteps);
393 void lifetime_force(
int n_timesteps);
397 inline const int lifetime()
const {
return lifetime_; }
408 if (lifetime() == -1)
410 return enter_time_ + lifetime_ - 1;
414 inline const std::set<Agent*>&
children()
const {
return children_; }
442 void InitFrom(
Agent* m);
463 void Connect(
Agent* parent);
469 std::set<Agent*> children_;
495 #endif // CYCLUS_SRC_AGENT_H_ An abjstract interface that must be implemented by all simulation agents and all agent member variabl...
virtual std::string version()
const int enter_time() const
Returns the time step at which this agent's Build function was called (-1 if the agent has never been...
double b(int nuc)
Computes the scattering length [cm] from the coherent and incoherent components.
const int exit_time() const
Returns the default time step at which this agent will exit the simulation (-1 if the agent has an in...
const std::string prototype() const
Returns the agent's prototype.
A class for extracting information from a given XML parser.
virtual const int id() const
The agent instance's unique ID within a simulation.
virtual void BuildNotify(Agent *m)
Called when a new child of this agent has just been built.
virtual void DecomNotify(Agent *m)
Called when a child of this agent is about to be decommissioned.
virtual std::string schema()
Returns an agent's xml rng schema for initializing from input files.
std::map< std::string, std::vector< Resource::Ptr > > Inventories
map<inventory_name, vector<resources_in_inventory> >.
A Product is a general type of resource in the Cyclus simulation, and is a catch-all for non-standard...
std::map< Request< T > *, std::map< Bid< T > *, double > > type
std::string spec()
The string representation of the agent spec that uniquely identifies the concrete agent class/module...
object value (collection of name/value pairs).
virtual const int id() const =0
const std::string kind() const
Returns a string that describes the agent subclass (e.g.
int parent(int nuc, unsigned int rx, std::string z="n")
Context * context() const
Returns this agent's simulation context.
std::string kind_
describes the agent subclass (e.g.
virtual Json::Value annotations()
Returns an agent's json annotations for all state variables and any other information the developer w...
virtual void AdjustProductPrefs(PrefMap< Product >::type &prefs)
default implementation for material preferences.
DbInit provides an interface for agents to record data to the output db that automatically injects th...
void prototype(std::string p)
Sets the agent's prototype.
Agent * parent() const
Returns parent of this agent. Returns NULL if the agent has no parent.
const int lifetime() const
Returns the number of time steps this agent operates between building and decommissioning (-1 if the ...
A simulation context provides access to necessary simulation-global functions and state...
The abstract base class used by all types of agents that live and interact in a simulation.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
The material class is primarily responsible for enabling basic material manipulation while helping en...
Handles initialization of a simulation from the output database.
virtual void AdjustMatlPrefs(PrefMap< Material >::type &prefs)
default implementation for material preferences.
const int parent_id() const
Returns the id for this agent's parent.
const std::set< Agent * > & children() const
Returns a list of children this agent has.
Interface implemented by backends that support rudimentary querying.
void spec(std::string new_impl)
Sets this agent's agent spec.