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

StateManager's delete_state function error

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

hermmanhender's avatar

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

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\Main_v2_9_20211204.py", line 104, in <module>
    EMS_prop_v2_9_20211204.init_EPRandomConvergence(conf_experimento, var_case_n)
  File "c:\Users\grhen\Documents\GitHub\RLforEP\EMS_prop_v2_9_20211204.py", line 294, in init_EPRandomConvergence
    runEP(conf_experimento, var_case_n, var_step_n, epJSON_new)
  File "c:\Users\grhen\Documents\GitHub\RLforEP\EMS_prop_v2_9_20211204.py", line 195, in runEP     
    api.state_manager.delete_state(state)
  File "C:\EnergyPlusV9-6-0\pyenergyplus\state.py", line 105, in delete_state
    self.api.stateDelete(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.state_manager.reset_state(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])
api.state_manager.delete_state(state)

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
0

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

Are you sure you want to delete instead of reset_state?

edit flag offensive delete link more

Comments

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's avatar hermmanhender  ( 2021-12-22 15:30:37 -0500 )edit

Your Answer

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

Add Answer

Careers

Question Tools

1 follower

Stats

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

Seen: 153 times

Last updated: Dec 22 '21