Select Git revision
StatusBar.vue
runme.py 2.83 KiB
"""
MIT License
Copyright (c) 2023 RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
from Model_Library.dynamics import TrivialDynamic
from Model_Library.Prosumer.model import Prosumer
from Tooling.input_profile_processor.input_profile_processor import (
process_input_profiles,
)
import json
import pandas as pd
t_start = pd.Timestamp("2019-05-10 00:00:00")
dynamic = TrivialDynamic([60 for i in range(24 * 60 - 1)])
input_profile_dict = {
"bus_1_demand": {"type": "elec_demand", "file": "bus_1_demand.csv"},
"bus_2_demand": {"type": "elec_demand", "file": "bus_2_demand.csv"},
"bus_1_recuperation": {"type": "elec_demand", "file": "bus_1_recuperation.csv"},
"bus_2_recuperation": {"type": "elec_demand", "file": "bus_2_recuperation.csv"},
"bus_1_connected": {"type": "elec_demand", "file": "bus_1_connected.csv"},
"bus_2_connected": {"type": "elec_demand", "file": "bus_2_connected.csv"},
}
input_profiles = process_input_profiles(input_profile_dict, t_start, dynamic)
with open("depot.json") as f:
prosumer_json = json.load(f)
prosumer_json["components"]["bus_1_consumption"]["consumption"] = input_profiles[
"bus_1_demand"
]
prosumer_json["components"]["bus_2_consumption"]["consumption"] = input_profiles[
"bus_2_demand"
]
prosumer_json["components"]["bus_1_generation"]["generation"] = input_profiles[
"bus_1_recuperation"
]
prosumer_json["components"]["bus_2_generation"]["generation"] = input_profiles[
"bus_2_recuperation"
]
prosumer_json["additional_model_logic"]["charger_1_enable"]["enable"] = input_profiles[
"bus_1_connected"
].values
prosumer_json["additional_model_logic"]["charger_2_enable"]["enable"] = input_profiles[
"bus_2_connected"
].values
prosumer = Prosumer("LaTrielle", prosumer_json, dynamic)
prosumer.optimize_sizing("sized", ["annuity", "peak_power_costs"])
prosumer.save_results("output_files")