X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7d64a0a97ff82b66dccd648ee5f40997d2e39dc6..6a908b79ea45f85f305620c09375b72483b7eee9:/src/mc/api/ActorState.hpp diff --git a/src/mc/api/ActorState.hpp b/src/mc/api/ActorState.hpp index 7f3bc11ec2..d407e5b893 100644 --- a/src/mc/api/ActorState.hpp +++ b/src/mc/api/ActorState.hpp @@ -26,7 +26,6 @@ namespace simgrid::mc { * is important in cases */ class ActorState { - /** * @brief The transitions that the actor is allowed to execute from this * state, viz. those that are enabled for this actor @@ -41,7 +40,7 @@ class ActorState { * such transitions such that `pending_transitions_[i]` represents * the variation of the transition with `times_considered = i`. * - * TODO: If only a subset of transitions of an actor that can + * @note: If only a subset of transitions of an actor that can * take multiple transitions in some state are truly enabled, * we would instead need to map `times_considered` to a transition, * as the map is currently implicit in the ordering of the transitions @@ -54,7 +53,7 @@ class ActorState { * This means there may be a way to store the list once and apply differences * rather than repeating elements frequently. */ - std::vector> pending_transitions_; + std::vector> pending_transitions_; /* Possible exploration status of an actor transition in a state. * Either the checker did not consider the transition, or it was considered and still to do, or considered and @@ -87,7 +86,7 @@ class ActorState { public: ActorState(aid_t aid, bool enabled, unsigned int max_consider) : ActorState(aid, enabled, max_consider, {}) {} - ActorState(aid_t aid, bool enabled, unsigned int max_consider, std::vector> transitions) + ActorState(aid_t aid, bool enabled, unsigned int max_consider, std::vector> transitions) : pending_transitions_(std::move(transitions)), aid_(aid), max_consider_(max_consider), enabled_(enabled) { } @@ -115,7 +114,7 @@ public: } void mark_done() { this->state_ = InterleavingType::done; } - inline Transition* get_transition(unsigned times_considered) + inline Transition* get_transition(unsigned times_considered) const { xbt_assert(times_considered < this->pending_transitions_.size(), "Actor %ld does not have a state available transition with `times_considered = %u`,\n" @@ -132,6 +131,11 @@ public: aid_, times_considered); this->pending_transitions_[times_considered] = std::move(t); } + + const std::vector>& get_enabled_transitions() const + { + return this->pending_transitions_; + }; }; } // namespace simgrid::mc