Commit 36e7f6b7 authored by Simon de Givry's avatar Simon de Givry Committed by Thomas Schiex
Browse files

[debug] ToulBar2::uai used only for file format reader and energy information...

[debug] ToulBar2::uai used only for file format reader and energy information output (same as ToulBar2::bayesian) BUT not for solution printing in MPE file (controled by ToulBar2::uaieval flag)
parent f0ead65e
......@@ -2252,7 +2252,7 @@ void TreeDecomposition::newSolution(Cost lb)
if (ToulBar2::maxsateval) {
cout << "o " << lb << endl;
}
if (ToulBar2::uai || ToulBar2::uaieval) {
if (ToulBar2::uaieval && !ToulBar2::isZ) {
wcsp->solution_UAI(lb);
}
// warning: cannot read solution from variable assignments
......
......@@ -1232,7 +1232,7 @@ void Solver::newSolution()
if (ToulBar2::maxsateval) {
cout << "o " << wcsp->getLb() << endl;
}
if ((ToulBar2::uai || ToulBar2::uaieval) && !ToulBar2::isZ) {
if (ToulBar2::uaieval && !ToulBar2::isZ) {
((WCSP*)wcsp)->solution_UAI(wcsp->getLb());
}
......@@ -1845,7 +1845,7 @@ void Solver::endSolve(bool isSolution, Cost cost, bool isComplete)
if (ToulBar2::isZ) {
if (ToulBar2::verbose >= 1)
cout << "NegativeShiftingCost= " << wcsp->getNegativeLb() << endl;
if (ToulBar2::uai) {
if (ToulBar2::uaieval) {
rewind(ToulBar2::solution_uai_file);
fprintf(ToulBar2::solution_uai_file, "PR\n");
fprintf(ToulBar2::solution_uai_file, PrintFormatProb, (wcsp->LogSumExp(ToulBar2::logZ, ToulBar2::logU) + ToulBar2::markov_log) / Log(10.));
......
......@@ -2045,7 +2045,7 @@ int _tmain(int argc, TCHAR* argv[])
exit(EXIT_FAILURE);
}
}
if (ToulBar2::uai || ToulBar2::uaieval) {
if (ToulBar2::uaieval) {
char* tmpPath = new char[strlen(argv[0]) + 1];
strcpy(tmpPath, argv[0]);
if (strcmp(tmpPath, "toulbar2") == 0)
......@@ -2191,7 +2191,7 @@ int _tmain(int argc, TCHAR* argv[])
if (ToulBar2::verbose >= 0)
cout << "No solution found by initial propagation!" << endl;
if (ToulBar2::isZ) {
if (ToulBar2::uai) {
if (ToulBar2::uaieval) {
rewind(ToulBar2::solution_uai_file);
fprintf(ToulBar2::solution_uai_file, "PR\n");
fprintf(ToulBar2::solution_uai_file, PrintFormatProb, -numeric_limits<TProb>::infinity());
......
......@@ -719,7 +719,7 @@ void ReplicatedParallelDGVNS::DumpBestSol(bool improved)
wcsp->printSolution(ToulBar2::solutionFile);
fprintf(ToulBar2::solutionFile, "\n");
}
if (ToulBar2::uai || ToulBar2::uaieval) {
if (ToulBar2::uaieval && !ToulBar2::isZ) {
((WCSP*)wcsp)->solution_UAI(bestUb);
}
}
......
Supports Markdown
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