Generate Functions (rickshaw.Generate
)¶
Generates a random Cyclus input file. Contains functions to stochastically generate a niche path through the nuclear fuel cycle as well as the appropriate archetypes, recipes, commodities, and a control scheme for the nuclear fuel cycle those niches represent. Archetypes state variables with a “range” uitype are stochastically generated within a physically valid range.
-
rickshaw.generate.
archetype_block
(sim_spec, arches)[source]¶ Formats the archetypes into the input file format
Parameters: arches : list
List of assigned archetype.
Returns: block : dictionary
Dictionary containing each necessary element of the archetype block in a Cyclus input file.
-
rickshaw.generate.
choose_archetypes
(sim_spec, niches)[source]¶ Determines the correct archetype from cyclus or cycamore based on the niche
Parameters: sim_spec : SimSpec
Specification for simulation generation
niches : list
List of sequential niches returned from choose_niches.py
Returns: arches : list
List of assigned archetypes. Same list length as niches.
-
rickshaw.generate.
choose_commodities
(sim_spec, niches)[source]¶ Creates list of commodities individually chosen by the choose_commodity function
Parameters: sim_spec : SimSpec
Specification for simulation generation
niches : list
List of sequential niches returned from choose_niches.py
Returns: commods : list
List of in and out commodities to be added to the archetypes in the input file.
-
rickshaw.generate.
choose_commodity
(sim_spec, keyfrom, keyto, unique_commods)[source]¶ Determine commodity based on a from/to pairs.
Parameters: sim_spec : SimSpec
Specification for simulation generation
keyfrom : str
Origin niche name.
keyto : str
Following niche name.
unique_commods : set
Current names used by chosen commodities.
Returns: commod_name : str
A unique commodity name.
-
rickshaw.generate.
choose_recipes
(sim_spec, commods)[source]¶ Chooses the specific recipe for each commodity in the commods list
Parameters: sim_spec : SimSpec
Specification for simulation generation
- commods : list
List of in and out commodities to be added to the archetypes in the input file.
Returns: recipes : list
List of the assigned recipes to be added to the recipe section of the generated input file[]
-
rickshaw.generate.
generate
(max_num_niches=10, sim_spec=None)[source]¶ Creates a random Cyclus simulation input file dict.
Parameters: max_num_niches : int, optional
The maximum number of niches in the simulation
Returns: inp : dict
A simulation dictionary in JSON form, suitable for use as a Cyclus input file.
-
rickshaw.generate.
generate_archetype
(sim_spec, arche, in_commod, out_commod, in_recipe, out_recipe)[source]¶ Pulls in the metadata for each archetype
Parameters: sim_spec : SimSpec
Specification for simulation generation
- arche : str
The name of the archetype that is being generated.
- in_commod : str
The incommodity received by the specific archetype as determined by choose_commodities.py
- out_commod : str
The outcommodity produced by the specific archetype as determined by choose_commodities.py
Returns: config : dict
The JSON formatted archetype dictionary to be put in the input file
-
rickshaw.generate.
random_niches
(sim_spec, max_niches, choice='mine', niches=None)[source]¶ Generates a randomized list of niches of the nuclear fuel cycle.
Parameters: sim_spec : SimSpec
Specification for simulation generation
- max_niches : int
The maximum number of niches desired by the user, the total number of generated niches does not have to reach this number.
- choice : str
If desired the starting point of the list of niches can be set. Preset to the natural starting point of “mine”
- niches : None
This will be set to be a list at the beginning of the function and will contain the chosen niches.
Returns: niches : list
List of connected niches that model the steps of the full nuclear fuel cycle.