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