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-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
14   * <p>
15   * @version $Revision$, $LastChangedDate$, by $Author$, initial version Mar 8, 2016 <br>
16   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
17   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
18   */
19  public class GTUCharacteristics implements Serializable
20  {
21  
22      /** */
23      private static final long serialVersionUID = 20160000L;
24  
25      /** The type of the GTU. */
26      private final GTUType gtuType;
27  
28      /** Length of the GTU. */
29      private final Length length;
30  
31      /** Width of the GTU. */
32      private final Length width;
33  
34      /** Maximum speed of the GTU. */
35      private final Speed maximumSpeed;
36  
37      /** Maximum acceleration. */
38      private final Acceleration maximumAcceleration;
39  
40      /** Maximum deceleration. */
41      private final Acceleration maximumDeceleration;
42  
43      /** Front position relative to the reference position. */
44      private final Length front;
45  
46      /**
47       * Construct a new set of GTUCharacteristics.
48       * @param gtuType GTUType; type of the (not yet constructed) GTU
49       * @param length Length; the length of the (non yet constructed) GTU
50       * @param width Length; the width of the (non yet constructed) GTU
51       * @param maximumSpeed Length; the maximum speed of the (non yet constructed) GTU
52       * @param maximumAcceleration Acceleration; maximum acceleration
53       * @param maximumDeceleration Acceleration; maximum deceleration
54       * @param front Length; front position relative to the reference position
55       */
56      public GTUCharacteristics(final GTUType gtuType, final Length length, final Length width, final Speed maximumSpeed,
57              final Acceleration maximumAcceleration, final Acceleration maximumDeceleration, final Length front)
58      {
59          this.gtuType = gtuType;
60          this.length = length;
61          this.width = width;
62          this.maximumSpeed = maximumSpeed;
63          this.maximumAcceleration = maximumAcceleration;
64          this.maximumDeceleration = maximumDeceleration;
65          this.front = front;
66      }
67  
68      /**
69       * Retrieve the GTU type.
70       * @return GTUType
71       */
72      public final GTUType getGTUType()
73      {
74          return this.gtuType;
75      }
76  
77      /**
78       * Retrieve the length.
79       * @return Length
80       */
81      public final Length getLength()
82      {
83          return this.length;
84      }
85  
86      /**
87       * Retrieve the width.
88       * @return Length
89       */
90      public final Length getWidth()
91      {
92          return this.width;
93      }
94  
95      /**
96       * Retrieve the maximum speed.
97       * @return Speed
98       */
99      public final Speed getMaximumSpeed()
100     {
101         return this.maximumSpeed;
102     }
103 
104     /**
105      * Retrieve the maximum acceleration.
106      * @return Acceleration
107      */
108     public final Acceleration getMaximumAcceleration()
109     {
110         return this.maximumAcceleration;
111     }
112 
113     /**
114      * Retrieve the maximum deceleration.
115      * @return Acceleration
116      */
117     public final Acceleration getMaximumDeceleration()
118     {
119         return this.maximumDeceleration;
120     }
121 
122     /**
123      * Retrieve the front position relative to the reference position.
124      * @return Length
125      */
126     public final Length getFront()
127     {
128         return this.front;
129     }
130 
131     /** {@inheritDoc} */
132     @Override
133     public String toString()
134     {
135         return "GTUCharacteristics [gtuType=" + this.gtuType + ", length=" + this.length + ", width=" + this.width
136                 + ", maximumSpeed=" + this.maximumSpeed + ", maximumAcceleration=" + this.maximumAcceleration
137                 + ", maximumDeceleration=" + this.maximumDeceleration + ", front=" + this.front + "]";
138     }
139 
140 }