public:
void copy_from(const Strategy* strategy) override
{
- const MaxMatchComm* cast_strategy = dynamic_cast<MaxMatchComm const*>(strategy);
+ const auto* cast_strategy = dynamic_cast<MaxMatchComm const*>(strategy);
xbt_assert(cast_strategy != nullptr);
for (auto& [id, val] : cast_strategy->mailbox_)
mailbox_[id] = val;
std::pair<aid_t, int> best_transition(bool must_be_todo) const override
{
- std::pair<aid_t, int> min_found = std::make_pair(-1, value_of_state_+2);
+ std::pair<aid_t, int> min_found = std::make_pair(-1, value_of_state_ + 2);
for (auto const& [aid, actor] : actors_to_run_) {
if ((not actor.is_todo() && must_be_todo) || not actor.is_enabled() || actor.is_done())
continue;
const Transition* transition = actor.get_transition(actor.get_times_considered()).get();
if (auto const* cast_recv = dynamic_cast<CommRecvTransition const*>(transition)) {
- if (mailbox_.count(cast_recv->get_mailbox()) > 0 and
- mailbox_.at(cast_recv->get_mailbox()) > 0) {
- aid_value--; // This means we have waiting recv corresponding to this recv
- } else {
- aid_value++;
- }
+ if (mailbox_.count(cast_recv->get_mailbox()) > 0 && mailbox_.at(cast_recv->get_mailbox()) > 0) {
+ aid_value--; // This means we have waiting recv corresponding to this recv
+ } else {
+ aid_value++;
+ }
}
if (auto const* cast_send = dynamic_cast<CommSendTransition const*>(transition)) {
- if (mailbox_.count(cast_send->get_mailbox()) > 0 and
- mailbox_.at(cast_send->get_mailbox()) < 0) {
- aid_value--; // This means we have waiting recv corresponding to this send
- }else {
- aid_value++;
- }
+ if (mailbox_.count(cast_send->get_mailbox()) > 0 && mailbox_.at(cast_send->get_mailbox()) < 0) {
+ aid_value--; // This means we have waiting recv corresponding to this send
+ } else {
+ aid_value++;
+ }
}
if (aid_value < min_found.second)