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-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  8.  * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  9.  * </p>
  10.  * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
  11.  */
  12. public class Egoistic extends AbstractLaneChangeModel
  13. {
  14.     /** {@inheritDoc} */
  15.     @Override
  16.     public final Acceleration applyDriverPersonality(final DualAccelerationStep accelerations)
  17.     {
  18.         // The egoistic driver only looks at the effects on him-/herself.
  19.         return accelerations.getLeaderAcceleration();
  20.     }

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

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

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

  39. }