bsl546 / energym

Energym is an open source building simulation library designed to test climate control and energy management strategies on buildings in a systematic and reproducible way.
Other
63 stars 11 forks source link

Difference between simulation days and number of steps #7

Closed kad99kev closed 1 year ago

kad99kev commented 1 year ago

Hello,

Thank you for your work!

I just had a couple of questions regarding the simulation days and number of steps. What is the difference, and what should be considered when selecting them?

For example:

import energym

weather = "GRC_A_Athens"
env = energym.make("OfficesThermostat-v0", weather=weather, simulation_days=300)
steps = 96*10
for _ in range(steps):
    # etc...

It is mentioned, here 96 steps per day for 10 days. If it means 96 steps for 10 days, then what is the purpose of the simulation steps, and why are they not the same?

Thank you so much in advance!

psh987 commented 1 year ago

Hello,

The simulation days specify the maximum number of days (and therefore steps) that can be simulated with the initialized environment. In the above example, assuming that you want to simulate 10 days, you need to have >= 10 simulation days, otherwise the step method will throw an error when the maximum number of days is reached.

The choice of steps=96*10 and simulation_days=300 was just used as an example, in practice you should just make sure that you choose simulation_days to be at least the number of days you want to actually simulate.

Hope this helps!

kad99kev commented 1 year ago

Hi

Thank you so much for your reply. It is of great help!

One last question: How would I know how many steps I would need to take before a day is over? So that I ensure that I don't exceed the number of simulation days?

psh987 commented 1 year ago

That's a good question, it's not directly clear from the documentation, but can be found in the notebook examples of the building documentation. The simulation timesteps and resulting number of steps per day are as follows:

3 minute timestep -> 480 steps per day: ApartmentsThermal-v0, ApartmentsGrid-v0, Apartments2Thermal-v0, Apartments2Grid-v0 5 minute timestep -> 288 steps per day: SimpleHouseRad-v0, SimpleHouseRSla-v0, SwissHouseRSlaW2W-v0, SwissHouseRSlaA2W-v0, SwissHouseRSlaTank-v0, SwissHouseRSlaTankDhw-v0 10 minute timestep -> 144 steps per day: SeminarcenterThermostat-v0, SeminarcenterFull-v0 15 minute timestep -> 96 steps per day: OfficesThermostat-v0, MixedUseFanFCU-v0

kad99kev commented 1 year ago

Hi @psh987,

Thank you so much for your answer, this certainly helps a lot!