View Javadoc
1   package org.opentrafficsim.road.gtu.lane.perception.categories.neighbors;
2   
3   import org.djunits.value.vdouble.scalar.Acceleration;
4   import org.djunits.value.vdouble.scalar.Length;
5   import org.djunits.value.vdouble.scalar.Speed;
6   
7   /**
8    * Results from anticipation.
9    * <p>
10   * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
11   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
12   * <p>
13   * @version $Revision$, $LastChangedDate$, by $Author$, initial version 24 feb. 2017 <br>
14   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
15   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
16   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
17   */
18  public class NeighborTriplet
19  {
20  
21      /** Headway. */
22      private final Length headway;
23  
24      /** Speed. */
25      private final Speed speed;
26  
27      /** Acceleration. */
28      private final Acceleration acceleration;
29  
30      /**
31       * @param headway Length; headway
32       * @param speed Speed; speed
33       * @param acceleration Acceleration; acceleration
34       */
35      public NeighborTriplet(final Length headway, final Speed speed, final Acceleration acceleration)
36      {
37          this.headway = headway;
38          this.speed = speed;
39          this.acceleration = acceleration;
40      }
41  
42      /**
43       * @return headway.
44       */
45      public Length getHeadway()
46      {
47          return this.headway;
48      }
49  
50      /**
51       * @return speed.
52       */
53      public Speed getSpeed()
54      {
55          return this.speed;
56      }
57  
58      /**
59       * @return acceleration.
60       */
61      public Acceleration getAcceleration()
62      {
63          return this.acceleration;
64      }
65  
66      /** {@inheritDoc} */
67      @Override
68      public final String toString()
69      {
70          return "NeighborTriplet [headway=" + this.headway + ", speed=" + this.speed + ", acceleration=" + this.acceleration
71                  + "]";
72      }
73  }