- /* Set it as the executed transition of the current state */
- mc_current_state->executed_transition = trans;
- MC_UNSET_RAW_MEM;
-
- /* Execute the selected transition by scheduling it's associated process.
- Then schedule every process that got ready to run due to the execution
- of the transition */
- DEBUG1("Executing transition %s", trans->name);
- SIMIX_process_schedule(trans->process);
- MC_execute_surf_actions();
-
- while (xbt_swag_size(simix_global->process_to_run)) {
- MC_schedule_enabled_processes();
- MC_execute_surf_actions();
- }
-
- /* Calculate the enabled transitions set of the next state */
- MC_SET_RAW_MEM;
-
- xbt_setset_foreach(mc_current_state->transitions, cursor, trans_tmp) {
- if (trans_tmp->process != trans->process) {
- xbt_setset_set_insert(next_state->transitions, trans_tmp);
- }
- }
-
- MC_trans_compute_enabled(next_state->enabled_transitions,
- next_state->transitions);
-
- /* Choose one transition to interleave from the enabled transition set */
- trans = xbt_setset_set_choose(next_state->enabled_transitions);
- if (trans) {
- DEBUG1("Choosing process %s for next interleave",
- trans->process->name);
- xbt_setset_foreach(next_state->enabled_transitions, cursor,
- trans_tmp) {
- if (trans_tmp->process == trans->process)
- xbt_setset_set_insert(next_state->interleave, trans_tmp);
+ /* Get an enabled process and insert it in the interleave set of the next state */
+ xbt_swag_foreach(process, simix_global->process_list){
+ if(MC_process_is_enabled(process)){
+ MC_state_interleave_process(next_state, process);
+ break;