X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6e0c79dea1a322c6dbc569725865b7b6b05b2099..bc2253e2c879ee28ae5153f1d56497ab802aeea9:/src/mc/explo/odpor/WakeupTree.cpp diff --git a/src/mc/explo/odpor/WakeupTree.cpp b/src/mc/explo/odpor/WakeupTree.cpp index f7e0ea6040..73b2171894 100644 --- a/src/mc/explo/odpor/WakeupTree.cpp +++ b/src/mc/explo/odpor/WakeupTree.cpp @@ -15,7 +15,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_wut, mc, "Logging specific to ODPOR WakeupTrees"); - namespace simgrid::mc::odpor { void WakeupTreeNode::add_child(WakeupTreeNode* node) @@ -29,8 +28,9 @@ std::string WakeupTreeNode::string_of_whole_tree(int indentation_level) const std::string tabulations = ""; for (int i = 0; i < indentation_level; i++) tabulations += " "; - std::string final_string = action_ == nullptr ? "<>\n" : - tabulations + "Actor " + std::to_string(action_->aid_) + ": " + action_->to_string(true) + "\n"; + std::string final_string = action_ == nullptr ? "<>\n" + : tabulations + "Actor " + std::to_string(action_->aid_) + ": " + + action_->to_string(true) + "\n"; for (auto node : children_) final_string += node->string_of_whole_tree(indentation_level + 1); return final_string; @@ -159,6 +159,15 @@ void WakeupTree::remove_subtree_rooted_at(WakeupTreeNode* root) } } +void WakeupTree::remove_subtree_at_aid(aid_t proc) +{ + for (const auto& child : root_->get_ordered_children()) + if (child->get_actor() == proc) { + this->remove_subtree_rooted_at(child); + break; + } +} + void WakeupTree::remove_min_single_process_subtree() { if (const auto node = get_min_single_process_node(); node.has_value()) {