void State::execute_next(int next)
{
std::vector<ActorInformation>& actors = mc_model_checker->get_remote_process().actors();
-
const kernel::actor::ActorImpl* actor = actors[next].copy.get_buffer();
- aid_t aid = actor->get_pid();
- int times_considered;
+ const aid_t aid = actor->get_pid();
- simgrid::mc::ActorState* actor_state = &actor_states_[aid];
/* This actor is ready to be executed. Prepare its execution when simcall_handle will be called on it */
- times_considered = actor_state->get_times_considered_and_inc();
- if (actor->simcall_.mc_max_consider_ <= actor_state->get_times_considered())
- actor_state->set_done();
+ const unsigned times_considered = actor_states_[aid].do_consider(actor->simcall_.mc_max_consider_);
- XBT_DEBUG("Let's run actor %ld (times_considered = %d)", aid, times_considered);
+ XBT_DEBUG("Let's run actor %ld (times_considered = %u)", aid, times_considered);
Transition::executed_transitions_++;
unsigned int times_considered_ = 0;
public:
+ unsigned int do_consider(unsigned int max_consider)
+ {
+ if (max_consider <= times_considered_ + 1)
+ set_done();
+ return times_considered_++;
+ }
unsigned int get_times_considered() const { return times_considered_; }
- unsigned int get_times_considered_and_inc() { return times_considered_++; }
bool is_disabled() const { return this->state_ == InterleavingType::disabled; }
bool is_done() const { return this->state_ == InterleavingType::done; }