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

Public GIT Repository
Add first batch of tests for History class
[simgrid.git] / src / mc / api / State.cpp
index e6a1659687faeb78a2cb5301c9f4ba7664def9c2..e93885701fde7cab6dec953b4b8408368391d290 100644 (file)
@@ -14,12 +14,10 @@ namespace simgrid::mc {
 
 long State::expended_states_ = 0;
 
-State::State(const RemoteApp& remote_app) : default_transition(std::make_unique<Transition>()), num_(++expended_states_)
+State::State(const RemoteApp& remote_app) : num_(++expended_states_)
 {
   remote_app.get_actors_status(actors_to_run_);
 
-  transition_ = default_transition.get();
-
   /* 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_);
@@ -31,11 +29,17 @@ std::size_t State::count_todo() const
   return boost::range::count_if(this->actors_to_run_, [](auto& pair) { return pair.second.is_todo(); });
 }
 
-Transition* State::get_transition() const
+void State::mark_all_enabled_todo()
 {
-  if (transition_ == nullptr) {
-    return default_transition.get();
+  for (auto const& [aid, _] : this->get_actors_list()) {
+    if (this->is_actor_enabled(aid)) {
+      this->mark_todo(aid);
+    }
   }
+}
+
+Transition* State::get_transition() const
+{
   return transition_;
 }