- /* 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(); /* Do surf's related black magic */
- MC_schedule_enabled_processes();
-
- if(trans->type == mc_random && trans->random.current_value < trans->random.max){
- trans->random.current_value++;
- }else{
- //trans->random.current_value = trans->random.min;
- xbt_setset_set_remove(mc_current_state->interleave, trans);
- xbt_setset_set_insert(mc_current_state->done, trans);
- }
-
- /* Calculate the enabled transitions set of the next state */
- MC_SET_RAW_MEM;
-
- xbt_setset_foreach(mc_current_state->transitions, cursor, trans_tmp){
- DEBUG1("Checking transition %s", trans_tmp->name);
- if(trans_tmp->process != trans->process){
- DEBUG2("Inherit transition %p (%lu)", trans_tmp, trans_tmp->ID);
- 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 transition %p", trans);
- 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;