Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

StateManager's delete_state function error

asked 2021-12-09 08:15:15 -0600

hermmanhender gravatar image

updated 2021-12-09 11:09:24 -0600

Hi! I worked with EnergyPlus API Python V9-5-0 and all was good. Now, I tried to run the same program with EP API Python V9-6-0 and the function api.state_manager.delete_state(state) present me an error in the lecture of a file. The follow is the messege in the Terminal:

EnergyPlus Starting
EnergyPlus, Version 9.6.0-f420c06a69, YMD=2021.12.09 15:06
Adjusting Air System Sizing
Adjusting Standard 62.1 Ventilation Sizing
Initializing Simulation
Reporting Surfaces
Beginning Primary Simulation
Initializing New Environment Parameters
Warming up {1}
Updating Beam-to-Diffuse Exterior Solar Reflection Factors
Updating Beam-to-Beam Exterior Solar Reflection Factors
Warming up {2}
Warming up {3}
Warming up {4}
Starting Simulation at 07/14/2013 for DDMM
Writing tabular output file results using comma format.
Writing tabular output file results using HTML format.
EnergyPlus Run Time=00hr 00min  1.30sec
EnergyPlus Completed Successfully.
Traceback (most recent call last):
  File "c:\Users\grhen\Documents\GitHub\RLforEP\", line 104, in <module>
    EMS_prop_v2_9_20211204.init_EPRandomConvergence(conf_experimento, var_case_n)
  File "c:\Users\grhen\Documents\GitHub\RLforEP\", line 294, in init_EPRandomConvergence
    runEP(conf_experimento, var_case_n, var_step_n, epJSON_new)
  File "c:\Users\grhen\Documents\GitHub\RLforEP\", line 195, in runEP     
  File "C:\EnergyPlusV9-6-0\pyenergyplus\", line 105, in delete_state
OSError: exception: access violation reading 0x0000000000000010

The complete code is very large, but the problem can be see here:

state = api.state_manager.new_state()
api.runtime.callback_begin_zone_timestep_after_init_heat_balance(state, callbackFunction)
api.runtime.run_energyplus(state, ['-d', var_case_n['Folder_Output'], '-w', conf_experimento['Weather_file'], epJSON_file])

Wenn I don't use the function api.state_manager.delete_state(state) all is good, but with the time the memory give me problems. I like to use V9-6-0 because is faster. Somebudy can help me?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-12-22 15:08:44 -0600

Are you sure you want to delete instead of reset_state?

edit flag offensive delete link more


Yes, it is what I would like to do. However, both delete and reset throw an error that did not happen with the previous version.

hermmanhender gravatar image hermmanhender  ( 2021-12-22 15:30:37 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Question Tools

1 follower


Asked: 2021-12-09 08:15:15 -0600

Seen: 64 times

Last updated: Dec 22 '21