sinergym.utils.config.Config
- class sinergym.utils.config.Config(idf_path: str, weather_path: str, variables: Dict[str, List[str]], env_name: str, max_ep_store: int, action_definition: Dict[str, Any] | None, extra_config: Dict[str, Any])
Config object to manage extra configuration in Sinergym experiments.
- Parameters:
_idf_path – IDF path origin for apply extra configuration.
_weather_path – EPW path origin for apply weather to simulation.
_ddy_path – DDY path origin for get DesignDays and weather Location
experiment_path – Path for Sinergym experiment output
episode_path – Path for Sinergym specific episode (before first simulator reset this param is None)
max_ep_store – Number of episodes directories will be stored in experiment_path
config – Dict config with extra configuration which is required to modify IDF model (may be None)
_idd – IDD opyplus object to set up Epm
building – opyplus Epm object with IDF model
ddy_model – opyplus Epm object with DDY model
weather_data – opyplus WeatherData object with EPW data
action_definition – Dict with action definition to automatic building model preparation.
- __init__(idf_path: str, weather_path: str, variables: Dict[str, List[str]], env_name: str, max_ep_store: int, action_definition: Dict[str, Any] | None, extra_config: Dict[str, Any])
Methods
__init__
(idf_path, weather_path, variables, ...)Interpret action definition and apply changes in IDF in order to control schedulers specified.
adapt_idf_to_epw
([summerday, winterday])Given a summer day name and winter day name from DDY file, this method modify IDF Location and DesingDay's in order to adapt IDF to EPW.
This method adds to XML variable tree all observation and action variables information.
Set extra configuration in building model
apply_weather_variability
([columns, variation])Modify weather data using Ornstein-Uhlenbeck process.
Extract all schedulers available in the building model to be controlled.
Take current building model and save as IDF in current env_working_dir episode folder.
This method saves current XML variables tree model into a variables.cfg file.
Set episode working dir path like config attribute for current simulation execution.
set_experiment_working_dir
(env_name)Set experiment working dir path like config attribute for current simulation.
Set an empty external interface with Ptolemy server if is not in the current building
Attributes
Returns the EnergyPlus simulation year.
- adapt_idf_to_action_definition() None
Interpret action definition and apply changes in IDF in order to control schedulers specified.
- adapt_idf_to_epw(summerday: str = 'Ann Clg .4% Condns DB=>MWB', winterday: str = 'Ann Htg 99.6% Condns DB') None
Given a summer day name and winter day name from DDY file, this method modify IDF Location and DesingDay’s in order to adapt IDF to EPW.
- Parameters:
summerday (str) – Design day for summer day specifically (DDY has several of them).
winterday (str) – Design day for winter day specifically (DDY has several of them).
- adapt_variables_to_cfg_and_idf() None
This method adds to XML variable tree all observation and action variables information. In addition, it modifies IDF Output:Variable in order to adapt to new observation variables set.
- apply_extra_conf() None
Set extra configuration in building model
- apply_weather_variability(columns: List[str] = ['drybulb'], variation: Tuple[float, float, float] | None = None) str
Modify weather data using Ornstein-Uhlenbeck process.
- Parameters:
columns (List[str], optional) – List of columns to be affected. Defaults to [‘drybulb’].
variation (Optional[Tuple[float, float, float]], optional) – Tuple with the sigma, mean and tau for OU process. Defaults to None.
- Returns:
New EPW file path generated in simulator working path in that episode or current EPW path if variation is not defined.
- Return type:
str
- get_schedulers() Dict[str, Any]
Extract all schedulers available in the building model to be controlled.
- 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]
- save_building_model() str
Take current building model and save as IDF in current env_working_dir episode folder.
- Returns:
Path of IDF file stored (episode folder).
- Return type:
str
- save_variables_cfg() str
This method saves current XML variables tree model into a variables.cfg file.
- Raises:
RuntimeError – If this method is used without an episode_path generated (see reset method in simulator), this exception is raised.
- Returns:
Path to the new saved variables.cfg used by BCVTB for Energyplus communication.
- Return type:
str
- set_episode_working_dir() str
Set episode working dir path like config attribute for current simulation execution.
- Raises:
Exception – If experiment path (parent folder) has not be created previously.
- Returns:
Episode path for directory created.
- Return type:
str
- set_experiment_working_dir(env_name: str) str
Set experiment working dir path like config attribute for current simulation.
- Parameters:
env_name (str) – simulation env name to define a name in directory
- Returns:
Experiment path for directory created.
- Return type:
str
- set_external_interface() None
Set an empty external interface with Ptolemy server if is not in the current building
- property start_year: int
Returns the EnergyPlus simulation year.
- Returns:
Simulation year.
- Return type:
int