From 5199d998ff23a073f660da58b7ffd0d6ff842fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Mon, 30 Mar 2020 03:05:19 +0200 Subject: [PATCH] Inprove check() --- src/problem/problem.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 064a03a4d..c79f3130d 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -1599,7 +1599,7 @@ bool Problem::check(int verbose_level) const if ( Fo ) // case FRAME: { if (verbose_level > 0) - cout << " --> F" << Fo->id() << " <- "; + cout << " ( --> F" << Fo->id() << " <- "; bool found = false; for (auto cby : Fo->getConstrainedByList()) { @@ -1608,7 +1608,7 @@ bool Problem::check(int verbose_level) const found = found || (c == cby); } if (verbose_level > 0) - cout << endl; + cout << ")"; // check constrained_by pointer in constrained frame is_consistent = is_consistent && found; } @@ -1617,7 +1617,7 @@ bool Problem::check(int verbose_level) const if ( Co ) // case CAPTURE: { if (verbose_level > 0) - cout << " --> C" << Co->id() << " <- "; + cout << " ( --> C" << Co->id() << " <- "; bool found = false; for (auto cby : Co->getConstrainedByList()) { @@ -1626,7 +1626,7 @@ bool Problem::check(int verbose_level) const found = found || (c == cby); } if (verbose_level > 0) - cout << endl; + cout << ")"; // check constrained_by pointer in constrained frame is_consistent = is_consistent && found; } @@ -1635,7 +1635,7 @@ bool Problem::check(int verbose_level) const if ( fo ) // case FEATURE: { if (verbose_level > 0) - cout << " --> f" << fo->id() << " <- "; + cout << " ( --> f" << fo->id() << " <- "; bool found = false; for (auto cby : fo->getConstrainedByList()) { @@ -1644,7 +1644,7 @@ bool Problem::check(int verbose_level) const found = found || (c == cby); } if (verbose_level > 0) - cout << endl; + cout << ")"; // check constrained_by pointer in constrained feature is_consistent = is_consistent && found; } @@ -1653,7 +1653,7 @@ bool Problem::check(int verbose_level) const if ( Lo ) // case LANDMARK: { if (verbose_level > 0) - cout << " --> L" << Lo->id() << " <- "; + cout << " ( --> L" << Lo->id() << " <- "; bool found = false; for (auto cby : Lo->getConstrainedByList()) { @@ -1662,10 +1662,13 @@ bool Problem::check(int verbose_level) const found = found || (c == cby); } if (verbose_level > 0) - cout << endl; + cout << ")"; // check constrained_by pointer in constrained landmark is_consistent = is_consistent && found; } + if (verbose_level > 0) + cout << endl; + if (verbose_level > 0) { cout << " -> P @ " << c->getProblem().get() << endl; @@ -1711,7 +1714,7 @@ bool Problem::check(int verbose_level) const { sb_vec = FC->getStateBlockVec(); found_here = (std::find(sb_vec.begin(), sb_vec.end(), sb) != sb_vec.end()); - if (found_here) cout << " FC" << FC->id(); + if (found_here) cout << " F" << F->id() << ".C" << FC->id(); found = found || found_here; } @@ -1748,7 +1751,7 @@ bool Problem::check(int verbose_level) const { sb_vec = FoC->getStateBlockVec(); found_here = (std::find(sb_vec.begin(), sb_vec.end(), sb) != sb_vec.end()); - if (found_here) cout << " FoC" << FoC->id(); + if (found_here) cout << " Fo" << Fo->id() << ".C" << FoC->id(); found = found || found_here; } -- GitLab