ugr-sail / sinergym

Gym environment for building simulation and control using reinforcement learning
https://ugr-sail.github.io/sinergym/
MIT License
127 stars 34 forks source link

(v3.1.4) - Sinergym extra config params fix #380

Closed AlejandroCN7 closed 8 months ago

AlejandroCN7 commented 8 months ago

Description

This PR fix a bug detected in config params for environments.

Motivation and Context

Why is this change required? What problem does it solve? Please, reference issue or issues opened previously.

Bug:

When we launch an experiment in which we set a config_params value different from the default (in timesteps_per_hour). Sinergym applies the changes correctly, but they are not well reflected in the environment attributes (timestep_per_episode).

If we set the number of training steps using this attribute and multiplying it by the number of training episodes we want, it turns out that the number of timesteps trained will be in reference to the number of native timesteps per hour and not the new one set for the experiment.

Solution:

Sinergym applied the configuration and adaptation of the building model after the first reset. It was designed that way in order to be able to change the configuration episode by episode.

As it does not seem a useful feature and usually attributes are accessed before they are updated at reset. All the adaptation to the model is done in class constructor and only the essential things such as the EPW adaptation (useful in case of having specified several) are left in the environment reset.

Types of changes

Checklist:

Changelog: