1 package org.opentrafficsim.swing.script;
2
3 import org.djunits.value.vdouble.scalar.Acceleration;
4 import org.djunits.value.vdouble.scalar.Duration;
5
6 import picocli.CommandLine.Option;
7
8 /**
9 * Class containing a set of command line options for the intelligent driver model (IDM). To integrate in a program, give the
10 * program the following property:
11 *
12 * <pre>
13 * {@code @}ArgGroup
14 * private IdmOptions idmOptions = new IdmOptions();
15 * </pre>
16 *
17 * Note that the variable initiation is only required if default values are changed using
18 * {@code CliUtil.changeOptionDefault(...)}.
19 * <p>
20 * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
21 * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
22 * </p>
23 * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
24 * @author <a href="https://github.com/peter-knoppers">Peter Knoppers</a>
25 * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
26 */
27 public class IdmOptions
28 {
29
30 /** Maximum acceleration of cars. */
31 @Option(names = "--aCar", description = "Maximum acceleration of cars.", defaultValue = "1.25m/s^2")
32 private Acceleration aCar;
33
34 /** Maximum acceleration of trucks. */
35 @Option(names = "--aTruck", description = "Maximum acceleration of trucks.", defaultValue = "0.4m/s^2")
36 private Acceleration aTruck;
37
38 /** Maximum comfortable deceleration. */
39 @Option(names = "--maxDecel", description = "Maximum comfortable deceleration.", defaultValue = "2.09m/s^2")
40 private Acceleration b;
41
42 /** Minimum desired headway. */
43 @Option(names = "--Tmin", description = "Minimum desired headway.", defaultValue = "0.56s")
44 private Duration tMin;
45
46 /** Normal desired headway. */
47 @Option(names = "--Tmax", description = "Normal desired headway.", defaultValue = "1.2s")
48 private Duration tMax;
49
50 /**
51 * Constructor.
52 */
53 public IdmOptions()
54 {
55 //
56 }
57
58 /**
59 * Returns the maximum acceleration of cars.
60 * @return maximum acceleration of cars
61 */
62 public Acceleration getACar()
63 {
64 return this.aCar;
65 }
66
67 /**
68 * Returns the maximum acceleration of trucks.
69 * @return maximum acceleration of truck
70 */
71 public Acceleration getATruck()
72 {
73 return this.aTruck;
74 }
75
76 /**
77 * Returns the maximum comfortable deceleration.
78 * @return maximum comfortable deceleration
79 */
80 public Acceleration getB()
81 {
82 return this.b;
83 }
84
85 /**
86 * Returns the minimum desired headway.
87 * @return minimum desired headway
88 */
89 public Duration getTMin()
90 {
91 return this.tMin;
92 }
93
94 /**
95 * Returns the normal desired headway.
96 * @return normal desired headway
97 */
98 public Duration getTMax()
99 {
100 return this.tMax;
101 }
102
103 }