1 #include "../simix/private.h"
5 static void MC_state_add_transition(mc_state_t state, mc_transition_t trans);
8 * \brief Creates a state data structure used by the exploration algorithm
10 mc_state_t MC_state_new(void)
12 mc_state_t state = NULL;
14 state = xbt_new0(s_mc_state_t, 1);
15 state->interleave = xbt_setset_new_set(mc_setset);
16 state->done = xbt_setset_new_set(mc_setset);
18 mc_stats->expanded_states++;
23 * \brief Deletes a state data structure
24 * \param trans The state to be deleted
26 void MC_state_delete(mc_state_t state)
28 xbt_setset_destroy_set(state->interleave);
29 xbt_setset_destroy_set(state->done);
33 void MC_state_set_executed_request(mc_state_t state, smx_req_t req)
35 state->executed = *req;
38 smx_req_t MC_state_get_executed_request(mc_state_t state)
40 return &state->executed;
43 smx_req_t MC_state_get_request(mc_state_t state)
45 smx_process_t process = NULL;
46 while((process = xbt_setset_set_extract(state->interleave))){
47 if(SIMIX_process_is_enabled(process)
48 && !xbt_setset_set_belongs(state->done, process)){
49 xbt_setset_set_insert(state->done, process);
50 return process->request;