X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/72d32c4e88a57f4786f62fec48a1bfa454adbff9..dc6726419e36dd2853c7773e0a8fc177091e79e0:/src/mc/transition/TransitionAny.cpp diff --git a/src/mc/transition/TransitionAny.cpp b/src/mc/transition/TransitionAny.cpp index d590c5f5a1..220b7cb501 100644 --- a/src/mc/transition/TransitionAny.cpp +++ b/src/mc/transition/TransitionAny.cpp @@ -1,16 +1,12 @@ -/* 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. */ #include "src/mc/transition/TransitionAny.hpp" +#include "simgrid/config.h" #include "xbt/asserts.h" -#include -#if SIMGRID_HAVE_MC -#include "src/mc/ModelChecker.hpp" -#include "src/mc/Session.hpp" -#include "src/mc/api/State.hpp" -#endif +#include "xbt/string.hpp" #include @@ -31,14 +27,20 @@ TestAnyTransition::TestAnyTransition(aid_t issuer, int times_considered, std::st } std::string TestAnyTransition::to_string(bool verbose) const { - auto res = xbt::string_printf("TestAny{ "); - for (auto const* t : transitions_) + auto res = xbt::string_printf("TestAny(%s){ ", this->result() ? "TRUE" : "FALSE"); + for (auto const* t : transitions_) { res += t->to_string(verbose); + res += "; "; + } res += " }"; return res; } bool TestAnyTransition::depends(const Transition* other) const { + // Actions executed by the same actor are always dependent + if (other->aid_ == aid_) + return true; + return transitions_[times_considered_]->depends(other); } WaitAnyTransition::WaitAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream) @@ -61,6 +63,9 @@ std::string WaitAnyTransition::to_string(bool verbose) const } bool WaitAnyTransition::depends(const Transition* other) const { + // Actions executed by the same actor are always dependent + if (other->aid_ == aid_) + return true; return transitions_[times_considered_]->depends(other); }