CYCAMORE
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 
11 namespace cycamore {
12 
13 typedef 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.
22 class DeployInst : public cyclus::Institution,
23  public cyclus::toolkit::Position {
24  #pragma cyclus note { \
25  "doc": \
26  "Builds and manages agents (facilities) according to a manually" \
27  " specified deployment schedule. Deployed agents are automatically" \
28  " decommissioned at the end of their lifetime. The user specifies a" \
29  " list of prototypes for" \
30  " each and corresponding build times, number to build, and (optionally)" \
31  " lifetimes. The same prototype can be specified multiple times with" \
32  " any combination of the same or different build times, build number," \
33  " and lifetimes. " \
34  }
35  public:
36  DeployInst(cyclus::Context* ctx);
37 
38  virtual ~DeployInst();
39 
40  virtual std::string version() { return CYCAMORE_VERSION; }
41 
42  #pragma cyclus
43 
44  virtual void Build(cyclus::Agent* parent);
45 
46  virtual void EnterNotify();
47 
48  protected:
49  #pragma cyclus var { \
50  "doc": "Ordered list of prototypes to build.", \
51  "uitype": ("oneormore", "prototype"), \
52  "uilabel": "Prototypes to deploy", \
53  }
54  std::vector<std::string> prototypes;
55 
56  #pragma cyclus var { \
57  "doc": "Time step on which to deploy agents given in prototype list " \
58  "(same order).", \
59  "uilabel": "Deployment times", \
60  }
61  std::vector<int> build_times;
62 
63  #pragma cyclus var { \
64  "doc": "Number of each prototype given in prototype list that should be " \
65  "deployed (same order).", \
66  "uilabel": "Number to deploy", \
67  }
68  std::vector<int> n_build;
69 
70 
71  #pragma cyclus var { \
72  "doc": "Lifetimes for each prototype in prototype list (same order)." \
73  " These lifetimes override the lifetimes in the original prototype" \
74  " definition." \
75  " If unspecified, lifetimes from the original prototype definitions"\
76  " are used." \
77  " Although a new prototype is created in the Prototypes table for" \
78  " each lifetime with the suffix '_life_[lifetime]'," \
79  " all deployed agents themselves will have the same original" \
80  " prototype name (and so will the Agents tables).", \
81  "default": [], \
82  "uilabel": "Lifetimes" \
83  }
84  std::vector<int> lifetimes;
85 
86  private:
87  #pragma cyclus var { \
88  "default": 0.0, \
89  "uilabel": "Geographical latitude in degrees as a double", \
90  "doc": "Latitude of the agent's geographical position. The value should " \
91  "be expressed in degrees as a double." \
92  }
93  double latitude;
94 
95  #pragma cyclus var { \
96  "default": 0.0, \
97  "uilabel": "Geographical longitude in degrees as a double", \
98  "doc": "Longitude of the agent's geographical position. The value should " \
99  "be expressed in degrees as a double." \
100  }
101  double longitude;
102 
103  cyclus::toolkit::Position coordinates;
104 
106  void RecordPosition();
107 };
108 
109 } // namespace cycamore
110 
111 #endif // CYCAMORE_SRC_DEPLOY_INST_H_
virtual void Build(cyclus::Agent *parent)
std::vector< std::string > prototypes
cycamore::GrowthRegion string
virtual std::string version()
void RecordPosition()
Records an agent&#39;s latitude and longitude to the output db.
std::map< int, std::vector< std::string > > BuildSched
cyclus::toolkit::Position coordinates