X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/90b0fa923c841996f89a17c252a443a65493fbfc..3f756b051175054c62c4741fdab2a6b934828262:/src/mc/transition/TransitionAny.hpp diff --git a/src/mc/transition/TransitionAny.hpp b/src/mc/transition/TransitionAny.hpp index 25f67dd0cc..494006b2b8 100644 --- a/src/mc/transition/TransitionAny.hpp +++ b/src/mc/transition/TransitionAny.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -8,12 +8,12 @@ #include "src/kernel/actor/SimcallObserver.hpp" #include "src/mc/transition/Transition.hpp" +#include "src/mc/transition/TransitionComm.hpp" #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class TestAnyTransition : public Transition { std::vector transitions_; @@ -24,6 +24,13 @@ public: bool depends(const Transition* other) const override; Transition* get_current_transition() const { return transitions_.at(times_considered_); } + bool result() const + { + return std::any_of(begin(transitions_), end(transitions_), [](const Transition* transition) { + const auto* tested_transition = static_cast(transition); + return (tested_transition->get_sender() != -1 && tested_transition->get_receiver() != -1); + }); + } }; class WaitAnyTransition : public Transition { @@ -37,7 +44,6 @@ public: Transition* get_current_transition() const { return transitions_.at(times_considered_); } }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif