Skip to content

Commit

Permalink
Added ddy_path to simulator and used in readapt IDF to weather #111 #112
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCN7 committed Jan 13, 2022
1 parent 821e7ff commit 47d7854
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sinergym/simulators/eplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def __init__(
self._weather_path = weather_path
self._variable_path = variable_path
self._idf_path = idf_path
# Obtain ddy path from weather_path (only changing .epw extension by
# .ddy)
self._ddy_path = self._weather_path.split('.epw')[0] + '.ddy'
# Episode existed
self._episode_existed = False
# Epm object to read IDF information and WeatherData object to read EPW
Expand All @@ -106,9 +109,15 @@ def __init__(
idd_or_version=idd,
check_length=False)
self._weather_data = WeatherData.from_epw(self._weather_path)
ddy = Epm.from_idf(
self._ddy_path,
idd_or_version=idd,
check_length=False)

# Updating IDF file (Location and DesignDays) with EPW file
self._epm = adapt_idf_to_epw(self._epm, self._weather_data)
self.logger_main.info(
'Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...')
self._epm = adapt_idf_to_epw(self._epm, ddy)
self._epm.save(self._idf_path)

# Set extra configuration for simulation if exists
Expand Down

0 comments on commit 47d7854

Please sign in to comment.