CYCAMORE
Loading...
Searching...
No Matches
src/deploy_inst.h
Go to the documentation of this file.
1#ifndef CYCAMORE_SRC_DEPLOY_INST_H_
2#define CYCAMORE_SRC_DEPLOY_INST_H_
3
4#include <utility>
5#include <set>
6#include <map>
7
8#include "cyclus.h"
9#include "cycamore_version.h"
10
11namespace cycamore {
12
13typedef std::map<int, std::vector<std::string> > BuildSched;
14
15// Builds and manages agents (facilities) according to a manually specified
16// deployment schedule. Deployed agents are automatically decommissioned at
17// the end of their lifetime. The user specifies a list of prototypes for
18// each and corresponding build times, number to build, and (optionally)
19// lifetimes. The same prototype can be specified multiple times with any
20// combination of the same or different build times, build number, and
21// lifetimes.
22class DeployInst :
23 public cyclus::Institution,
24 public cyclus::toolkit::CommodityProducerManager,
25 public cyclus::toolkit::Position {
26 #pragma cyclus note { \
27 "doc": \
28 "Builds and manages agents (facilities) according to a manually" \
29 " specified deployment schedule. Deployed agents are automatically" \
30 " decommissioned at the end of their lifetime. Deployed and" \
31 " decommissioned agents are registered and unregistered with a" \
32 " region. The user specifies a list of prototypes for" \
33 " each and corresponding build times, number to build, and (optionally)" \
34 " lifetimes. The same prototype can be specified multiple times with" \
35 " any combination of the same or different build times, build number," \
36 " and lifetimes. " \
37 }
38 public:
39 DeployInst(cyclus::Context* ctx);
40
41 virtual ~DeployInst();
42
43 virtual std::string version() { return CYCAMORE_VERSION; }
44
45 #pragma cyclus
46
47 virtual void Build(cyclus::Agent* parent);
48
49 virtual void EnterNotify();
50
51 virtual void BuildNotify(Agent* m);
52 virtual void DecomNotify(Agent* m);
55 void WriteProducerInformation(cyclus::toolkit::CommodityProducer*
56 producer);
57
58 private:
60 void Register_(cyclus::Agent* agent);
61
63 void Unregister_(cyclus::Agent* agent);
64
65 protected:
66 #pragma cyclus var { \
67 "doc": "Ordered list of prototypes to build.", \
68 "uitype": ("oneormore", "prototype"), \
69 "uilabel": "Prototypes to deploy", \
70 }
71 std::vector<std::string> prototypes;
72
73 #pragma cyclus var { \
74 "doc": "Time step on which to deploy agents given in prototype list " \
75 "(same order).", \
76 "uilabel": "Deployment times", \
77 }
78 std::vector<int> build_times;
79
80 #pragma cyclus var { \
81 "doc": "Number of each prototype given in prototype list that should be " \
82 "deployed (same order).", \
83 "uilabel": "Number to deploy", \
84 }
85 std::vector<int> n_build;
86
87
88 #pragma cyclus var { \
89 "doc": "Lifetimes for each prototype in prototype list (same order)." \
90 " These lifetimes override the lifetimes in the original prototype" \
91 " definition." \
92 " If unspecified, lifetimes from the original prototype definitions"\
93 " are used." \
94 " Although a new prototype is created in the Prototypes table for" \
95 " each lifetime with the suffix '_life_[lifetime]'," \
96 " all deployed agents themselves will have the same original" \
97 " prototype name (and so will the Agents tables).", \
98 "default": [], \
99 "uilabel": "Lifetimes" \
100 }
101 std::vector<int> lifetimes;
102
103 private:
104 #pragma cyclus var { \
105 "default": 0.0, \
106 "uilabel": "Geographical latitude in degrees as a double", \
107 "doc": "Latitude of the agent's geographical position. The value should " \
108 "be expressed in degrees as a double." \
109 }
110 double latitude;
111
112 #pragma cyclus var { \
113 "default": 0.0, \
114 "uilabel": "Geographical longitude in degrees as a double", \
115 "doc": "Longitude of the agent's geographical position. The value should " \
116 "be expressed in degrees as a double." \
117 }
118 double longitude;
119
120 cyclus::toolkit::Position coordinates;
121
124};
125
126} // namespace cycamore
127
128#endif // CYCAMORE_SRC_DEPLOY_INST_H_
#define CYCAMORE_VERSION
virtual void BuildNotify(Agent *m)
void WriteProducerInformation(cyclus::toolkit::CommodityProducer *producer)
write information about a commodity producer to a stream
void Unregister_(cyclus::Agent *agent)
unregister a child
void RecordPosition()
Records an agent's latitude and longitude to the output db.
virtual void DecomNotify(Agent *m)
DeployInst(cyclus::Context *ctx)
virtual void Build(cyclus::Agent *parent)
void Register_(cyclus::Agent *agent)
register a child
virtual std::string version()
cyclus::toolkit::Position coordinates
std::vector< std::string > prototypes
virtual void EnterNotify()
std::map< int, std::vector< std::string > > BuildSched