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://tudelft.nl/staff/p.knoppers-1">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 * Returns the maximum acceleration of cars. 52 * @return Acceleration; maximum acceleration of cars 53 */ 54 public Acceleration getACar() 55 { 56 return this.aCar; 57 } 58 59 /** 60 * Returns the maximum acceleration of trucks. 61 * @return Acceleration; maximum acceleration of truck 62 */ 63 public Acceleration getATruck() 64 { 65 return this.aTruck; 66 } 67 68 /** 69 * Returns the maximum comfortable deceleration. 70 * @return Acceleration; maximum comfortable deceleration 71 */ 72 public Acceleration getB() 73 { 74 return this.b; 75 } 76 77 /** 78 * Returns the minimum desired headway. 79 * @return Duration; minimum desired headway 80 */ 81 public Duration getTMin() 82 { 83 return this.tMin; 84 } 85 86 /** 87 * Returns the normal desired headway. 88 * @return Duration; normal desired headway 89 */ 90 public Duration getTMax() 91 { 92 return this.tMax; 93 } 94 95 }