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-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 21 * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>. 22 * <p> 23 * @version $Revision$, $LastChangedDate$, by $Author$, initial version 22 aug. 2019 <br> 24 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a> 25 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a> 26 * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a> 27 */ 28 public class IdmOptions 29 { 30 31 /** Maximum acceleration of cars. */ 32 @Option(names = "--aCar", description = "Maximum acceleration of cars.", defaultValue = "1.25m/s^2") 33 private Acceleration aCar; 34 35 /** Maximum acceleration of trucks. */ 36 @Option(names = "--aTruck", description = "Maximum acceleration of trucks.", defaultValue = "0.4m/s^2") 37 private Acceleration aTruck; 38 39 /** Maximum comfortable deceleration. */ 40 @Option(names = "--maxDecel", description = "Maximum comfortable deceleration.", defaultValue = "2.09m/s^2") 41 private Acceleration b; 42 43 /** Minimum desired headway. */ 44 @Option(names = "--Tmin", description = "Minimum desired headway.", defaultValue = "0.56s") 45 private Duration tMin; 46 47 /** Normal desired headway. */ 48 @Option(names = "--Tmax", description = "Normal desired headway.", defaultValue = "1.2s") 49 private Duration tMax; 50 51 /** 52 * Returns the maximum acceleration of cars. 53 * @return Acceleration; maximum acceleration of cars 54 */ 55 public Acceleration getACar() 56 { 57 return this.aCar; 58 } 59 60 /** 61 * Returns the maximum acceleration of trucks. 62 * @return Acceleration; maximum acceleration of truck 63 */ 64 public Acceleration getATruck() 65 { 66 return this.aTruck; 67 } 68 69 /** 70 * Returns the maximum comfortable deceleration. 71 * @return Acceleration; maximum comfortable deceleration 72 */ 73 public Acceleration getB() 74 { 75 return this.b; 76 } 77 78 /** 79 * Returns the minimum desired headway. 80 * @return Duration; minimum desired headway 81 */ 82 public Duration getTMin() 83 { 84 return this.tMin; 85 } 86 87 /** 88 * Returns the normal desired headway. 89 * @return Duration; normal desired headway 90 */ 91 public Duration getTMax() 92 { 93 return this.tMax; 94 } 95 96 }