'frout': ['frstorage'], 'lwrpu': ['lwrmixer'], 'frpu': ['frmixer'], 'mixerout': ['fr'], 'lwrreprocessingwaste': ['lwrsink'], 'frreprocessingwaste': ['frsink'] } for commod, facility in commod_dict.items(): agent_entry_dict[commod] = tester.get_agent_dict(output_file, facility) all_dict['power'] = tester.supply_demand_dict_driving(output_file, demand_eq, 'power') plotter.plot_demand_supply_agent(all_dict['power'], agent_entry_dict['power'], 'power', '0-' + calc_method + '-power', True, True, False, 1) front_commods = ['sourceout', 'enrichmentout'] mid_commods = ['mixerout'] back_commods = [ 'lwrstorageout', 'frstorageout', 'lwrout', 'frout', 'lwrreprocessingwaste', 'frreprocessingwaste', 'frpu', 'lwrpu' ] for commod in front_commods: all_dict[commod] = tester.supply_demand_dict_nondriving( output_file, commod, True) name = '0-' + calc_method + '-' + commod plotter.plot_demand_supply_agent(all_dict[commod], agent_entry_dict[commod], commod, name,
'frout': ['frstorage'], 'lwrtru': ['pumixerlwr'], 'frtru': ['pumixerfr'], 'lwrreprocessingwaste': ['lwrsink'], 'frreprocessingwaste': ['frsink'] } for commod, facility in commod_dict.items(): agent_entry_dict[commod] = tester.get_agent_dict(output_file, facility) # get supply deamnd dict all_dict['power'] = tester.supply_demand_dict_driving(output_file, demand_eq, 'power') plotter.plot_demand_supply_agent(all_dict['power'], agent_entry_dict['power'], 'power', 'eg01-eg24-flatpower-d3ploy_power', True, True, False, 1) front_commods = ['sourceout', 'enrichmentout'] back_commods = [ 'lwrstorageout', 'frstorageout', 'lwrout', 'frout', 'lwrreprocessingwaste', 'frreprocessingwaste', 'frtru', 'lwrtru' ] for commod in front_commods: all_dict[commod] = tester.supply_demand_dict_nondriving( output_file, commod, True) name = 'B2000-' + commod plotter.plot_demand_supply_agent(all_dict[commod], agent_entry_dict[commod], commod, name, True, True, False, 1)
"reactor10", "newreactor", ], ) agent_entry_dict["fuel"] = tester.get_agent_dict( output_file, ["source", "initialsource"] ) agent_entry_dict["spent_fuel"] = tester.get_agent_dict(output_file, [ "sink"]) # plots demand, supply, calculated demand, calculated supply for the # scenario for each calc method plotter.plot_demand_supply_agent( all_dict_power, agent_entry_dict["power"], "power", name + " Power", True, False, False, ) plotter.plot_demand_supply_agent( all_dict_fuel, agent_entry_dict["fuel"], "fuel", name + " Fuel", True, False, False) plotter.plot_demand_supply_agent( all_dict_spent_fuel, agent_entry_dict["spent_fuel"],
output_file = name + '.sqlite' with open(input_file, 'w') as f: json.dump(scenario_1_input[calc_method], f) s = subprocess.check_output(['cyclus', '-o', output_file, input_file], universal_newlines=True, env=ENV) # Initialize dicts all_dict_fuel = {} agent_entry_dict = {} all_dict_fuel = tester.supply_demand_dict_driving(output_file, demand_eq, 'fuel') agent_entry_dict['fuel'] = tester.get_agent_dict(output_file, ['source']) plotter.plot_demand_supply_agent(all_dict_fuel, agent_entry_dict['fuel'], 'fuel', name + '_fuel', True, False, False) metric_dict = tester.metrics(all_dict_fuel, metric_dict, calc_method, 'fuel', True) df = pd.DataFrame(metric_dict) df.to_csv('scenario_1_output.csv') ########################################################################## ######################################SCENARIO 2########################## # scenario 2, source -> reactor (cycle time = 1, refuel time = 0) -> sink scenario_2_input = {} demand_eq = "1000*t"
'frout': ['frstorage'], 'lwrreprocessingoutpu': ['pumixerlwr'], 'frreprocessingoutpu': ['pumixerfr'], 'lwrreprocessingwaste': ['lwrsink'], 'frreprocessingwaste': ['frsink'] } for commod, facility in commod_dict.items(): agent_entry_dict[commod] = tester.get_agent_dict(output_file, facility) ########################### # get supply deamnd dict # and plot all_dict['power'] = tester.supply_demand_dict_driving(output_file, demand_eq, 'power') plotter.plot_demand_supply_agent(all_dict['power'], agent_entry_dict['power'], 'power', 'transitionscenario_1_input_power', True) front_commods = ['sourceout', 'enrichmentout'] back_commods = [ 'lwrstorageout', 'frstorageout', 'lwrout', 'frout', 'lwrreprocessingoutpu', 'frreprocessingoutpu', 'lwrreprocessingwaste', 'frreprocessingwaste' ] for commod in front_commods: all_dict[commod] = tester.supply_demand_dict_nondriving( output_file, commod, True) name = 'transitionscenario_1_input_' + commod plotter.plot_demand_supply_agent(all_dict[commod], agent_entry_dict[commod], commod, name, True) metric_dict = tester.metrics(all_dict[commod], metric_dict, calc_method,
agent_entry_dict['sourceoutput'] = tester.get_agent_dict(output_file, [ 'source']) agent_entry_dict['reactor1output'] = tester.get_agent_dict(output_file, [ 'separations1']) agent_entry_dict['separations1Pu'] = tester.get_agent_dict(output_file, [ 'mixer']) agent_entry_dict['reactor2output'] = tester.get_agent_dict(output_file, [ 'separations2']) # plots demand, supply, calculated demand, calculated supply for the # scenario for each calc method name1 = "scenario_7_input_" + calc_method + "_power" plotter.plot_demand_supply_agent( all_dict['power'], agent_entry_dict['power'], 'power', name1, True, False, False) name2 = "scenario_7_input_" + calc_method + "_sourceoutput" plotter.plot_demand_supply_agent( all_dict['sourceoutput'], agent_entry_dict['sourceoutput'], 'sourceoutput', name2, True, False, False) name3 = "scenario_7_input_" + calc_method + "_reactor1output" plotter.plot_demand_supply_agent( all_dict['reactor1output'],
'frstorageout': ['frreprocessing'], 'moxstorageout': ['moxreprocessing'], 'frmixerout': ['frmixer'], 'moxmixerout': ['moxmixer'], 'lwrtru': ['frmixer', 'moxmixer'], 'frtru': ['frmixer', 'moxmixer'], 'moxtru': ['frmixer', 'moxmixer'] } for commod, facility in commod_dict.items(): agent_entry_dict[commod] = tester.get_agent_dict(output_file, facility) all_dict['power'] = tester.supply_demand_dict_driving(output_file, demand_eq, 'power') plotter.plot_demand_supply_agent(all_dict['power'], agent_entry_dict['power'], 'power', name + '_power', True, True, False, 1) front_commods = ['sourceout', 'enrichmentout'] mid_commods = ['lwrtru', 'frtru', 'moxtru'] back_commods = ['lwrstorageout', 'frstorageout', 'moxstorageout'] for commod in front_commods: all_dict[commod] = tester.supply_demand_dict_nondriving( output_file, commod, True) name = 'flatpower-' + calc_method + '-' + commod plotter.plot_demand_supply_agent(all_dict[commod], agent_entry_dict[commod], commod, name, True, True, False, 1) metric_dict = tester.metrics(all_dict[commod], metric_dict, calc_method, commod, True)
all_dict_power = tester.supply_demand_dict_driving(output_file, demand_eq, 'power') all_dict_fuel = tester.supply_demand_dict_nondriving( output_file, 'fuel', True) all_dict_spentfuel = tester.supply_demand_dict_nondriving( output_file, 'spentfuel', False) agent_entry_dict['power'] = tester.get_agent_dict(output_file, ['reactor']) agent_entry_dict['fuel'] = tester.get_agent_dict(output_file, ['source']) agent_entry_dict['spentfuel'] = tester.get_agent_dict( output_file, ['sink']) # plots demand, supply, calculated demand, calculated supply for the # scenario for each calc method plotter.plot_demand_supply_agent(all_dict_power, agent_entry_dict['power'], 'power', name + "_power", True, False, False) plotter.plot_demand_supply_agent(all_dict_fuel, agent_entry_dict['fuel'], 'fuel', name + "_fuel", True, False, False) plotter.plot_demand_supply_agent(all_dict_spentfuel, agent_entry_dict['spentfuel'], 'spentfuel', name + "_spentfuel", False, False, False) metric_dict = tester.metrics(all_dict_power, metric_dict, calc_method, 'power', True) metric_dict = tester.metrics(all_dict_fuel, metric_dict, calc_method, 'fuel', True) metric_dict = tester.metrics(all_dict_spentfuel, metric_dict, calc_method, 'spentfuel', False)
env=ENV) # Initialize dicts all_dict = {} agent_entry_dict = {} all_dict['power'] = tester.supply_demand_dict_driving( output_file, demand_eq, 'power') all_dict['sourceoutput'] = tester.supply_demand_dict_nondriving( output_file, 'sourceoutput', True) agent_entry_dict['power'] = tester.get_agent_dict(output_file, ['reactor1', 'reactor2']) agent_entry_dict['sourceoutput'] = tester.get_agent_dict( output_file, ['source']) # plots demand, supply, calculated demand, calculated supply for the scenario for each calc method plotter.plot_demand_supply_agent(all_dict['power'], agent_entry_dict['power'], 'power', name, True) name2 = "scenario_7_input_" + calc_method + "_sourceoutput" plotter.plot_demand_supply_agent(all_dict['sourceoutput'], agent_entry_dict['sourceoutput'], 'sourceoutput', name2, True) metric_dict = tester.metrics(all_dict['power'], metric_dict, calc_method, 'power', True) metric_dict = tester.metrics(all_dict['sourceoutput'], metric_dict, calc_method, 'sourceoutput', True) df = pd.DataFrame(metric_dict) df.to_csv('scenario_7_output.csv')