CYCLUS
|
The Region class is the abstract class/interface used by all region agents.
This is all that is known externally about Regions
The Region type assists in defining the region-institution-facility hierarchy in Cyclus. A Region region is an actor associated with a set of institutions or facilities for which it is responsible. A Region may be used to adjust preferences in the ResourceExchange to make material routing decisions based on interfacility relationships. Deployment is a primary differentiator between different Region implementations.
Like all agent implementations, there are a number of implementations that are distributed as part of the core Cyclus application as well as implementations contributed by third-party developers. The links below describe additional parameters necessary for the complete definition of a region of that implementation.
All regions perform three major functions:
Different regional types will be required to fully define the first two functions while the third is a built-in capability for all region types. For instance, one may wish to include a region which has exponential growth as its driving factor for facility creation or one may wish to have pre-determined building order based on time step (e.g. the JAEA benchmark). Additionally, one may wish for there to be a one-to-one region-to-instituion deployment for simple agents and thus demand that each instiution simply build a facility when its region determines the facility's necessity. However, one may instead wish to have two competing instiutions in one region and have the institution which provides the best incentive to the region to build a required facility.
#include <region.h>
Protected Member Functions | |
void | InitFrom (Region *m) |
Protected Member Functions inherited from cyclus::Agent | |
virtual std::string | InformErrorMsg (std::string msg) |
void | InitFrom (Agent *m) |
Additional Inherited Members | |
Protected Attributes inherited from cyclus::Agent | |
std::string | kind_ |
cyclus::Region::Region | ( | Context * | ctx | ) |
|
inlinevirtual |
perform actions required when entering the simulation
Reimplemented from cyclus::Agent.
|
virtual |
Decommissions the agent, removing it from the simulation.
Results in destruction of the agent object. If agents write their own Decommission function, they must call their superclass' Decommission function at the END of their Decommission function.
Reimplemented from cyclus::Agent.
|
virtual |
Called to give the agent an opportunity to register for services (e.g.
ticks/tocks and resource exchange). Note that this may be called more than once, and so agents should track their registrations carefully. If agents implement this function, they must call their superclass's EnterNotify function at the BEGINNING of their EnterNotify function.
Reimplemented from cyclus::Agent.
|
inlinevirtual |
Translates info for the agent from an input file to the database by reading parameters from the passed InfileTree (parsed from xml) and recording data via the DbInit variable.
The simulation id and agent id are automatically injected in all data transfered to the database through DbInit. This function must be implemented by all agents. This function must call the superclass' InfileToDb function before doing any other work.
Agent parameters in the InfileTree are scoped in the "agent/*‍/" path. The superclass InitFrom expects the scope InfileTree passed to it to be unchanged from the agent's InfileTree arg.
Example:
Reimplemented from cyclus::Agent.
|
inlinevirtual |
Intializes an agent's internal state from the database.
Appropriate simulation id, agent id, and time filters are automatically included in all queries. If the agent is a direct subclass of the Agent class, than it should NOT call its superclass' InitFrom(QueryableBackend*) function. If, however, it is a subclasses other Agent subclasses (e.g. subclass of Facility, Region, etc.), then it MUST call its superclass' InitFrom(QueryableBackend*) function. Example:
Reimplemented from cyclus::Agent.
|
inlinevirtual |
Provides an agent's initial inventory of resources before a simulation begins.
The resources are keyed in the same way as given in the agent's SnapshotInv function. Agents should iterate through each named inventory provided and populate their corresponding resource containers with the given resources.
Implements cyclus::Agent.
Snapshots agent-internal state to the database via the DbInit var di.
The simulation id , agent id, and the simulation time are automatically injected in all information transfered to the database through DbInit. If the agent is a direct subclass of the Agent class, than it should NOT call its superclass' Snapshot function. If, however, it subclasses other Agent subclasses (e.g. subclass of Facility, Region, etc.), then it MUST call its superclass' Snapshot function. Example:
Implements cyclus::Agent.
|
inlinevirtual |
Snapshots an agent's resource inventories to the database.
The set of resources in each container should be stored under a string key unique for that container that will be used when re-initializing inventories for restarted simulations in the InitInv function.
Implements cyclus::Agent.
|
virtual |
every agent should be able to print a verbose description
Reimplemented from cyclus::Agent.
Simulation agents do their beginning-of-timestep activities in the Tick method.
time | is the current simulation timestep |
Implements cyclus::TimeListener.
Simulation agents do their end-of-timestep activities in the Tock method.
time | is the current simulation timestep |
Implements cyclus::TimeListener.