Commit 62ef0780 authored by Valérie Maquil's avatar Valérie Maquil

fixed small problem with negative variable values

parent 2e38b233
......@@ -101,7 +101,6 @@ public class Equation {
for (Variable variable : lockedMapping.getIndependentVariables()) {
scriptExecutor.set(variable);
}
scriptExecutor.eval(this.script);
} catch (Exception exception) {
LOGGER.error("Error while evaluating script {}", this.script, exception); //$NON-NLS-1$
......
......@@ -71,7 +71,8 @@ public class NumericalVariable extends Variable {
format.setDecimalSeparatorAlwaysShown(false);
format.setGroupingUsed(false);
minValue = Double.MIN_VALUE;
// minValue = Double.MIN_VALUE;
minValue = -Double.MAX_VALUE;
maxValue = Double.MAX_VALUE;
scale = 1;
}
......@@ -152,6 +153,7 @@ public class NumericalVariable extends Variable {
public void setValue(Object value) {
Double newValue;
newValue = (Double) this.valueFromString(value.toString());
// newValue = (Double) value;
if (newValue < this.minValue)
this.value = this.minValue;
else if (newValue > this.maxValue)
......
......@@ -255,7 +255,6 @@ public final class ValueWidget extends BaseWidget implements InformationProvider
value = this.upperBound;
}
variable.setValue(value);
}
}
\ No newline at end of file
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