X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4d18789c406e94260275bdd03e624b82518859c3..4f76cb02e1d37e95f8e9a14fd4fc84f4b27f7661:/src/mc/explo/odpor/WakeupTree.cpp diff --git a/src/mc/explo/odpor/WakeupTree.cpp b/src/mc/explo/odpor/WakeupTree.cpp index 27d914a1f0..f7e0ea6040 100644 --- a/src/mc/explo/odpor/WakeupTree.cpp +++ b/src/mc/explo/odpor/WakeupTree.cpp @@ -13,6 +13,9 @@ #include #include +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_wut, mc, "Logging specific to ODPOR WakeupTrees"); + + namespace simgrid::mc::odpor { void WakeupTreeNode::add_child(WakeupTreeNode* node) @@ -21,6 +24,18 @@ void WakeupTreeNode::add_child(WakeupTreeNode* node) node->parent_ = this; } +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"; + for (auto node : children_) + final_string += node->string_of_whole_tree(indentation_level + 1); + return final_string; +} + PartialExecution WakeupTreeNode::get_sequence() const { // TODO: Prevent having to compute this at the node level @@ -85,6 +100,11 @@ std::optional WakeupTree::get_min_single_process_node() const return this->root_->children_.front(); } +std::string WakeupTree::string_of_whole_tree() const +{ + return root_->string_of_whole_tree(0); +} + WakeupTree WakeupTree::make_subtree_rooted_at(WakeupTreeNode* root) { // Perform a BFS search to perform a deep copy of the portion