1 package org.opentrafficsim.kpi.sampling.data;
2
3 import org.djunits.value.vfloat.scalar.FloatSpeed;
4 import org.opentrafficsim.kpi.interfaces.GtuData;
5
6 /**
7 * Reference speed for trajectories.
8 * <p>
9 * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10 * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
11 * </p>
12 * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
13 * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
14 * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
15 */
16 public class ReferenceSpeed extends ExtendedDataSpeed<GtuData>
17 {
18
19 /** Single instance. */
20 public static final ReferenceSpeed INSTANCE = new ReferenceSpeed();
21
22 /**
23 *
24 */
25 public ReferenceSpeed()
26 {
27 super("referenceSpeed", "Reference speed (minimum of speed limit and maximum vehicle speed)");
28 }
29
30 /** {@inheritDoc} */
31 @Override
32 public final FloatSpeed getValue(final GtuData gtu)
33 {
34 return FloatSpeed.instantiateSI((float) gtu.getReferenceSpeed().si);
35 }
36
37 /** {@inheritDoc} */
38 @Override
39 public final String toString()
40 {
41 return "Reference Speed";
42 }
43
44 }