X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/72d32c4e88a57f4786f62fec48a1bfa454adbff9..7e625e5e848a284b522d69ec28cb111f1f88515b:/src/mc/transition/TransitionAny.hpp diff --git a/src/mc/transition/TransitionAny.hpp b/src/mc/transition/TransitionAny.hpp index 2774d28327..35cbf4e391 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,7 +8,9 @@ #include "src/kernel/actor/SimcallObserver.hpp" #include "src/mc/transition/Transition.hpp" +#include "src/mc/transition/TransitionComm.hpp" +#include #include #include @@ -21,8 +23,16 @@ public: TestAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream); std::string to_string(bool verbose) const override; bool depends(const Transition* other) const override; + bool reversible_race(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 { @@ -32,6 +42,7 @@ public: WaitAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream); std::string to_string(bool verbose) const override; bool depends(const Transition* other) const override; + bool reversible_race(const Transition* other) const override; Transition* get_current_transition() const { return transitions_.at(times_considered_); } };