averbraeck / opentrafficsim

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

SinkDetector id more concise and consistent #90

Open WJSchakel opened 9 months ago

WJSchakel commented 9 months ago

The id of a SinkDetector is defined as "SINK@" + lane.getFullId() + "." + position. This creates a full id as: Link 1.Lane 1.SINK@Link 1.Lane 1.50.0000000 m. This can be shorter by omitting the lane.getFullId().

Note that depending on the Locale this may also be Link 1.Lane 1.SINK@Link 1.Lane 1.50,0000000 m. We need consistency in the id, so it should not depend on the Locale.

@averbraeck should we solve the Locale consistency in DJUNITS, or only at the OTS side? I can image in DJUNITS we make a toString(Locale) method.

WJSchakel commented 9 months ago

The id is (for) now defined as: String.format(Locale.US, "Sink@%.3fm", position.si).