Fixed an issue where ADMMReasoner did not correctly observere when objective break was turned off.
@@ -226,7 +226,7 @@ public class ADMMReasoner implements Reasoner {
int iteration = 1;
while (
(iteration == 1 || primalRes > epsilonPrimal || dualRes > epsilonDual)
- && (objectiveBreak && (MathUtils.isZero(oldObjective) || !MathUtils.equals(objective, oldObjective)))
+ && (!objectiveBreak || (MathUtils.isZero(oldObjective) || !MathUtils.equals(objective, oldObjective)))
&& iteration <= maxIter) {
// Zero out the iteration variables.
primalRes = 0.0f;
@@ -260,7 +260,6 @@ public class ADMMReasoner implements Reasoner {
objective = 0.0f;
boolean feasible = true;
- if (log.isTraceEnabled()) {
for (ADMMObjectiveTerm term : termStore) {
if (term instanceof LinearConstraintTerm) {
if (term.evaluate() > 0.0f) {
@@ -270,7 +269,6 @@ public class ADMMReasoner implements Reasoner {
objective += (1.0f - term.evaluate());
}
}
- }
log.trace(
"Iteration {} -- Objective: {}, Feasible: {}, Primal: {}, Dual: {}, Epsilon Primal: {}, Epsilon Dual: {}.",
