33 std::filesystem::path EvaluateImpResultsBp::GetImpResultsPath()
const
35 std::filesystem::path current_path = std::filesystem::current_path();
38 std::filesystem::directory_iterator dir_iter =
39 std::filesystem::directory_iterator(current_path);
43 auto dir_end_iter = std::filesystem::end(dir_iter);
49 std::filesystem::directory_iterator it =
50 std::find_if(std::filesystem::begin(dir_iter),
53 return p.path().stem() ==
61 if (it == dir_end_iter)
64 if (current_path == current_path.parent_path()) {
65 throw std::filesystem::filesystem_error(
66 "Belief propagation directory not found", std::error_code());
69 current_path = current_path.parent_path();
74 if (it != dir_end_iter) {
75 const std::filesystem::path impResultsPath{
77 if (!(std::filesystem::is_directory(impResultsPath))) {
79 std::filesystem::create_directory(impResultsPath);
81 return impResultsPath;
Belief propagation implementation constants related to file processing.
Declares child class of EvaluateImpResults that defines member functions for belief propagation evalu...
constexpr std::string_view kBeliefPropDirectoryName
constexpr std::string_view kImpResultsFolderName