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-2019 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/docs/license.html">OpenTrafficSim License</a>.
22   * </p>
23   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
24   * initial version 5 apr. 2016 <br>
25   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
26   */
27  public class IDMPlus extends AbstractIDM
28  {
29  
30      /**
31       * Default constructor using default models for desired headway and desired speed.
32       */
33      public IDMPlus()
34      {
35          super(HEADWAY, DESIRED_SPEED);
36      }
37  
38      /**
39       * Constructor with modular models for desired headway and desired speed.
40       * @param desiredHeadwayModel DesiredHeadwayModel; desired headway model
41       * @param desiredSpeedModel DesiredSpeedModel; desired speed model
42       */
43      public IDMPlus(final DesiredHeadwayModel desiredHeadwayModel, final DesiredSpeedModel desiredSpeedModel)
44      {
45          super(desiredHeadwayModel, desiredSpeedModel);
46      }
47  
48      /** {@inheritDoc} */
49      @Override
50      public final String getName()
51      {
52          return "IDM+";
53      }
54  
55      /** {@inheritDoc} */
56      @Override
57      public final String getLongName()
58      {
59          return "Intelligent Driver Model+";
60      }
61  
62      /** {@inheritDoc} */
63      @Override
64      protected final Acceleration combineInteractionTerm(final Acceleration aFree, final Parameters parameters,
65              final Speed speed, final Speed desiredSpeed, final Length desiredHeadway,
66              final PerceptionIterable<? extends Headway> leaders) throws ParameterException
67      {
68          Acceleration a = parameters.getParameter(A);
69          Headway leader = leaders.first();
70          double sRatio =
71                  dynamicDesiredHeadway(parameters, speed, desiredHeadway, leader.getSpeed()).si / leader.getDistance().si;
72          double aInt = a.si * (1 - sRatio * sRatio);
73          return new Acceleration(aInt < aFree.si ? aInt : aFree.si, AccelerationUnit.SI);
74      }
75  
76  }