sinergym.envs.eplus_env.EplusEnv

class sinergym.envs.eplus_env.EplusEnv(*args: Any, **kwargs: Any)
__init__(idf_file: str, weather_file: str, observation_space: gym.spaces.Box = gym.spaces.Box, observation_variables: ~typing.List[str] = [], action_space: gym.spaces.Box | gym.spaces.Discrete = gym.spaces.Box, action_variables: ~typing.List[str] = [], action_mapping: ~typing.Dict[int, ~typing.Tuple[float, ...]] = {}, weather_variability: ~typing.Tuple[float] | None = None, reward: ~typing.Any = <class 'sinergym.utils.rewards.LinearReward'>, reward_kwargs: ~typing.Dict[str, ~typing.Any] | None = {}, act_repeat: int = 1, max_ep_data_store_num: int = 10, action_definition: ~typing.Dict[str, ~typing.Any] | None = None, env_name: str = 'eplus-env-v1', config_params: ~typing.Dict[str, ~typing.Any] | None = None)

Environment with EnergyPlus simulator.

Parameters:
  • idf_file (str) – Name of the IDF file with the building definition.

  • weather_file (str) – Name of the EPW file for weather conditions.

  • observation_space (gym.spaces.Box, optional) – Gym Observation Space definition. Defaults to an empty observation_space (no control).

  • observation_variables (List[str], optional) – List with variables names in IDF. Defaults to an empty observation variables (no control).

  • action_space (Union[gym.spaces.Box, gym.spaces.Discrete], optional) – Gym Action Space definition. Defaults to an empty action_space (no control).

  • action_variables (List[str],optional) – Action variables to be controlled in IDF, if that actions names have not been configured manually in IDF, you should configure or use extra_config. Default to empty List.

  • action_mapping (Dict[int, Tuple[float, ...]], optional) – Action mapping list for discrete actions spaces only. Defaults to empty list.

  • weather_variability (Optional[Tuple[float]], optional) – Tuple with sigma, mu and tao of the Ornstein-Uhlenbeck process to be applied to weather data. Defaults to None.

  • reward (Any, optional) – Reward function instance used for agent feedback. Defaults to LinearReward.

  • reward_kwargs (Optional[Dict[str, Any]], optional) – Parameters to be passed to the reward function. Defaults to empty dict.

  • act_repeat (int, optional) – Number of timesteps that an action is repeated in the simulator, regardless of the actions it receives during that repetition interval.

  • max_ep_data_store_num (int, optional) – Number of last sub-folders (one for each episode) generated during execution on the simulation.

  • action_definition (Optional[Dict[str, Any]) – Dict with building components to being controlled by Sinergym automatically if it is supported. Default value to None.

  • env_name (str, optional) – Env name used for working directory generation. Defaults to eplus-env-v1.

  • config_params (Optional[Dict[str, Any]], optional) – Dictionary with all extra configuration for simulator. Defaults to None.

Methods

__init__(idf_file, weather_file[, ...])

Environment with EnergyPlus simulator.

close()

End simulation.

get_schedulers([path])

Extract all schedulers available in the building model to be controlled.

get_zones()

Get the zone names available in the building model of that environment.

render([mode])

Environment rendering.

reset()

Reset the environment.

step(action)

Sends action to the environment

Attributes

metadata

close() None

End simulation.

get_schedulers(path: str | None = None) Dict[str, Any]

Extract all schedulers available in the building model to be controlled.

Parameters:

path (str, optional) – If path is specified, then this method export a xlsx file version in addition to return the dictionary.

Returns:

Python Dictionary: For each scheduler found, it shows type value and where this scheduler is present (Object name, Object field and Object type).

Return type:

Dict[str, Any]

get_zones() List[str]

Get the zone names available in the building model of that environment.

Returns:

List of the zone names.

Return type:

List[str]

metadata = {'render.modes': ['human']}
render(mode: str = 'human') None

Environment rendering.

Parameters:

mode (str, optional) – Mode for rendering. Defaults to ‘human’.

reset() ndarray

Reset the environment.

Returns:

Current observation.

Return type:

np.ndarray

step(action: int | float | integer | ndarray | List[Any] | Tuple[Any]) Tuple[ndarray, float, bool, Dict[str, Any]]

Sends action to the environment

Parameters:

action (Union[int, float, np.integer, np.ndarray, List[Any], Tuple[Any]]) – Action selected by the agent.

Returns:

Observation for next timestep, reward obtained, Whether the episode has ended or not and a dictionary with extra information

Return type:

Tuple[np.ndarray, float, bool, Dict[str, Any]]