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, as defined by the used GtuData.
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://github.com/peter-knoppers">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 * Constructor.
24 */
25 public ReferenceSpeed()
26 {
27 super("referenceSpeed", "Reference speed");
28 }
29
30 @Override
31 public final FloatSpeed getValue(final GtuData gtu)
32 {
33 return FloatSpeed.instantiateSI((float) gtu.getReferenceSpeed().si);
34 }
35
36 @Override
37 public final String toString()
38 {
39 return "Reference Speed";
40 }
41
42 }