X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/028d1ea1cbbb8c6fc9a6f981aab665270b661c20..e48eade5ab404acd1948883302768c55be145b6a:/src/mc/api/State.hpp diff --git a/src/mc/api/State.hpp b/src/mc/api/State.hpp index 680f08641d..83a2f0714a 100644 --- a/src/mc/api/State.hpp +++ b/src/mc/api/State.hpp @@ -33,6 +33,9 @@ class XBT_PRIVATE State : public xbt::Extendable { */ Transition* transition_ = default_transition_.get(); + /** @brief A list of transition to be replayed in order to get in this state. */ + std::list recipe_; + /** Sequential state ID (used for debugging) */ long num_ = 0; @@ -41,7 +44,7 @@ class XBT_PRIVATE State : public xbt::Extendable { /** Unique parent of this state. Required both for sleep set computation and for guided model-checking */ - const State* parent_state_; + std::shared_ptr parent_state_ = nullptr; std::shared_ptr guide_; @@ -52,8 +55,7 @@ class XBT_PRIVATE State : public xbt::Extendable { public: explicit State(RemoteApp& remote_app); - explicit State(RemoteApp& remote_app, const State* parent_state); - explicit State(const State& other); + explicit State(RemoteApp& remote_app, std::shared_ptr parent_state); /* Returns a positive number if there is another transition to pick, or -1 if not */ aid_t next_transition() const; // this function should disapear as it is redundant with the next one @@ -80,6 +82,9 @@ public: bool is_actor_done(aid_t actor) const { return guide_->actors_to_run_.at(actor).is_done(); } Transition* get_transition() const; void set_transition(Transition* t) { transition_ = t; } + std::shared_ptr get_parent_state() { return parent_state_; } + std::list get_recipe() const { return recipe_; } + std::map const& get_actors_list() const { return guide_->actors_to_run_; } unsigned long get_actor_count() const { return guide_->actors_to_run_.size(); }