Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Repast J
Submitted By: Kenrick Mock (kenrickm)
Assigned to: Nobody/Anonymous (nobody)
Summary: off by one for float parms in parameter file
There are inconsistent results for the number of runs
with small floats. Sometimes the runs will include
current==end, and sometimes the runs will exclude
current==end. For example, in a parameter file such as
The simulation generates runs for Parm = 0.8, 0.85,
0.9, and stops at 0.95.
If start is changed to 0.85 then the simulation
generates runs for Parm = 0.85, 0.9, 0.95, and stops at
This appears to stem from the code in increment() in
AddIncrementer.java which is:
since curVal and end are both doubles, due to floating
point inaccuracies sometimes curVal may be slightly
larger than end and stop the run, when the two should
be considered equal. A workaround is to make end equal
to something like 1.0001.