-/* 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 <simgrid/config.h>
-#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 <sstream>
}
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)
}
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);
}