Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert simgrid::mc::snapshot_equal() into Snapshot::operator==()
[simgrid.git] / src / mc / api / State.cpp
index 79213e7..c2b8af5 100644 (file)
@@ -15,23 +15,14 @@ namespace simgrid::mc {
 
 long State::expended_states_ = 0;
 
-State::State(Session& session) : num_(++expended_states_)
+State::State(RemoteApp& remote_app) : num_(++expended_states_)
 {
-  auto actors = mc_model_checker->get_remote_process().actors();
-
-  for (unsigned int i = 0; i < actors.size(); i++) {
-    auto remote_actor = actors[i].copy.get_buffer();
-    aid_t aid         = remote_actor->get_pid();
-
-    actors_to_run_.insert(
-        std::make_pair(aid, ActorState(aid, session.actor_is_enabled(aid), remote_actor->simcall_.mc_max_consider_)));
-  }
+  remote_app.get_actors_status(actors_to_run_);
 
   transition_.reset(new Transition());
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (num_ % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
-    auto snapshot_ptr = Api::get().take_snapshot(num_);
-    system_state_     = std::shared_ptr<simgrid::mc::Snapshot>(snapshot_ptr);
+    system_state_ = std::make_shared<simgrid::mc::Snapshot>(num_);
   }
 }