1 /* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved. */
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. */
6 #include "src/mc/transition/TransitionActorJoin.hpp"
7 #include "simgrid/config.h"
8 #include "xbt/asserts.h"
9 #include "xbt/string.hpp"
13 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans_actorlifecycle, mc_transition,
14 "Logging specific to MC transitions about actors' lifecycle: joining, ending");
16 namespace simgrid::mc {
18 ActorJoinTransition::ActorJoinTransition(aid_t issuer, int times_considered, std::stringstream& stream)
19 : Transition(Type::ACTOR_JOIN, issuer, times_considered)
21 xbt_assert(stream >> target_ >> timeout_);
22 XBT_DEBUG("ActorJoinTransition target:%ld, %s ", target_, (timeout_ ? "timeout" : "no-timeout"));
24 std::string ActorJoinTransition::to_string(bool verbose) const
26 return xbt::string_printf("ActorJoin(target %ld, %s)", target_, (timeout_ ? "timeout" : "no timeout"));
28 bool ActorJoinTransition::depends(const Transition* other) const
30 // Joining is dependent with any transition whose
31 // actor is that of the `other` action. , Join i
32 if (other->aid_ == target_) {
36 // Otherwise, joining is indep with any other transitions:
37 // - It is only enabled once the target ends, and after this point it's enabled no matter what
38 // - Other joins don't affect it, and it does not impact on the enabledness of any other transition
42 } // namespace simgrid::mc