- /* If comm determinism verification, we cannot stop the exploration if
- some communications are not finished (at least, data are transferred).
- These communications are incomplete and they cannot be analyzed and
- compared with the initial pattern. */
- bool compare_snapshots = all_communications_are_finished()
- && this->initial_communications_pattern_done;
+ /* If comm determinism verification, we cannot stop the exploration if some communications are not finished (at
+ * least, data are transferred). These communications are incomplete and they cannot be analyzed and compared
+ * with the initial pattern. */
+ bool compare_snapshots = all_communications_are_finished() && this->initial_communications_pattern_done;
+
+ if (_sg_mc_max_visited_states != 0)
+ visited_state = visitedStates_.addVisitedState(expandedStatesCount_, next_state.get(), compare_snapshots);
+ else
+ visited_state = nullptr;