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

Removed old example

parent ecbb25d7
No related branches found
No related tags found
No related merge requests found
{
"components": {
"source": {
"type": "ElectricalGeneration"
},
"sink": {
"type": "ElectricalConsumption"
},
"buffer": {
"type": "ElectricalGrid",
"additional_model_logic": {
"input_penalty": {
"type": "additional_operational_objective",
"value": [1.0, "input_1"]
},
"output_penalty": {
"type": "additional_operational_objective",
"value": [1.0, "output_1"]
}
}
}
},
"connections": [
{
"type": "OneToOne",
"from": "source.output_1",
"to": "buffer.input_1"
},
{
"type": "OneToOne",
"from": "buffer.output_1",
"to": "sink.input_1"
},
{
"type": "Sum",
"members": [
"source.output_1",
"sink.input_1"
],
"loss_factor": 0.5,
"capacity": 1.0
},
{
"type": "OneToOne",
"from": "source.output_1",
"to": "sink.input_1",
"loss_factor": 0.5,
"capacity": 1.0
}
]
}
\ No newline at end of file
"""
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.
"""
# import gurobipy
# model = gurobipy.read('out.mps')
# model.computeIIS()
# model.write('out.ilp')
from Model_Library.dynamics import TrivialArchitecture, TrivialDynamic, Profile
from Model_Library.topology import Prosumer
import json
import numpy as np
dynamic = TrivialDynamic(np.ones(1, dtype=int))
with open("prosumer.json") as f:
prosumer_json = json.load(f)
prosumer_json["components"]["source"]["generation"] = Profile(np.array([10.0]), dynamic)
prosumer_json["components"]["sink"]["consumption"] = Profile(np.array([10.0]), dynamic)
prosumer = Prosumer("my_prosumer", prosumer_json)
prosumer.optimize("key", TrivialArchitecture(dynamic), [])
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