IDMPlus.java

  1. package org.opentrafficsim.road.gtu.lane.tactical.following;

  2. import java.util.SortedMap;

  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.core.gtu.behavioralcharacteristics.BehavioralCharacteristics;
  8. import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException;
  9. import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterTypes;

  10. /**
  11.  * Implementation of the IDM+. See Schakel, W.J., Knoop, V.L., and Van Arem, B. (2012), <a
  12.  * href="http://victorknoop.eu/research/papers/TRB2012_LMRS_reviewed.pdf">LMRS: Integrated Lane Change Model with Relaxation and
  13.  * Synchronization</a>, Transportation Research Records: Journal of the Transportation Research Board, No. 2316, pp. 47-57. Note
  14.  * in the official versions of TRB and TRR some errors appeared due to the typesetting of the papers (not in the preprint
  15.  * provided here). A list of errata for the official versions is found <a
  16.  * href="http://victorknoop.eu/research/papers/Erratum_LMRS.pdf">here</a>.
  17.  * <p>
  18.  * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  19.  * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  20.  * </p>
  21.  * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
  22.  * initial version 5 apr. 2016 <br>
  23.  * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
  24.  */
  25. public class IDMPlus extends AbstractIDM
  26. {

  27.     /** {@inheritDoc} */
  28.     @Override
  29.     public final String getName()
  30.     {
  31.         return "IDM+";
  32.     }

  33.     /** {@inheritDoc} */
  34.     @Override
  35.     public final String getLongName()
  36.     {
  37.         return "Intelligent Driver Model+";
  38.     }
  39.    
  40.     /** {@inheritDoc} */
  41.     @Override
  42.     protected final Acceleration combineInteractionTerm(final Acceleration aFree,
  43.         final BehavioralCharacteristics behavioralCharacteristics, final Speed speed, final Speed desiredSpeed,
  44.         final Length desiredHeadway, final SortedMap<Length, Speed> leaders) throws ParameterException
  45.     {
  46.         Acceleration a = behavioralCharacteristics.getParameter(ParameterTypes.A);
  47.         double sRatio =
  48.             dynamicDesiredHeadway(behavioralCharacteristics, speed, desiredHeadway, leaders.get(leaders.firstKey())).si
  49.                 / leaders.firstKey().si;
  50.         double aInt = a.si * (1 - sRatio * sRatio);
  51.         return new Acceleration(aInt < aFree.si ? aInt : aFree.si, AccelerationUnit.SI);
  52.     }

  53. }