Skip to content

Commit

Permalink
Check is_sim_active
Browse files Browse the repository at this point in the history
  • Loading branch information
IshaanDesai committed Feb 7, 2024
1 parent 29473d5 commit de8b7f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 2 additions & 0 deletions micro_manager/adaptivity/global_adaptivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def compute_adaptivity(

is_sim_active = self._update_active_sims(similarity_dists, is_sim_active_nm1)

self._logger.info("is_sim_active: {}".format(is_sim_active))

is_sim_active, sim_is_associated_to = self._update_inactive_sims(
similarity_dists, is_sim_active_nm1, sim_is_associated_to_nm1, micro_sims)

Expand Down
15 changes: 4 additions & 11 deletions micro_manager/micro_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ def solve(self) -> None:
"""
t, n = 0, 0
t_checkpoint, n_checkpoint = 0, 0
similarity_dists_cp = None
is_sim_active_cp = None
sim_is_associated_to_cp = None
sim_states_cp = [None] * self._local_number_of_sims

if self._is_adaptivity_on:
similarity_dists = np.zeros(
Expand All @@ -153,17 +157,6 @@ def solve(self) -> None:
similarity_dists, is_sim_active, sim_is_associated_to = self._adaptivity_controller.compute_adaptivity(
self._dt, self._micro_sims, similarity_dists, is_sim_active, sim_is_associated_to, self._data_for_adaptivity)

if self._adaptivity_type == "local":
active_sim_ids = np.where(is_sim_active)[0]
elif self._adaptivity_type == "global":
active_sim_ids = np.where(
is_sim_active[self._global_ids_of_local_sims[0]:self._global_ids_of_local_sims[-1] + 1])[0]

similarity_dists_cp = None
is_sim_active_cp = None
sim_is_associated_to_cp = None
sim_states_cp = [None] * self._local_number_of_sims

while self._participant.is_coupling_ongoing():
# Write a checkpoint
if self._participant.requires_writing_checkpoint():
Expand Down

0 comments on commit de8b7f6

Please sign in to comment.