CYCLUS
Loading...
Searching...
No Matches
position.cycpp.h
Go to the documentation of this file.
1// This includes the required header to add geographic coordinates to a
2// archetypes.
3// One only needs to:
4// - '#include "toolkit/position.cycpp.h"' in the header of the archetype class
5// (it is strongly recommended to inject this snippet as `private:`, but
6// archetype developers are free to make other choices)
7// - In the EnterNotify() method:
8// - Call the InitializePosition(); function
9// - In the constructor in the .cc file:
10// - Add latitude(0.0), longitude(0.0), to the initialization list
11
13
14// clang-format off
15#pragma cyclus var { \
16 "default": 0.0, \
17 "uilabel": "Geographical latitude in degrees as a double", \
18 "doc": "Latitude of the agent's geographical position. The value should " \
19 "be expressed in degrees as a double." \
20}
21double latitude;
22
23#pragma cyclus var { \
24 "default": 0.0, \
25 "uilabel": "Geographical longitude in degrees as a double", \
26 "doc": "Longitude of the agent's geographical position. The value should " \
27 "be expressed in degrees as a double." \
28}
29double longitude;
30// clang-format on
31
32// Provided default values to give the option to manually override
34 coordinates.set_position(latitude, longitude);
35 coordinates.RecordPosition(this);
36}
37
38// required for compilation but not added by the cycpp preprocessor...
39std::vector<int> cycpp_shape_latitude = {0};
40std::vector<int> cycpp_shape_longitude = {0};
The Position class is a basic class that stores the geographic location of each agent in latitude and...
Definition position.h:60
std::vector< int > cycpp_shape_latitude
void InitializePosition()
cyclus::toolkit::Position coordinates
double latitude
double longitude
std::vector< int > cycpp_shape_longitude