-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a version of parsing data in yaml
- Loading branch information
1 parent
3a1ddd4
commit 928b36a
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
scenario: | ||
name: "ExampleScenario" # in mosaik so called world | ||
start_time: '2012-01-02 00:00:00' # ISO 8601 start time of the simulation | ||
end_time: '2012-01-02 00:00:10' # duration in seconds | ||
models: # list of models for the energy network | ||
- name: Battery1 # name for the model (must be unique) | ||
type: Battery # name of the model registered in the Illuminator | ||
inputs: | ||
input1: 0 # input-name: initial value, default value will be used if not defined | ||
outputs: | ||
output1: 0 | ||
output2: null | ||
parameters: | ||
charge_power_max: 100 | ||
discharge_power_max: 200 | ||
soc_min: 0.1 | ||
soc_max: 0.9 | ||
capacity: 1000 | ||
states: | ||
initial_soc: 0.5 | ||
triggers: # list of triggers for the of another model??. It must be an input, output or state of the model | ||
- capacity | ||
- soc_min | ||
scenario_data: 'path/to/file' #path to the scenario data file for the model. This should be optional | ||
method: | ||
type: connect # can be python for local or connect for remote | ||
location: null | ||
connect_ip: 192.168.0.1 | ||
connect_port: 5123 | ||
- name: Battery2 | ||
type: Battery # models can reuse the same type | ||
inputs: | ||
input1: 0 # input-name: initial value, default value will be used if not defined | ||
outputs: | ||
output1: 0 | ||
output2: null | ||
parameters: | ||
charge_power_max: 100 | ||
states: | ||
soc: 0.5 # initial value for the state, optional | ||
method: | ||
type: connect # can be python for local or connect for remote | ||
location: null | ||
connect_ip: 192.168.0.2 | ||
connect_port: 5123 | ||
- name: PV1 | ||
type: PV | ||
inputs: | ||
input1: 0 # input-name: initial value, default value will be used if not defined | ||
input2: 0 | ||
outputs: | ||
output1: 0 | ||
parameters: | ||
power_max: 100 | ||
states: | ||
initial_soc: 0.5 | ||
method: | ||
type: connect # can be python for local or connect for remote | ||
location: null | ||
connect_ip: 192.168.0.3 | ||
connect_port: 5123 | ||
connections: | ||
- from: Battery1.output2 # start model, pattern: model_name.output_name/input_name | ||
to: PV1.input1 # end model | ||
- from: Battery2.output | ||
to: PV1.input2 | ||
monitor: # a list of models, its inputs, output and states to be monitored and logged | ||
- Battery1.input1 # pattern model_name.state_name | ||
- Battery2.output1 # no duplicates allowed | ||
- PV1.soc # pattern model_name.state_name | ||
- PV1.output1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import yaml | ||
|
||
# Open and load the YAML file | ||
with open('modelling-example.yaml', 'r') as _file: | ||
data = yaml.safe_load(_file) | ||
|
||
run_path='./Desktop/illuminatorclient/configuration/runshfile/' | ||
run_model='/home/illuminator/Desktop/Final_illuminator' | ||
|
||
for model in data['models']: | ||
model_type = model.get('type') | ||
|
||
method = model.get('method', {}) | ||
connect_ip = method.get('connect_ip') | ||
connect_port = method.get('connect_port') | ||
|
||
if connect_ip and connect_port: | ||
print(f"lxterminal -e ssh illuminator@{connect_ip} '{run_path}run{model_type}.sh {connect_ip} {connect_port} {run_model}'&") | ||
|