]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/api/State.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Simplify member initialization.
[simgrid.git] / src / mc / api / State.cpp
index 008a8443a47a6254805467d4923f2ccde51b0d00..967c625de9fa7917c57ba11352fc5240a85442cb 100644 (file)
@@ -23,7 +23,7 @@ State::State(RemoteApp& remote_app) : num_(++expended_states_), guide(std::make_
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (num_ % _sg_mc_checkpoint == 0)) || _sg_mc_termination)
     system_state_ = std::make_shared<simgrid::mc::Snapshot>(num_, remote_app.get_page_store(),
-                                                            remote_app.get_remote_process_memory());
+                                                            *remote_app.get_remote_process_memory());
 }
 
 State::State(RemoteApp& remote_app, const State* parent_state)
@@ -35,7 +35,7 @@ State::State(RemoteApp& remote_app, const State* parent_state)
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (num_ % _sg_mc_checkpoint == 0)) || _sg_mc_termination)
     system_state_ = std::make_shared<simgrid::mc::Snapshot>(num_, remote_app.get_page_store(),
-                                                            remote_app.get_remote_process_memory());
+                                                            *remote_app.get_remote_process_memory());
 
   /* If we want sleep set reduction, copy the sleep set and eventually removes things from it */
   if (_sg_mc_sleep_set) {
@@ -46,7 +46,7 @@ State::State(RemoteApp& remote_app, const State* parent_state)
 
       if (not parent_state_->get_transition()->depends(&transition)) {
 
-        sleep_set_.emplace(aid, transition);
+        sleep_set_.try_emplace(aid, transition);
         if (guide->actors_to_run_.count(aid) != 0) {
           XBT_DEBUG("Actor %ld will not be explored, for it is in the sleep set", aid);
 
@@ -64,15 +64,6 @@ std::size_t State::count_todo() const
   return boost::range::count_if(this->guide->actors_to_run_, [](auto& pair) { return pair.second.is_todo(); });
 }
 
-void State::mark_all_enabled_todo()
-{
-  for (auto const& [aid, _] : this->get_actors_list()) {
-    if (this->is_actor_enabled(aid) and not is_actor_done(aid)) {
-      this->mark_todo(aid);
-    }
-  }
-}
-
 Transition* State::get_transition() const
 {
   return transition_;