Skip to content
Snippets Groups Projects
Commit 28f30360 authored by Christoph von Oy's avatar Christoph von Oy
Browse files

Removed xx_main files

parent 3a1151d9
No related branches found
No related tags found
No related merge requests found
Subproject commit 5432852affd9514efc9f7a7da2fe20172246ec76 Subproject commit e81644a46e73d1a7148f9c4ab8c95b44b25545fb
Subproject commit a0b6708198ed62b897e64be62737b63053a940e7 Subproject commit bd54324c0c2234a9633dab2ea5fdb7592bcc2feb
...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from Model_Library.Prosumer.main import ProsumerMain
from Model_Library.dynamics import TrivialDynamic from Model_Library.dynamics import TrivialDynamic
from Model_Library.Prosumer.model import Prosumer
from Tooling.input_profile_processor.input_profile_processor import ( from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles, process_input_profiles,
) )
...@@ -45,36 +45,30 @@ input_profile_dict = { ...@@ -45,36 +45,30 @@ input_profile_dict = {
input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic) input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic)
prosumer_paths = {"LaTreille": "depot.json"} with open("depot.json") as f:
prosumer_dict = dict()
for prosumer_name, prosumer_path in prosumer_paths.items():
with open(prosumer_path) as f:
prosumer_json = json.load(f) prosumer_json = json.load(f)
prosumer_dict[prosumer_name] = prosumer_json
prosumer_dict["LaTreille"]["components"]["bus_1_consumption"][ prosumer_json["components"]["bus_1_consumption"]["consumption"] = input_profiles[
"consumption" "bus_1_demand"
] = input_profiles["bus_1_demand"] ]
prosumer_dict["LaTreille"]["components"]["bus_2_consumption"][ prosumer_json["components"]["bus_2_consumption"]["consumption"] = input_profiles[
"consumption" "bus_2_demand"
] = input_profiles["bus_2_demand"] ]
prosumer_dict["LaTreille"]["components"]["bus_1_generation"][ prosumer_json["components"]["bus_1_generation"]["generation"] = input_profiles[
"generation" "bus_1_recuperation"
] = input_profiles["bus_1_recuperation"] ]
prosumer_dict["LaTreille"]["components"]["bus_2_generation"][ prosumer_json["components"]["bus_2_generation"]["generation"] = input_profiles[
"generation" "bus_2_recuperation"
] = input_profiles["bus_2_recuperation"] ]
prosumer_dict["LaTreille"]["additional_model_logic"]["charger_1_enable"][ prosumer_json["additional_model_logic"]["charger_1_enable"]["enable"] = input_profiles[
"enable" "bus_1_connected"
] = input_profiles["bus_1_connected"].values ].values
prosumer_dict["LaTreille"]["additional_model_logic"]["charger_2_enable"][ prosumer_json["additional_model_logic"]["charger_2_enable"]["enable"] = input_profiles[
"enable" "bus_2_connected"
] = input_profiles["bus_2_connected"].values ].values
prosumer_main = ProsumerMain(prosumer_dict, dynamic) prosumer = Prosumer("LaTrielle", prosumer_json, dynamic)
prosumer_sizing_strategy = ["annuity", "peak_power_costs"] prosumer.optimize_sizing("sized", ["annuity", "peak_power_costs"])
prosumer_main.optimize_sizing("sized", prosumer_sizing_strategy)
prosumer_main.save_results() prosumer.save_results("output_files")
...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from Model_Library.Prosumer.main import ProsumerMain
from Model_Library.dynamics import TrivialDynamic from Model_Library.dynamics import TrivialDynamic
from Model_Library.Prosumer.model import Prosumer
from Tooling.input_profile_processor.input_profile_processor import ( from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles, process_input_profiles,
) )
...@@ -45,54 +45,48 @@ input_profile_dict = { ...@@ -45,54 +45,48 @@ input_profile_dict = {
input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic) input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic)
prosumer_paths = {"LaTreille": "HPC.json"} with open("HPC.json") as f:
prosumer_dict = dict()
for prosumer_name, prosumer_path in prosumer_paths.items():
with open(prosumer_path) as f:
prosumer_json = json.load(f) prosumer_json = json.load(f)
prosumer_dict[prosumer_name] = prosumer_json
prosumer_dict["LaTreille"]["components"]["bus_1_consumption"][ prosumer_json["components"]["bus_1_consumption"]["consumption"] = input_profiles[
"consumption" "bus_1_demand"
] = input_profiles["bus_1_demand"] ]
prosumer_dict["LaTreille"]["components"]["bus_2_consumption"][ prosumer_json["components"]["bus_2_consumption"]["consumption"] = input_profiles[
"consumption" "bus_2_demand"
] = input_profiles["bus_2_demand"] ]
prosumer_dict["LaTreille"]["components"]["bus_1_generation"][ prosumer_json["components"]["bus_1_generation"]["generation"] = input_profiles[
"generation" "bus_1_recuperation"
] = input_profiles["bus_1_recuperation"] ]
prosumer_dict["LaTreille"]["components"]["bus_2_generation"][ prosumer_json["components"]["bus_2_generation"]["generation"] = input_profiles[
"generation" "bus_2_recuperation"
] = input_profiles["bus_2_recuperation"] ]
prosumer_dict["LaTreille"]["additional_model_logic"]["charger_1_enable"][ prosumer_json["additional_model_logic"]["charger_1_enable"]["enable"] = input_profiles[
"enable" "bus_1_connected"
] = input_profiles["bus_1_connected"].values.loc[:, "Connected to depot"] ].values.loc[:, "Connected to depot"]
prosumer_dict["LaTreille"]["additional_model_logic"]["charger_2_enable"][ prosumer_json["additional_model_logic"]["charger_2_enable"]["enable"] = input_profiles[
"enable" "bus_2_connected"
] = input_profiles["bus_2_connected"].values.loc[:, "Connected to depot"] ].values.loc[:, "Connected to depot"]
prosumer_dict["LaTreille"]["additional_model_logic"]["HPC_1_bus_1_enable"][ prosumer_json["additional_model_logic"]["HPC_1_bus_1_enable"][
"enable" "enable"
] = input_profiles["bus_1_connected"].values.loc[:, "Connected to HPC 1"] ] = input_profiles["bus_1_connected"].values.loc[:, "Connected to HPC 1"]
prosumer_dict["LaTreille"]["additional_model_logic"]["HPC_1_bus_2_enable"][ prosumer_json["additional_model_logic"]["HPC_1_bus_2_enable"][
"enable" "enable"
] = input_profiles["bus_1_connected"].values.loc[:, "Connected to HPC 2"] ] = input_profiles["bus_1_connected"].values.loc[:, "Connected to HPC 2"]
prosumer_dict["LaTreille"]["additional_model_logic"]["HPC_2_bus_1_enable"][ prosumer_json["additional_model_logic"]["HPC_2_bus_1_enable"][
"enable" "enable"
] = input_profiles["bus_1_connected"].values.loc[:, "Connected to HPC 3"] ] = input_profiles["bus_1_connected"].values.loc[:, "Connected to HPC 3"]
prosumer_dict["LaTreille"]["additional_model_logic"]["HPC_2_bus_2_enable"][ prosumer_json["additional_model_logic"]["HPC_2_bus_2_enable"][
"enable" "enable"
] = input_profiles["bus_2_connected"].values.loc[:, "Connected to HPC 1"] ] = input_profiles["bus_2_connected"].values.loc[:, "Connected to HPC 1"]
prosumer_dict["LaTreille"]["additional_model_logic"]["HPC_3_bus_1_enable"][ prosumer_json["additional_model_logic"]["HPC_3_bus_1_enable"][
"enable" "enable"
] = input_profiles["bus_2_connected"].values.loc[:, "Connected to HPC 2"] ] = input_profiles["bus_2_connected"].values.loc[:, "Connected to HPC 2"]
prosumer_dict["LaTreille"]["additional_model_logic"]["HPC_3_bus_2_enable"][ prosumer_json["additional_model_logic"]["HPC_3_bus_2_enable"][
"enable" "enable"
] = input_profiles["bus_2_connected"].values.loc[:, "Connected to HPC 3"] ] = input_profiles["bus_2_connected"].values.loc[:, "Connected to HPC 3"]
prosumer_main = ProsumerMain(prosumer_dict, dynamic) prosumer = Prosumer("LaTreille", prosumer_json, dynamic)
prosumer_sizing_strategy = ["annuity", "peak_power_costs"] prosumer.optimize_sizing("sized", ["annuity", "peak_power_costs"])
prosumer_main.optimize_sizing("sized", prosumer_sizing_strategy)
prosumer_main.save_results() prosumer.save_results("output_files")
...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from Model_Library.Prosumer.main import ProsumerMain
from Model_Library.dynamics import TrivialDynamic from Model_Library.dynamics import TrivialDynamic
from Model_Library.Prosumer.model import Prosumer
from Tooling.input_profile_processor.input_profile_processor import ( from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles, process_input_profiles,
) )
...@@ -45,62 +45,52 @@ input_profile_dict = { ...@@ -45,62 +45,52 @@ input_profile_dict = {
input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic) input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic)
prosumer_paths = {"LaTreille": "IMC.json"} with open("IMC.json") as f:
prosumer_dict = dict()
for prosumer_name, prosumer_path in prosumer_paths.items():
with open(prosumer_path) as f:
prosumer_json = json.load(f) prosumer_json = json.load(f)
prosumer_dict[prosumer_name] = prosumer_json
prosumer_dict["LaTreille"]["components"]["bus_1_consumption"][ prosumer_json["components"]["bus_1_consumption"]["consumption"] = input_profiles[
"consumption" "bus_1_demand"
] = input_profiles["bus_1_demand"] ]
prosumer_dict["LaTreille"]["components"]["bus_2_consumption"][ prosumer_json["components"]["bus_2_consumption"]["consumption"] = input_profiles[
"consumption" "bus_2_demand"
] = input_profiles["bus_2_demand"] ]
prosumer_dict["LaTreille"]["components"]["bus_1_generation"][ prosumer_json["components"]["bus_1_generation"]["generation"] = input_profiles[
"generation" "bus_1_recuperation"
] = input_profiles["bus_1_recuperation"] ]
prosumer_dict["LaTreille"]["components"]["bus_2_generation"][ prosumer_json["components"]["bus_2_generation"]["generation"] = input_profiles[
"generation" "bus_2_recuperation"
] = input_profiles["bus_2_recuperation"] ]
prosumer_dict["LaTreille"]["additional_model_logic"]["bus_1_connected"][ prosumer_json["additional_model_logic"]["bus_1_connected"]["enable"] = input_profiles[
"enable" "bus_1_connected"
] = input_profiles["bus_1_connected"].values ].values
prosumer_dict["LaTreille"]["additional_model_logic"]["bus_2_connected"][ prosumer_json["additional_model_logic"]["bus_2_connected"]["enable"] = input_profiles[
"enable" "bus_2_connected"
] = input_profiles["bus_2_connected"].values ].values
max_driving_consumpion = max( max_driving_consumpion = max(
max(input_profiles["bus_1_demand"].values), max(input_profiles["bus_1_demand"].values),
max(input_profiles["bus_1_demand"].values), max(input_profiles["bus_1_demand"].values),
) )
with open( with open(prosumer_json["components"]["bus_1_motor_inverter"]["model"]) as f:
prosumer_dict["LaTreille"]["components"]["bus_1_motor_inverter"]["model"]
) as f:
inverter_1_efficiency = json.load(f)["efficiency"] inverter_1_efficiency = json.load(f)["efficiency"]
bus_1_moter_inverter_capacity = max_driving_consumpion / inverter_1_efficiency bus_1_moter_inverter_capacity = max_driving_consumpion / inverter_1_efficiency
prosumer_dict["LaTreille"]["components"]["bus_1_motor_inverter"][ prosumer_json["components"]["bus_1_motor_inverter"][
"min_capacity" "min_capacity"
] = bus_1_moter_inverter_capacity ] = bus_1_moter_inverter_capacity
prosumer_dict["LaTreille"]["components"]["bus_1_motor_inverter"][ prosumer_json["components"]["bus_1_motor_inverter"][
"max_capacity" "max_capacity"
] = bus_1_moter_inverter_capacity ] = bus_1_moter_inverter_capacity
with open( with open(prosumer_json["components"]["bus_2_motor_inverter"]["model"]) as f:
prosumer_dict["LaTreille"]["components"]["bus_2_motor_inverter"]["model"]
) as f:
inverter_2_efficiency = json.load(f)["efficiency"] inverter_2_efficiency = json.load(f)["efficiency"]
bus_2_moter_inverter_capacity = max_driving_consumpion / inverter_2_efficiency bus_2_moter_inverter_capacity = max_driving_consumpion / inverter_2_efficiency
prosumer_dict["LaTreille"]["components"]["bus_2_motor_inverter"][ prosumer_json["components"]["bus_2_motor_inverter"][
"min_capacity" "min_capacity"
] = bus_2_moter_inverter_capacity ] = bus_2_moter_inverter_capacity
prosumer_dict["LaTreille"]["components"]["bus_2_motor_inverter"][ prosumer_json["components"]["bus_2_motor_inverter"][
"max_capacity" "max_capacity"
] = bus_2_moter_inverter_capacity ] = bus_2_moter_inverter_capacity
prosumer_main = ProsumerMain(prosumer_dict, dynamic) prosumer = Prosumer("LaTreille", prosumer_json, dynamic)
prosumer_sizing_strategy = ["annuity", "peak_power_costs"] prosumer.optimize_sizing("sized", ["annuity", "peak_power_costs"])
prosumer_main.optimize_sizing("sized", prosumer_sizing_strategy)
prosumer_main.save_results() prosumer.save_results("output_files")
...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from Model_Library.Prosumer.main import ProsumerMain
from Model_Library.dynamics import AggregatedDynamic, Profile, TrivialDynamic from Model_Library.dynamics import AggregatedDynamic, Profile, TrivialDynamic
from Model_Library.Prosumer.model import Prosumer
from Tooling.input_profile_processor.input_profile_processor import ( from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles, process_input_profiles,
) )
...@@ -101,23 +101,15 @@ aggregated_electric_demand = Profile( ...@@ -101,23 +101,15 @@ aggregated_electric_demand = Profile(
{0: electric_demand_1, 1: electric_demand_2}, aggregated_dynamic {0: electric_demand_1, 1: electric_demand_2}, aggregated_dynamic
) )
prosumer_paths = {"my_prosumer": "prosumer.json"} with open("prosumer.json") as f:
prosumer_dict = dict()
for prosumer_name, prosumer_path in prosumer_paths.items():
with open(prosumer_path) as f:
prosumer_json = json.load(f) prosumer_json = json.load(f)
prosumer_dict[prosumer_name] = prosumer_json
prosumer_dict["my_prosumer"]["components"]["pv"]["irradiance"] = aggregated_irradiance prosumer_json["components"]["pv"]["irradiance"] = aggregated_irradiance
prosumer_dict["my_prosumer"]["components"]["pv"]["temperature"] = aggregated_temperature prosumer_json["components"]["pv"]["temperature"] = aggregated_temperature
prosumer_dict["my_prosumer"]["components"]["consumption"][ prosumer_json["components"]["consumption"]["consumption"] = aggregated_electric_demand
"consumption"
] = aggregated_electric_demand
prosumer_main = ProsumerMain(prosumer_dict, aggregated_dynamic) prosumer = Prosumer("my_prosumer", prosumer_json, aggregated_dynamic)
prosumer_sizing_strategy = ["annuity"] prosumer.optimize_sizing("sized", ["annuity"])
prosumer_main.optimize_sizing("sized", prosumer_sizing_strategy)
prosumer_main.save_results() prosumer.save_results("output_files")
...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from Model_Library.Prosumer.main import ProsumerMain
from Model_Library.dynamics import TrivialDynamic from Model_Library.dynamics import TrivialDynamic
from Model_Library.Prosumer.model import Prosumer
from Tooling.input_profile_processor.input_profile_processor import ( from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles, process_input_profiles,
) )
...@@ -50,36 +50,24 @@ input_profile_dict = { ...@@ -50,36 +50,24 @@ input_profile_dict = {
input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic) input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic)
prosumer_paths = {"my_prosumer": "prosumer.json"} with open("prosumer.json") as f:
prosumer_dict = dict()
for prosumer_name, prosumer_path in prosumer_paths.items():
with open(prosumer_path) as f:
prosumer_json = json.load(f) prosumer_json = json.load(f)
prosumer_dict[prosumer_name] = prosumer_json
prosumer_dict["my_prosumer"]["components"]["pv"]["irradiance"] = input_profiles[ prosumer_json["components"]["pv"]["irradiance"] = input_profiles["irradiance"]
"irradiance" prosumer_json["components"]["pv"]["temperature"] = input_profiles["temperature"]
prosumer_json["components"]["electric_consumption"]["consumption"] = input_profiles[
"electric_demand"
] ]
prosumer_dict["my_prosumer"]["components"]["pv"]["temperature"] = input_profiles[ prosumer_json["components"]["heat_pump"]["temperature"] = input_profiles["temperature"]
"temperature" prosumer_json["components"]["heat_consumption"]["consumption"] = input_profiles[
"heat_demand"
] ]
prosumer_dict["my_prosumer"]["components"]["electric_consumption"][ prosumer_json["components"]["hot_water_consumption"]["consumption"] = input_profiles[
"consumption" "hot_water_demand"
] = input_profiles["electric_demand"]
prosumer_dict["my_prosumer"]["components"]["heat_pump"]["temperature"] = input_profiles[
"temperature"
] ]
prosumer_dict["my_prosumer"]["components"]["heat_consumption"][
"consumption"
] = input_profiles["heat_demand"]
prosumer_dict["my_prosumer"]["components"]["hot_water_consumption"][
"consumption"
] = input_profiles["hot_water_demand"]
prosumer_main = ProsumerMain(prosumer_dict, dynamic) prosumer = Prosumer("my_prosumer", prosumer_json, dynamic)
prosumer_sizing_strategy = ["annuity"] prosumer.optimize_sizing("sized", ["annuity"])
prosumer_main.optimize_sizing("sized", prosumer_sizing_strategy)
prosumer_main.save_results() prosumer.save_results("output_files")
...@@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from Model_Library.District.main import DistrictMain from Model_Library.District.model import District
from Model_Library.Prosumer.main import DistrictAssetMain, ProsumerMain
from Model_Library.dynamics import TrivialDynamic from Model_Library.dynamics import TrivialDynamic
from Model_Library.Prosumer.model import DistrictAsset, Prosumer
from Tooling.input_profile_processor.input_profile_processor import ( from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles, process_input_profiles,
) )
...@@ -49,72 +49,41 @@ prosumer_paths = { ...@@ -49,72 +49,41 @@ prosumer_paths = {
"my_prosumer_2": "prosumer_2.json", "my_prosumer_2": "prosumer_2.json",
} }
prosumer_dict = dict() prosumers = dict()
for prosumer_name, prosumer_path in prosumer_paths.items(): for prosumer_name, prosumer_path in prosumer_paths.items():
with open(prosumer_path) as f: with open(prosumer_path) as f:
prosumer_json = json.load(f) prosumer_json = json.load(f)
prosumer_dict[prosumer_name] = prosumer_json
prosumer_dict["my_prosumer_1"]["components"]["pv"]["irradiance"] = input_profiles[ prosumer_json["components"]["pv"]["irradiance"] = input_profiles["irradiance"]
"irradiance" prosumer_json["components"]["pv"]["temperature"] = input_profiles["temperature"]
prosumer_json["components"]["consumption"]["consumption"] = input_profiles[
"electric_demand"
] ]
prosumer_dict["my_prosumer_1"]["components"]["pv"]["temperature"] = input_profiles[
"temperature"
]
prosumer_dict["my_prosumer_1"]["components"]["consumption"][
"consumption"
] = input_profiles["electric_demand"]
prosumer_dict["my_prosumer_2"]["components"]["pv"]["irradiance"] = input_profiles[
"irradiance"
]
prosumer_dict["my_prosumer_2"]["components"]["pv"]["temperature"] = input_profiles[
"temperature"
]
prosumer_dict["my_prosumer_2"]["components"]["consumption"][
"consumption"
] = input_profiles["electric_demand"]
prosumer_main = ProsumerMain(prosumer_dict, dynamic)
prosumer_sizing_strategy = ["annuity"]
prosumer_main.optimize_sizing("sized", prosumer_sizing_strategy)
prosumer_main.save_results() prosumers[prosumer_name] = Prosumer(prosumer_name, prosumer_json, dynamic)
prosumers = prosumer_main.prosumers for prosumer_name, prosumer in prosumers.items():
prosumer.optimize_sizing("sized", ["annuity"])
district_asset_paths = {"my_asset": "asset.json"} prosumer.save_results("output_files")
district_asset_dict = dict() with open("asset.json") as f:
for district_asset_name, district_asset_path in district_asset_paths.items():
with open(district_asset_path) as f:
district_asset_json = json.load(f) district_asset_json = json.load(f)
district_asset_dict[district_asset_name] = district_asset_json
district_assets = DistrictAssetMain(district_asset_dict, dynamic).district_assets district_asset = DistrictAsset("my_asset", district_asset_json, dynamic)
district_assets = main_prosumer.DistrictAssetMain( with open("district.json") as f:
district_asset_dict, dynamic
).district_assets
district_paths = {"my_district": "district.json"}
district_dict = dict()
for district_name, district_path in district_paths.items():
with open(district_path) as f:
district_json = json.load(f) district_json = json.load(f)
district_dict[district_name] = district_json
district_dict["my_district"]["components"]["grid"]["price"] = input_profiles[ district_json["components"]["grid"]["price"] = input_profiles["electricity_price"]
"electricity_price" district_json["components"]["grid"]["injection_price"] = input_profiles[
]
district_dict["my_district"]["components"]["grid"]["injection_price"] = input_profiles[
"electricity_price" "electricity_price"
] ]
district_main = DistrictMain(district_dict, prosumers, district_assets, dynamic) district = District(
"my_district", district_json, prosumers, {"my_asset": district_asset}, dynamic
)
district_sizing_strategy = ["annuity"] district.optimize_sizing("sized", ["annuity"])
district_main.optimize_sizing("sized", district_sizing_strategy)
district_main.save_results() district.save_results("output_files")
...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from Model_Library.Prosumer.main import ProsumerMain
from Model_Library.dynamics import TrivialDynamic from Model_Library.dynamics import TrivialDynamic
from Model_Library.Prosumer.model import Prosumer
from Tooling.input_profile_processor.input_profile_processor import ( from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles, process_input_profiles,
) )
...@@ -42,27 +42,17 @@ input_profile_dict = { ...@@ -42,27 +42,17 @@ input_profile_dict = {
input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic) input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic)
prosumer_paths = {"my_prosumer": "prosumer.json"} with open("prosumer.json") as f:
prosumer_dict = dict()
for prosumer_name, prosumer_path in prosumer_paths.items():
with open(prosumer_path) as f:
prosumer_json = json.load(f) prosumer_json = json.load(f)
prosumer_dict[prosumer_name] = prosumer_json
prosumer_dict["my_prosumer"]["components"]["pv"]["irradiance"] = input_profiles[ prosumer_json["components"]["pv"]["irradiance"] = input_profiles["irradiance"]
"irradiance" prosumer_json["components"]["pv"]["temperature"] = input_profiles["temperature"]
] prosumer_json["components"]["consumption"]["consumption"] = input_profiles[
prosumer_dict["my_prosumer"]["components"]["pv"]["temperature"] = input_profiles[ "electric_demand"
"temperature"
] ]
prosumer_dict["my_prosumer"]["components"]["consumption"][
"consumption"
] = input_profiles["electric_demand"]
prosumer_main = ProsumerMain(prosumer_dict, dynamic) prosumer = Prosumer("my_prosumer", prosumer_json, dynamic)
prosumer_sizing_strategy = ["annuity"] prosumer.optimize_sizing("sized", ["annuity"])
prosumer_main.optimize_sizing("sized", prosumer_sizing_strategy)
prosumer_main.save_results() prosumer.save_results("output_files")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment