Skip to content

Commit

Permalink
Ensure data is reloaded from prerun after env.reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-h-elsheikh committed Aug 25, 2024
1 parent 46874de commit 6fd31c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions closed_loop_AFC/jet_cylinder/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ def step(self, action):
r"""Distribute the control action smoothly and linearly over `self.action_interval` simulation time steps."""
return self._smooth_step(action)

def reset(self, seed=None, options=None):
self._prerun_data_required = self._latest_available_sim_time > 0.0
return super().reset(seed=seed, options=options)

def _get_action(self, action, write_var_list):
acuation_interface_field = self._action_to_patch_field(action)
write_data = {
Expand Down
4 changes: 4 additions & 0 deletions closed_loop_AFC/rotating_cylinder/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ def step(self, action):
r"""Distribute the control action smoothly and linearly over `self.action_interval` simulation time steps."""
return self._smooth_step(action)

def reset(self, seed=None, options=None):
self._prerun_data_required = self._latest_available_sim_time > 0.0
return super().reset(seed=seed, options=options)

def _get_action(self, action, write_var_list):
acuation_interface_field = self._action_to_patch_field(action)
write_data = {
Expand Down

0 comments on commit 6fd31c7

Please sign in to comment.