Skipping DCD variable truncation when we are already truncating on minimization.
@@ -131,9 +131,12 @@ public class DCDReasoner implements Reasoner {
term.minimize(truncateEveryStep);
}
+ // If we are truncating every step, then the variables are already in valid state.
+ if (!truncateEveryStep) {
for (RandomVariableAtom variable : termStore.getVariables()) {
variable.setValue(Math.max(Math.min(variable.getValue(), 1.0f), 0.0f));
}
+ }
long end = System.currentTimeMillis();
oldObjective = objective;
