return -1;
}
-std::pair<aid_t, double> State::next_transition_guided() const
+std::pair<aid_t, int> State::next_transition_guided() const
{
return strategy_->next_transition();
}
/* Returns a positive number if there is another transition to pick, or -1 if not */
aid_t next_transition() const; // this function should disapear as it is redundant with the next one
- /* Same as next_transition, but choice is now guided, and a double corresponding to the
+ /* Same as next_transition, but choice is now guided, and an integer corresponding to the
internal cost of the transition is returned */
- std::pair<aid_t, double> next_transition_guided() const;
+ std::pair<aid_t, int> next_transition_guided() const;
/* Explore a new path on the remote app; the parameter 'next' must be the result of a previous call to
* next_transition() */
return;
}
- std::pair<aid_t, double> next_transition() const override
+ std::pair<aid_t, int> next_transition() const override
{
for (auto const& [aid, actor] : actors_to_run_) {
/* Only consider actors (1) marked as interleaving by the checker and (2) currently enabled in the application */
continue;
}
- return std::make_pair(aid, 1.0);
+ return std::make_pair(aid, 1);
}
- return std::make_pair(-1, 0.0);
+ return std::make_pair(-1, 0);
}
void execute_next(aid_t aid, RemoteApp& app) override { return; }
return;
}
- virtual std::pair<aid_t, double> next_transition() const = 0;
- virtual void execute_next(aid_t aid, RemoteApp& app) = 0;
- virtual void consider_best() = 0;
+ virtual std::pair<aid_t, int> next_transition() const = 0;
+ virtual void execute_next(aid_t aid, RemoteApp& app) = 0;
+ virtual void consider_best() = 0;
// Mark the first enabled and not yet done transition as todo
// If there's already a transition marked as todo, does nothing
/** Wait MC guiding class that aims at minimizing the number of in-fly communication.
* When possible, it will try to take the wait transition. */
class WaitStrategy : public Strategy {
- double taken_wait_ = 0;
- bool taking_wait_ = false;
+ int taken_wait_ = 0;
+ bool taking_wait_ = false;
public:
void operator=(const WaitStrategy& guide) { taken_wait_ = guide.taken_wait_; }
type == Transition::Type::MUTEX_WAIT or type == Transition::Type::SEM_WAIT;
}
- std::pair<aid_t, double> next_transition() const override
+ std::pair<aid_t, int> next_transition() const override
{
- std::pair<aid_t, double> if_no_wait = std::make_pair(-1, 0.0);
+ std::pair<aid_t, int> if_no_wait = std::make_pair(-1, 0);
for (auto const& [aid, actor] : actors_to_run_) {
if (not actor.is_todo() || not actor.is_enabled() || actor.is_done())
continue;