+ outgoing_transition_ = std::shared_ptr<Transition>(just_executed);
+
+ actor_state.set_transition(outgoing_transition_, times_considered);
+ app.wait_for_requests();
+
+ return outgoing_transition_;
+}
+
+std::unordered_set<aid_t> State::get_backtrack_set() const
+{
+ std::unordered_set<aid_t> actors;
+ for (const auto& [aid, state] : get_actors_list()) {
+ if (state.is_todo() || state.is_done()) {
+ actors.insert(aid);
+ }
+ }
+ return actors;
+}
+
+std::unordered_set<aid_t> State::get_sleeping_actors() const
+{
+ std::unordered_set<aid_t> actors;
+ for (const auto& [aid, _] : get_sleep_set()) {
+ actors.insert(aid);
+ }
+ return actors;
+}
+
+std::unordered_set<aid_t> State::get_enabled_actors() const
+{
+ std::unordered_set<aid_t> actors;
+ for (const auto& [aid, state] : get_actors_list()) {
+ if (state.is_enabled()) {
+ actors.insert(aid);
+ }
+ }
+ return actors;
+}
+
+void State::seed_wakeup_tree_if_needed(const odpor::Execution& prior)
+{
+ // TODO: It would be better not to have such a flag.
+ if (has_initialized_wakeup_tree) {
+ XBT_DEBUG("Reached a node with the following initialized WuT:");
+ XBT_DEBUG("\n%s", wakeup_tree_.string_of_whole_tree().c_str());
+
+ return;
+ }
+ // TODO: Note that the next action taken by the actor may be updated
+ // after it executes. But we will have already inserted it into the
+ // tree and decided upon "happens-before" at that point for different
+ // executions :(
+ if (wakeup_tree_.empty()) {
+ // Find an enabled transition to pick
+ for (const auto& [_, actor] : get_actors_list()) {
+ if (actor.is_enabled()) {
+ // For each variant of the transition that is enabled, we want to insert the action into the tree.
+ // This ensures that all variants are searched
+ for (unsigned times = 0; times < actor.get_max_considered(); ++times) {
+ wakeup_tree_.insert(prior, odpor::PartialExecution{actor.get_transition(times)});
+ }
+ break; // Only one actor gets inserted (see pseudocode)
+ }
+ }
+ }
+ has_initialized_wakeup_tree = true;
+}
+
+void State::sprout_tree_from_parent_state()
+{