View Javadoc
1   package org.opentrafficsim.road.gtu.lane.tactical.following;
2   
3   import org.djunits.unit.AccelerationUnit;
4   import org.djunits.value.vdouble.scalar.Acceleration;
5   import org.djunits.value.vdouble.scalar.Length;
6   import org.djunits.value.vdouble.scalar.Speed;
7   import org.opentrafficsim.base.parameters.ParameterException;
8   import org.opentrafficsim.base.parameters.Parameters;
9   import org.opentrafficsim.road.gtu.lane.perception.PerceptionIterable;
10  import org.opentrafficsim.road.gtu.lane.perception.headway.Headway;
11  
12  /**
13   * Implementation of the IDM+. See Schakel, W.J., Knoop, V.L., and Van Arem, B. (2012),
14   * <a href="http://victorknoop.eu/research/papers/TRB2012_LMRS_reviewed.pdf">LMRS: Integrated Lane Change Model with Relaxation
15   * and Synchronization</a>, Transportation Research Records: Journal of the Transportation Research Board, No. 2316, pp. 47-57.
16   * Note in the official versions of TRB and TRR some errors appeared due to the typesetting of the papers (not in the preprint
17   * provided here). A list of errata for the official versions is found
18   * <a href="http://victorknoop.eu/research/papers/Erratum_LMRS.pdf">here</a>.
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/wjschakel">Wouter Schakel</a>
24   */
25  public class IdmPlus extends AbstractIdm
26  {
27  
28      /**
29       * Default constructor using default models for desired headway and desired speed.
30       */
31      public IdmPlus()
32      {
33          super(HEADWAY, DESIRED_SPEED);
34      }
35  
36      /**
37       * Constructor with modular models for desired headway and desired speed.
38       * @param desiredHeadwayModel DesiredHeadwayModel; desired headway model
39       * @param desiredSpeedModel DesiredSpeedModel; desired speed model
40       */
41      public IdmPlus(final DesiredHeadwayModel desiredHeadwayModel, final DesiredSpeedModel desiredSpeedModel)
42      {
43          super(desiredHeadwayModel, desiredSpeedModel);
44      }
45  
46      /** {@inheritDoc} */
47      @Override
48      public final String getName()
49      {
50          return "IDM+";
51      }
52  
53      /** {@inheritDoc} */
54      @Override
55      public final String getLongName()
56      {
57          return "Intelligent Driver Model+";
58      }
59  
60      /** {@inheritDoc} */
61      @Override
62      protected final Acceleration combineInteractionTerm(final Acceleration aFree, final Parameters parameters,
63              final Speed speed, final Speed desiredSpeed, final Length desiredHeadway,
64              final PerceptionIterable<? extends Headway> leaders) throws ParameterException
65      {
66          Acceleration a = parameters.getParameter(A);
67          Headway leader = leaders.first();
68          double sRatio =
69                  dynamicDesiredHeadway(parameters, speed, desiredHeadway, leader.getSpeed()).si / leader.getDistance().si;
70          double aInt = a.si * (1 - sRatio * sRatio);
71          return new Acceleration(aInt < aFree.si ? aInt : aFree.si, AccelerationUnit.SI);
72      }
73  
74  }