-
- if (visited_states.size() <= (std::size_t) _sg_mc_visited)
- return nullptr;
-
- // We have reached the maximum number of stored states;
-
- XBT_DEBUG("Try to remove visited state (maximum number of stored states reached)");
-
- // Find the (index of the) older state (with the smallest num):
- int min2 = mc_stats->expanded_states;
- unsigned int index2 = 0;
-
- for (std::size_t cursor2 = 0; cursor2 != visited_states.size(); ++cursor2)
- if (!mc_model_checker->is_important_snapshot(
- *visited_states[cursor2]->system_state)
- && visited_states[cursor2]->num < min2) {
- index2 = cursor2;
- min2 = visited_states[cursor2]->num;
- }
-
- // and drop it:
- visited_states.erase(visited_states.begin() + index2);
- XBT_DEBUG("Remove visited state (maximum number of stored states reached)");
-
- return nullptr;