averbraeck / opentrafficsim

Open Source Multi-Level Traffic Simulator
BSD 3-Clause "New" or "Revised" License
28 stars 8 forks source link

Running TJunction demo with Gtu.ALIGNED = false #92

Closed WJSchakel closed 4 months ago

WJSchakel commented 9 months ago

Running the TJunction demo with Gtu.ALIGNED = false; creates an exception:

org.opentrafficsim.core.gtu.plan.operational.Segment.distance (137): Duration is beyond duration of segment.

This is an issue where the given duration is barely beyond the duration of the plan, due to double precision issues.

WJSchakel commented 4 months ago

There is now a OperationalPlan.fixDoublePrecision() method to check double precision issues for duration in segment times. It is used twice for speed or distance within the segment.