Skip to content

Commit

Permalink
adding files for AWS federate
Browse files Browse the repository at this point in the history
  • Loading branch information
tareknrel committed Sep 12, 2022
1 parent 62c3121 commit 9e35274
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions AWSFeeder/FeederSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class FeederConfig(BaseModel):
smartds_scenario: str
smartds_year: str
start_date: str
end_date: str
increment_value: int # increment in seconds
number_of_timesteps: int


class FeederSimulator(object):
Expand All @@ -71,7 +71,8 @@ def __init__(self, config):
self._smartds_scenario = config.smartds_scenario
self._smartds_year = config.smartds_year
self._start_date = config.start_date
self._end_date = config.end_date
self._number_of_timesteps = config.number_of_timesteps
self._increment_value = config.increment_value

self._feeder_file = None
self._circuit=None
Expand Down
12 changes: 7 additions & 5 deletions AWSFeeder/component_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
"directory": "AWSFeeder",
"execute_function": "python sender_cosim.py",
"static_inputs": [
{"type": "", "port_id": "feeder_file"},
{"type": "", "port_id": "load_file"},
{"type": "", "port_id": "pv_file"},
{"type": "", "port_id": "name"},
{"type": "", "port_id": "smartds_region"},
{"type": "", "port_id": "smartds_feeder"},
{"type": "", "port_id": "smartds_scenario"},
{"type": "", "port_id": "smartds_year"},
{"type": "", "port_id": "start_date"},
{"type": "", "port_id": "run_freq_sec"},
{"type": "", "port_id": "start_time_index"}
{"type": "", "port_id": "increment_value"},
{"type": "", "port_id": "number_of_timesteps"}
],
"dynamic_inputs": [],
"dynamic_outputs": [
Expand Down
2 changes: 1 addition & 1 deletion AWSFeeder/sender_cosim.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def get_phase(name):
current_index = 0
current_hour = 0
current_second = 0
for request_time in range(0, 100):
for request_time in range(0, config.number_of_timesteps):
while granted_time < request_time:
granted_time = h.helicsFederateRequestTime(vfed, request_time)
logger.info('start time: '+str(datetime.now()))
Expand Down
2 changes: 2 additions & 0 deletions LocalFeeder/FeederSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class FeederConfig(BaseModel):
name: str
feeder_file: str
start_date: str
number_of_timesteps: float
run_freq_sec: float = 15*60
start_time_index: int = 0

Expand All @@ -77,6 +78,7 @@ def __init__(self, config):
self._run_freq_sec = config.run_freq_sec
self._simulation_step = config.start_time_index
self._simulation_time_step = self._start_time
self._number_of_timesteps = config.number_of_timesteps
self._vmult = 0.001

self._nodes_index = []
Expand Down
4 changes: 2 additions & 2 deletions test_system.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"smartds_scenario": "solar_medium_batteries_none_timeseries",
"smartds_year": "2017",
"start_date": "2017-05-01 00:00:00",
"end_date": "2017-05-02 00:00:00",
"increment_value": 900
"increment_value": 900,
"number_of_timesteps": 36
}
},
{
Expand Down

0 comments on commit 9e35274

Please sign in to comment.