Commit b26f2fd8 authored by Robert Ricci's avatar Robert Ricci

Add violations to the scoring selftest, and print out the solution

that gave us the error.
parent d0e2aff4
......@@ -752,17 +752,24 @@ void anneal(bool scoring_selftest, double scale_neighborhood,
// this node, then removing it, is the same one we would have
// gotten otherwise
double oldscore = get_score();
int oldviolated = violated;
double tempscore;
int tempviolated;
if (!add_node(vv,newpos,false,false)) {
tempscore = get_score();
tempviolated = violated;
remove_node(vv);
}
if (oldscore != get_score()) {
if ((oldscore != get_score()) || (oldviolated != violated)) {
cerr << "Scoring problem adding a mapping - oldscore was " <<
oldscore << " newscore is " << newscore << " tempscore was "
<< tempscore << endl;
cerr << "oldviolated was " << oldviolated << " newviolated is "
<< violated << " tempviolated was " << tempviolated << endl;
cerr << "I was tring to map " << vn->name << " to " <<
newpnode->name << endl;
print_solution();
cerr << vinfo;
abort();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment