Open ajaugust opened 2 years ago
You need to call advance at least once before calling reset. so the code should be
import requests
import json
start_day = 33
run_period = 86400
url_eplus = f'http://127.0.0.1:5501'
url_modelica = f'http://127.0.0.1:5001'
# Set the step
requests.put(f'{url_eplus}/step', data={'step': 60})
# Set the simulation start and end times in units of seconds
start_sec = start_day*86400
end_sec_run = start_sec + run_period # end time of the run
end_day = (end_sec_run // 86400) + 1 # need the end time to be an integer day for eplus to be happy
end_sec = end_day*86400
y = requests.post('{0}/advance'.format(url_eplus), data=json.dumps({})).json()
requests.put(f'{url_eplus}/reset', data={'start_time':start_sec, 'end_time':end_sec})
Here is the docker-compose file:
Commands to launch emulator:
Python code to run simulation:
After calling
reset
the eplus container shuts itself down despite returning a 200 response.