diff --git a/src/enrichment.h b/src/enrichment.h index 5be1dd3b0..a0dd72d33 100644 --- a/src/enrichment.h +++ b/src/enrichment.h @@ -6,6 +6,8 @@ #include "cyclus.h" #include "cycamore_version.h" +#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO + namespace cycamore { /// @class SWUConverter @@ -324,10 +326,10 @@ class Enrichment double initial_feed; #pragma cyclus var { \ - "default": "cyclus::cy_large_double", "tooltip": "max inventory of feed material (kg)", \ + "default": CY_LARGE_DOUBLE, "tooltip": "max inventory of feed material (kg)", \ "uilabel": "Maximum Feed Inventory", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "maximum total inventory of natural uranium in " \ "the enrichment facility (kg)" \ } @@ -362,11 +364,11 @@ class Enrichment bool order_prefs; #pragma cyclus var { \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "tooltip": "SWU capacity (kgSWU/timestep)", \ "uilabel": "SWU Capacity", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "separative work unit (SWU) capacity of enrichment " \ "facility (kgSWU/timestep) " \ } diff --git a/src/fuel_fab.h b/src/fuel_fab.h index 5d83086f3..a36ff3456 100644 --- a/src/fuel_fab.h +++ b/src/fuel_fab.h @@ -5,6 +5,8 @@ #include "cyclus.h" #include "cycamore_version.h" +#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO + namespace cycamore { /// FuelFab takes in 2 streams of material and mixes them in ratios in order to @@ -234,9 +236,9 @@ class FuelFab "doc": "Maximum number of kg of fuel material that can be supplied per time step.", \ "uilabel": "Maximum Throughput", \ "units": "kg", \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ } double throughput; diff --git a/src/mixer.h b/src/mixer.h index ae24512d0..def723b2b 100644 --- a/src/mixer.h +++ b/src/mixer.h @@ -5,6 +5,8 @@ #include "cycamore_version.h" #include "cyclus.h" +#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO + namespace cycamore { /// Mixer mixes N streams with fixed, static, user-specified @@ -85,9 +87,9 @@ class Mixer " If full, the facility halts operation until space becomes" \ " available.", \ "uilabel": "Maximum Leftover Inventory", \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "units": "kg", \ } double out_buf_size; @@ -96,11 +98,11 @@ class Mixer cyclus::toolkit::ResBuf output; #pragma cyclus var { \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "doc": "Maximum number of kg of fuel material that can be mixed per time step.", \ "uilabel": "Maximum Throughput", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "units": "kg", \ } double throughput; diff --git a/src/separations.h b/src/separations.h index 18d1e17e2..6ab624147 100644 --- a/src/separations.h +++ b/src/separations.h @@ -4,6 +4,8 @@ #include "cyclus.h" #include "cycamore_version.h" +#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO + namespace cycamore { /// SepMaterial returns a material object that represents the composition and @@ -147,9 +149,9 @@ class Separations "doc" : "Maximum quantity of feed material that can be processed per time "\ "step.", \ "uilabel": "Maximum Separations Throughput", \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "units": "kg/(time step)", \ } double throughput; @@ -170,9 +172,9 @@ class Separations " If full, the facility halts operation until space becomes " \ "available.", \ "uilabel": "Maximum Leftover Inventory", \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "units": "kg", \ } double leftoverbuf_size; diff --git a/src/sink.h b/src/sink.h index 3e9c86bba..9e12cd2f6 100644 --- a/src/sink.h +++ b/src/sink.h @@ -9,6 +9,8 @@ #include "cyclus.h" #include "cycamore_version.h" +#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO + namespace cycamore { class Context; @@ -126,7 +128,7 @@ class Sink "doc":"preferences for each of the given commodities, in the same order."\ "Defauts to 1 if unspecified",\ "uilabel":"In Commody Preferences", \ - "range": [None, ["cyclus::cy_near_zero", "cyclus::cy_large_double"]], \ + "range": [None, [CY_NEAR_ZERO, CY_LARGE_DOUBLE]], \ "uitype":["oneormore", "range"]} std::vector in_commod_prefs; @@ -140,20 +142,20 @@ class Sink std::string recipe_name; /// max inventory size - #pragma cyclus var {"default": "cyclus::cy_large_double", \ + #pragma cyclus var {"default": CY_LARGE_DOUBLE, \ "tooltip": "sink maximum inventory size", \ "uilabel": "Maximum Inventory", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "total maximum inventory size of sink facility"} double max_inv_size; /// monthly acceptance capacity - #pragma cyclus var {"default": "cyclus::cy_large_double", \ + #pragma cyclus var {"default": CY_LARGE_DOUBLE, \ "tooltip": "sink capacity", \ "uilabel": "Maximum Throughput", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "capacity the sink facility can " \ "accept at each time step"} double capacity; @@ -179,7 +181,7 @@ class Sink "tooltip": "fraction of available space to determine the mean", \ "uilabel": "Random Size Mean", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "When a normal distribution is used to determine the " \ "size of the request, this is the fraction of available " \ "space to use as the mean. Default 1.0. Note " \ @@ -193,7 +195,7 @@ class Sink "tooltip": "fraction of available space to determine the std dev", \ "uilabel": "Random Size Std Dev", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "When a normal distribution is used to determine the " \ "size of the request, this is the fraction of available " \ "space to use as the standard deviation. Default 0.1"} @@ -220,7 +222,7 @@ class Sink "tooltip": "mean of the random frequency", \ "uilabel": "Random Frequency Mean", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "When a normal distribution is used to determine the " \ "frequency of the request, this is the mean. Default 1"} double random_frequency_mean; @@ -230,7 +232,7 @@ class Sink "tooltip": "std dev of the random frequency", \ "uilabel": "Random Frequency Std Dev", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "When a normal distribution is used to determine the " \ "frequency of the request, this is the standard deviation. Default 1"} double random_frequency_stddev; @@ -240,17 +242,17 @@ class Sink "tooltip": "lower bound of the random frequency", \ "uilabel": "Random Frequency Lower Bound", \ "uitype": "range", \ - "range": [1, "cyclus::cy_large_int"], \ + "range": [1, CY_LARGE_INT], \ "doc": "When a random distribution is used to determine the " \ "frequency of the request, this is the lower bound. Default 1"} int random_frequency_min; // random frequency upper bound - #pragma cyclus var {"default": "cyclus::cy_large_int", \ + #pragma cyclus var {"default": CY_LARGE_INT, \ "tooltip": "upper bound of the random frequency", \ "uilabel": "Random Frequency Upper Bound", \ "uitype": "range", \ - "range": [1, "cyclus::cy_large_int"], \ + "range": [1, CY_LARGE_INT], \ "doc": "When a random distribution is used to determine the " \ "frequency of the request, this is the upper bound. Default cyclus::cy_large_int"} int random_frequency_max; diff --git a/src/source.h b/src/source.h index ade91dea8..692449ecf 100644 --- a/src/source.h +++ b/src/source.h @@ -7,6 +7,8 @@ #include "cyclus.h" #include "cycamore_version.h" +#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO + namespace cycamore { class Context; @@ -97,21 +99,21 @@ class Source : public cyclus::Facility, " Every trade decreases this value by the supplied material " \ "quantity. When it reaches zero, the source cannot provide any " \ " more material.", \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "uilabel": "Initial Inventory", \ "units": "kg", \ } double inventory_size; #pragma cyclus var { \ - "default": "cyclus::cy_large_double", \ + "default": CY_LARGE_DOUBLE, \ "tooltip": "per time step throughput", \ "units": "kg/(time step)", \ "uilabel": "Maximum Throughput", \ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "doc": "amount of commodity that can be supplied at each time step", \ } double throughput; diff --git a/src/storage.cc b/src/storage.cc index 1cd893741..9455eda3a 100644 --- a/src/storage.cc +++ b/src/storage.cc @@ -11,7 +11,7 @@ Storage::Storage(cyclus::Context* ctx) latitude(0.0), longitude(0.0), coordinates(latitude, longitude) { - inventory_tracker.Init({&inventory, &stocks, &ready, &processing}, cyclus::cy_large_double); + inventory_tracker.Init({&inventory, &stocks, &ready, &processing}, cyclus::CY_LARGE_DOUBLE); cyclus::Warn( "The Storage Facility is experimental.");}; diff --git a/src/storage.h b/src/storage.h index 0599df39c..1b09acea5 100644 --- a/src/storage.h +++ b/src/storage.h @@ -10,6 +10,8 @@ #include "boost/shared_ptr.hpp" +#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO + namespace cycamore { /// @class Storage /// @@ -164,7 +166,7 @@ class Storage "doc":"preferences for each of the given commodities, in the same order."\ "Defauts to 1 if unspecified",\ "uilabel":"In Commody Preferences", \ - "range": [None, ["cyclus::cy_near_zero", "cyclus::cy_large_double"]], \ + "range": [None, [CY_NEAR_ZERO, CY_LARGE_DOUBLE]], \ "uitype":["oneormore", "range"]} std::vector in_commod_prefs; @@ -198,25 +200,25 @@ class Storage " offered", \ "uilabel":"Sell Quantity",\ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "units": "kg"} double sell_quantity; - #pragma cyclus var {"default": "cyclus::cy_large_double",\ + #pragma cyclus var {"default": CY_LARGE_DOUBLE,\ "tooltip":"throughput per timestep (kg)",\ "doc":"the max amount that can be moved through the facility per timestep (kg)",\ "uilabel":"Throughput",\ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "units":"kg"} double throughput; - #pragma cyclus var {"default": "cyclus::cy_large_double",\ + #pragma cyclus var {"default": CY_LARGE_DOUBLE,\ "tooltip":"maximum inventory size (kg)",\ "doc":"the maximum amount of material that can be in all storage buffer stages",\ "uilabel":"Maximum Inventory Size",\ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "units":"kg"} double max_inv_size; @@ -246,7 +248,7 @@ class Storage "active_buying_frequency_type. Must be greater than or equal to 1 (i.e., agent "\ "cannot always be dormant)",\ "uitype": "range", \ - "range": [1, "cyclus::cy_large_int"], \ + "range": [1, CY_LARGE_INT], \ "uilabel": "Active Buying Frequency Value"} int active_buying_val; @@ -256,7 +258,7 @@ class Storage "Uniform and optional for Normal active_buying_frequency_type. Must be greater than "\ "or equal to 1 ",\ "uitype": "range", \ - "range": [1, "cyclus::cy_large_int"], \ + "range": [1, CY_LARGE_INT], \ "uilabel": "Active Buying Frequency Minimum"} int active_buying_min; @@ -265,7 +267,7 @@ class Storage "doc": "The maximum length in time steps of the active buying period. Required for "\ "Uniform active_buying_frequency_type, optional for Normal. Must be greater than or equal to active_buying_min ",\ "uitype": "range", \ - "range": [1, "cyclus::cy_large_int"], \ + "range": [1, CY_LARGE_INT], \ "uilabel": "Active Buying Frequency Maximum"} int active_buying_max; @@ -274,7 +276,7 @@ class Storage "doc": "The mean length in time steps of the active buying period. Required for "\ "Normal active_buying_frequency_type. Must be greater than or equal to 1 ",\ "uitype": "range", \ - "range": [1.0, "cyclus::cy_large_double"], \ + "range": [1.0, CY_LARGE_DOUBLE], \ "uilabel": "Active Buying Frequency Mean"} double active_buying_mean; @@ -283,7 +285,7 @@ class Storage "doc": "The standard deviation of the length in time steps of the active buying period. "\ "Required for Normal active_buying_frequency_type. Must be greater than or equal to 0 ",\ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "uilabel": "Active Buying Frequency Standard Deviation"} double active_buying_stddev; @@ -303,7 +305,7 @@ class Storage "doc": "The length in time steps of the dormant buying period. Required for fixed "\ "dormant_buying_frequency_type. Default is -1, agent has no dormant period and stays active.",\ "uitype": "range", \ - "range": [-1, "cyclus::cy_large_int"], \ + "range": [-1, CY_LARGE_INT], \ "uilabel": "Dormant Buying Frequency Value"} int dormant_buying_val; @@ -312,7 +314,7 @@ class Storage "doc": "The minimum length in time steps of the dormant buying period. Required for Uniform and optional for "\ "Normal dormant_buying_frequency_type.",\ "uitype": "range", \ - "range": [0, "cyclus::cy_large_int"], \ + "range": [0, CY_LARGE_INT], \ "uilabel": "Dormant Buying Frequency Minimum"} int dormant_buying_min; @@ -321,7 +323,7 @@ class Storage "doc": "The maximum length in time steps of the dormant buying period. Required for "\ "Uniform dormant_buying_frequency_type, optional for Normal. Must be greater than or equal to dormant_buying_min ",\ "uitype": "range", \ - "range": [0, "cyclus::cy_large_int"], \ + "range": [0, CY_LARGE_INT], \ "uilabel": "Dormant Buying Frequency Maximum"} int dormant_buying_max; @@ -330,7 +332,7 @@ class Storage "doc": "The mean length in time steps of the dormant buying period. Required for "\ "Normal dormant_buying_frequency_type. Must be greater than or equal to 0 ",\ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "uilabel": "Dormant Buying Frequency Mean"} double dormant_buying_mean; @@ -339,7 +341,7 @@ class Storage "doc": "The standard deviation of the length in time steps of the dormant buying period. "\ "Required for Normal dormant_buying_frequency_type. Must be greater than or equal to 0 ",\ "uitype": "range", \ - "range": [0.0, "cyclus::cy_large_double"], \ + "range": [0.0, CY_LARGE_DOUBLE], \ "uilabel": "Dormant Buying Frequency Standard Deviation"} double dormant_buying_stddev; diff --git a/src/storage_tests.cc b/src/storage_tests.cc index 3f0b159ec..41e7e16b7 100644 --- a/src/storage_tests.cc +++ b/src/storage_tests.cc @@ -105,7 +105,7 @@ TEST_F(StorageTest, InitialState) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(StorageTest, CurrentCapacity){ TestCurrentCap(src_facility_,max_inv_size); - max_inv_size = cyclus::cy_large_double; + max_inv_size = cyclus::CY_LARGE_DOUBLE; SetUpStorage(); TestInitState(src_facility_); }