Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Various sonar cleanups
[simgrid.git] / src / mc / transition / TransitionActor.cpp
index 70608f1..3e1027b 100644 (file)
@@ -47,7 +47,16 @@ bool ActorJoinTransition::depends(const Transition* other) const
   return false;
 }
 
-ActorSleepTransition::ActorSleepTransition(aid_t issuer, int times_considered, std::stringstream& stream)
+bool ActorJoinTransition::reversible_race(const Transition* other) const
+{
+  xbt_assert(type_ == Type::ACTOR_JOIN, "Unexpected transition type %s", to_c_str(type_));
+
+  // ActorJoin races with another event iff its target `T` is the same as  the actor executing the other transition.
+  // Clearly, then, we could not join on that actor `T` and then run a transition by `T`, so no race is reversible
+  return false;
+}
+
+ActorSleepTransition::ActorSleepTransition(aid_t issuer, int times_considered, std::stringstream&)
     : Transition(Type::ACTOR_SLEEP, issuer, times_considered)
 {
   XBT_DEBUG("ActorSleepTransition()");
@@ -66,4 +75,11 @@ bool ActorSleepTransition::depends(const Transition* other) const
   return false;
 }
 
+bool ActorSleepTransition::reversible_race(const Transition* other) const
+{
+  xbt_assert(type_ == Type::ACTOR_SLEEP, "Unexpected transition type %s", to_c_str(type_));
+
+  return true; // Always enabled
+}
+
 } // namespace simgrid::mc