Skip to content
Snippets Groups Projects
Commit 5199d998 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Inprove check()

parent 73c1594b
No related branches found
No related tags found
No related merge requests found
Pipeline #5037 failed
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment