ugr-sail / sinergym

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

[Bug]: Unnecessary rows recorded in monitor.csv #415

Closed Miguel-jp closed 5 months ago

Miguel-jp commented 5 months ago

Bug 🐛

When using the “Eplus-officegrid-mixed-continuous-v1” environment, the "monitor.csv" output by the Logger Wrapper starts recording results from July 21, regardless of the start date setting.

To Reproduce

import gymnasium as gym
import numpy as np
import sinergym
from sinergym.utils.wrappers import *

env=gym.make('Eplus-officegrid-mixed-continuous-v1')
env=LoggerWrapper(env)

env.reset()
truncated = terminated = False
current_month = 0
while not (terminated or truncated):
    a = env.action_space.sample()
    _,_,terminated,truncated,_=env.step(a)
env.close()

Running this will record the data starting on July 21 in "monitor.csv".

0

After several iterations of the July 21 record, the record finally begins on January 1, the original start date.

1

Expected behavior

Records from January 1 should be recorded in "monitor.csv". Note that when the “Eplus-5zone-hot-discrete-v1” environment was used, the data is recorded from January 1 without any problems.

2

System Info

Checklist

AlejandroCN7 commented 5 months ago

Hi @Miguel-jp!

This is due to the building SimulationControl configuration:

"SimulationControl": {
        "SimulationControl 1": {
            "do_hvac_sizing_simulation_for_sizing_periods": "No",
            "do_plant_sizing_calculation": "Yes",
            "do_system_sizing_calculation": "Yes",
            "do_zone_sizing_calculation": "Yes",
            "maximum_number_of_hvac_sizing_simulation_passes": 1,
            "run_simulation_for_sizing_periods": "Yes",
            "run_simulation_for_weather_file_run_periods": "Yes"
        }
}

Sizing periods are run at the beggining of the simulation. If you don't want these timesteps, you should set the run_simulation_for_sizing_periods and do_plant_sizing_calculation to No, in the building file epJSON like this:

"SimulationControl": {
        "SimulationControl 1": {
            "do_hvac_sizing_simulation_for_sizing_periods": "No",
            "do_plant_sizing_calculation": "No",
            "do_system_sizing_calculation": "Yes",
            "do_zone_sizing_calculation": "Yes",
            "maximum_number_of_hvac_sizing_simulation_passes": 1,
            "run_simulation_for_sizing_periods": "No",
            "run_simulation_for_weather_file_run_periods": "Yes"
        }
    },

In other buildings this is set as default, it will be updated in future versions for this building.

Thank you so much for the information.