energym.simulators.eplus_old.EnergyPlus

class energym.simulators.eplus_old.EnergyPlus(eplus_path, weather_path, bcvtb_path, variable_path, idf_path, env_name, act_repeat=1, max_ep_data_store_num=10)
__init__(eplus_path, weather_path, bcvtb_path, variable_path, idf_path, env_name, act_repeat=1, max_ep_data_store_num=10)

EnergyPlus simulation class.

Parameters
  • eplus_path (str) – EnergyPlus installation path.

  • weather_path (str) – EnergyPlus weather file (.epw) path.

  • bcvtb_path (str) – BCVTB installation path.

  • variable_path (str) – Path to variables file.

  • idf_path (str) – EnergyPlus input description file (.idf) path.

  • env_name (str) – The environment name.

  • act_repeat (int, optional) – The number of times to repeat the control action. Defaults to 1.

  • max_ep_data_store_num (int, optional) – The number of simulation results to keep. Defaults to 10.

Methods

__init__(eplus_path, weather_path, ...[, ...])

EnergyPlus simulation class.

end_env()

Method called after finishing using the environment in order to close it.

end_episode()

get_is_eplus_running()

reset([new_weather])

Resets the environment.

step(action)

Executes a given action.

Attributes

env_name

Returns the environment name.

start_day

Returns the EnergyPlus simulaton start day of the month.

start_mon

Returns the EnergyPlus simulation start month.

start_weekday

Returns the EnergyPlus simulaton start weekday.

start_year

Returns the EnergyPlus simulation year.

end_env()

Method called after finishing using the environment in order to close it.

end_episode()
property env_name

Returns the environment name.

Returns

Environment name

Return type

str

get_is_eplus_running()
reset(new_weather: Optional[str] = None)

Resets the environment.

Parameters

new_weather (str, optional) – New weather file, if passed. Defaults to None.

Returns

The first element is the current_simulation_time in seconds; the second element consist on EnergyPlus results in a 1-D list correponding to the variables in variables.cfg. The last element is a boolean indicating whether the episode terminates.

Return type

(float, [float], boolean)

This method does the following: 1. Makes a new EnergyPlus working directory. 2. Copies .idf and variables.cfg file to the working directory. 3. Creates the socket.cfg file in the working directory. 4. Creates the EnergyPlus subprocess. 5. Establishes the socket connection with EnergyPlus. 6. Reads the first sensor data from the EnergyPlus. 7. Uses a new weather file if passed.

property start_day

Returns the EnergyPlus simulaton start day of the month.

Returns

Simulation start day of the month.

Return type

int

property start_mon

Returns the EnergyPlus simulation start month.

Returns

Simulation start month.

Return type

int

property start_weekday

Returns the EnergyPlus simulaton start weekday. From 0 (Monday) to 6 (Sunday).

Returns

Simulation start weekday.

Return type

int

property start_year

Returns the EnergyPlus simulation year.

Returns

Simulation year.

Return type

int

step(action)

Executes a given action.

Parameters

action (float or list) – Control actions that will be passed to EnergyPlus.

Returns

The first element is the current_simulation_time in seconds; the second element consist on EnergyPlus results in a 1-D list correponding to the variables in variables.cfg. The last element is a boolean indicating whether the episode terminates.

Return type

(float, [float], boolean)

This method does the following: 1. Sends a list of floats to EnergyPlus. 2. Recieves EnergyPlus results for the next step (state).