Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Finally kill the now empty ModelChecker class
[simgrid.git] / src / mc / transition / TransitionActorJoin.cpp
1 /* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "src/mc/transition/TransitionActorJoin.hpp"
7 #include "simgrid/config.h"
8 #include "xbt/asserts.h"
9 #include "xbt/string.hpp"
10 #if SIMGRID_HAVE_MC
11 #include "src/mc/api/RemoteApp.hpp"
12 #include "src/mc/api/State.hpp"
13 #endif
14
15 #include <sstream>
16
17 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans_actorlifecycle, mc_transition,
18                                 "Logging specific to MC transitions about actors' lifecycle: joining, ending");
19
20 namespace simgrid::mc {
21
22 ActorJoinTransition::ActorJoinTransition(aid_t issuer, int times_considered, std::stringstream& stream)
23     : Transition(Type::ACTOR_JOIN, issuer, times_considered)
24 {
25   xbt_assert(stream >> target_ >> timeout_);
26   XBT_DEBUG("ActorJoinTransition target:%ld, %s ", target_, (timeout_ ? "timeout" : "no-timeout"));
27 }
28 std::string ActorJoinTransition::to_string(bool verbose) const
29 {
30   return xbt::string_printf("ActorJoin(target %ld, %s)", target_, (timeout_ ? "timeout" : "no timeout"));
31 }
32 bool ActorJoinTransition::depends(const Transition* other) const
33 {
34   // Joining is indep with any other transitions:
35   // - It is only enabled once the target ends, and after this point it's enabled no matter what
36   // - Other joins don't affect it, and it does not impact on the enabledness of any other transition
37   return false;
38 }
39
40 } // namespace simgrid::mc