- xbt_fifo_item_t item;
- mc_state_t stack_state;
- for(item = xbt_fifo_get_first_item(mc_stack); item != nullptr; item = xbt_fifo_get_next_item(item)) {
- stack_state = (mc_state_t) xbt_fifo_get_item_content(item);
- if(snapshot_compare(stack_state, current_state) == 0){
- XBT_INFO("Non-progressive cycle : state %d -> state %d", stack_state->num, current_state->num);
+static int snapshot_compare(simgrid::mc::State* state1, simgrid::mc::State* state2)
+{
+ simgrid::mc::Snapshot* s1 = state1->system_state.get();
+ simgrid::mc::Snapshot* s2 = state2->system_state.get();
+ int num1 = state1->num;
+ int num2 = state2->num;
+ return snapshot_compare(num1, s1, num2, s2);
+}
+
+static int is_exploration_stack_state(simgrid::mc::State* current_state)
+{
+ for (auto i = mc_stack.rbegin(); i != mc_stack.rend(); ++i)
+ if(snapshot_compare(*i, current_state) == 0){
+ XBT_INFO("Non-progressive cycle : state %d -> state %d", (*i)->num, current_state->num);