View Javadoc
1   package org.opentrafficsim.core.gtu;
2   
3   import java.io.Serializable;
4   
5   import org.djunits.value.vdouble.scalar.Acceleration;
6   import org.djunits.value.vdouble.scalar.Length;
7   import org.djunits.value.vdouble.scalar.Speed;
8   
9   /**
10   * Characteristics of a GTU. This class is used to store all characteristics of a (not-yet constructed) GTU.
11   * <p>
12   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
14   * </p>
15   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
16   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
17   */
18  public class GtuCharacteristics implements Serializable
19  {
20  
21      /** */
22      private static final long serialVersionUID = 20160000L;
23  
24      /** The type of the GTU. */
25      private final GtuType gtuType;
26  
27      /** Length of the GTU. */
28      private final Length length;
29  
30      /** Width of the GTU. */
31      private final Length width;
32  
33      /** Maximum speed of the GTU. */
34      private final Speed maximumSpeed;
35  
36      /** Maximum acceleration. */
37      private final Acceleration maximumAcceleration;
38  
39      /** Maximum deceleration. */
40      private final Acceleration maximumDeceleration;
41  
42      /** Front position relative to the reference position. */
43      private final Length front;
44  
45      /**
46       * Construct a new set of GtuCharacteristics.
47       * @param gtuType GtuType; type of the (not yet constructed) GTU
48       * @param length Length; the length of the (non yet constructed) GTU
49       * @param width Length; the width of the (non yet constructed) GTU
50       * @param maximumSpeed Speed; the maximum speed of the (non yet constructed) GTU
51       * @param maximumAcceleration Acceleration; maximum acceleration
52       * @param maximumDeceleration Acceleration; maximum deceleration
53       * @param front Length; front position relative to the reference position
54       */
55      public GtuCharacteristics(final GtuType gtuType, final Length length, final Length width, final Speed maximumSpeed,
56              final Acceleration maximumAcceleration, final Acceleration maximumDeceleration, final Length front)
57      {
58          this.gtuType = gtuType;
59          this.length = length;
60          this.width = width;
61          this.maximumSpeed = maximumSpeed;
62          this.maximumAcceleration = maximumAcceleration;
63          this.maximumDeceleration = maximumDeceleration;
64          this.front = front;
65      }
66  
67      /**
68       * Retrieve the GTU type.
69       * @return GtuType
70       */
71      public final GtuType getGtuType()
72      {
73          return this.gtuType;
74      }
75  
76      /**
77       * Retrieve the length.
78       * @return Length
79       */
80      public final Length getLength()
81      {
82          return this.length;
83      }
84  
85      /**
86       * Retrieve the width.
87       * @return Length
88       */
89      public final Length getWidth()
90      {
91          return this.width;
92      }
93  
94      /**
95       * Retrieve the maximum speed.
96       * @return Speed
97       */
98      public final Speed getMaximumSpeed()
99      {
100         return this.maximumSpeed;
101     }
102 
103     /**
104      * Retrieve the maximum acceleration.
105      * @return Acceleration
106      */
107     public final Acceleration getMaximumAcceleration()
108     {
109         return this.maximumAcceleration;
110     }
111 
112     /**
113      * Retrieve the maximum deceleration.
114      * @return Acceleration
115      */
116     public final Acceleration getMaximumDeceleration()
117     {
118         return this.maximumDeceleration;
119     }
120 
121     /**
122      * Retrieve the front position relative to the reference position.
123      * @return Length
124      */
125     public final Length getFront()
126     {
127         return this.front;
128     }
129 
130     /** {@inheritDoc} */
131     @Override
132     public String toString()
133     {
134         return "GtuCharacteristics [gtuType=" + this.gtuType + ", length=" + this.length + ", width=" + this.width
135                 + ", maximumSpeed=" + this.maximumSpeed + ", maximumAcceleration=" + this.maximumAcceleration
136                 + ", maximumDeceleration=" + this.maximumDeceleration + ", front=" + this.front + "]";
137     }
138 
139 }