Egoistic.java

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

  2. import org.djunits.value.vdouble.scalar.Acceleration;
  3. import org.opentrafficsim.road.gtu.lane.tactical.following.DualAccelerationStep;

  4. /**
  5.  * The egoistic drive changes lane when this yields is personal advantage (totally ignoring any disadvantage to others).
  6.  * <p>
  7.  * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  8.  * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  9.  * <p>
  10.  * @version $Revision: 1375 $, $LastChangedDate: 2015-09-03 03:32:20 +0200 (Thu, 03 Sep 2015) $, by $Author: averbraeck $,
  11.  *          initial version Sep 19, 2014 <br>
  12.  * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
  13.  */
  14. public final class Egoistic extends AbstractLaneChangeModel
  15. {

  16.     /** {@inheritDoc} */
  17.     @Override
  18.     public Acceleration applyDriverPersonality(final DualAccelerationStep accelerations)
  19.     {
  20.         // The egoistic driver only looks at the effects on him-/herself.
  21.         return accelerations.getLeaderAcceleration();
  22.     }

  23.     /** {@inheritDoc} */
  24.     @Override
  25.     public String getName()
  26.     {
  27.         return "Egoistic";
  28.     }

  29.     /** {@inheritDoc} */
  30.     @Override
  31.     public String getLongName()
  32.     {
  33.         return "Egoistic lane change model (as described by Treiber).";
  34.     }

  35.     /** {@inheritDoc} */
  36.     @Override
  37.     public final String toString()
  38.     {
  39.         return "Egoistic []";
  40.     }

  41. }