MEOS/main.py

22 lines
629 B
Python

import yaml
from Utilities.Time import get_current_time
from LoadProfile import get_load_profile
# read config file
c = yaml.safe_load(open("YAMLs/config.yml"))
## simulation time setup
# get current time
c["sim_start_time"] = get_current_time()
# get time step in minutes, then convert to seconds
dt = c["sim_time"]["time_step_minutes"] * 60
# compute end time based on duration in days
duration = c["sim_time"]["duration_days"] * 24 * 60 * 60
c["sim_end_time"] = c["sim_start_time"] + duration
# load site info
c["site_info"] = yaml.safe_load(open(c["paths"]["site_info"]))
# generate load profiles
get_load_profile(c, dt)