Skip to content

Commit

Permalink
Merge pull request #3126 from davidraker/eplus_fix
Browse files Browse the repository at this point in the history
Updates to Energy Plus Agent
  • Loading branch information
craig8 authored Oct 18, 2023
2 parents 841bb4e + ab32fd2 commit f0271c7
Show file tree
Hide file tree
Showing 4 changed files with 3,062 additions and 3,049 deletions.
12 changes: 6 additions & 6 deletions examples/EnergyPlusAgent/energyplus/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,22 +362,22 @@ def check_advance(self):
timestep = int(60 / self.EnergyPlus_sim.timestep)

if not self.EnergyPlus_sim.real_time_flag:
self.cosim_sync_counter += timestep
if self.cosim_sync_counter < self.EnergyPlus_sim.co_sim_timestep:
self.EnergyPlus_sim.cosim_sync_counter += timestep
if self.EnergyPlus_sim.cosim_sync_counter < self.EnergyPlus_sim.co_sim_timestep:
self.advance_simulation(None, None, None, None, None, None)
else:
self.cosim_sync_counter = 0
self.EnergyPlus_sim.cosim_sync_counter = 0
self.vip.pubsub.publish('pubsub',
self.tns_actuate,
headers={},
message={}).get(timeout=10)
elif self.EnergyPlus_sim.hour > self.EnergyPlus_sim.currenthour or self.EnergyPlus_sim.passtime:
self.EnergyPlus_sim.passtime = True
self.cosim_sync_counter += timestep
if self.cosim_sync_counter < self.EnergyPlus_sim.co_sim_timestep:
self.EnergyPlus_sim.cosim_sync_counter += timestep
if self.EnergyPlus_sim.cosim_sync_counter < self.EnergyPlus_sim.co_sim_timestep:
self.advance_simulation(None, None, None, None, None, None)
else:
self.cosim_sync_counter = 0
self.EnergyPlus_sim.cosim_sync_counter = 0
self.vip.pubsub.publish('pubsub',
self.tns_actuate,
headers={},
Expand Down
Loading

0 comments on commit f0271c7

Please sign in to comment.