LmrsSwitchableColorer.java

  1. package org.opentrafficsim.road.gtu.colorer;

  2. import java.awt.Color;

  3. import org.djunits.unit.SpeedUnit;
  4. import org.djunits.value.vdouble.scalar.Acceleration;
  5. import org.djunits.value.vdouble.scalar.Speed;
  6. import org.opentrafficsim.core.animation.gtu.colorer.AccelerationGTUColorer;
  7. import org.opentrafficsim.core.animation.gtu.colorer.IDGTUColorer;
  8. import org.opentrafficsim.core.animation.gtu.colorer.SpeedGTUColorer;
  9. import org.opentrafficsim.core.animation.gtu.colorer.SwitchableGTUColorer;
  10. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveBusStop;
  11. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveCourtesy;
  12. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveGetInLane;
  13. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveKeep;
  14. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveRoute;
  15. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveSocioSpeed;
  16. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveSpeed;
  17. import org.opentrafficsim.road.gtu.lane.tactical.lmrs.IncentiveSpeedWithCourtesy;

  18. /**
  19.  * Colorer for LMRS.
  20.  * <p>
  21.  * Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  22.  * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
  23.  * <p>
  24.  * @version $Revision$, $LastChangedDate$, by $Author$, initial version 14 apr. 2017 <br>
  25.  * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
  26.  * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
  27.  * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
  28.  */
  29. public class LmrsSwitchableColorer extends SwitchableGTUColorer
  30. {

  31.     /** */
  32.     private static final long serialVersionUID = 20170414L;

  33.     /**
  34.      * Constructor.
  35.      * @throws IndexOutOfBoundsException initial index out of bounds
  36.      */
  37.     public LmrsSwitchableColorer() throws IndexOutOfBoundsException
  38.     {
  39.         super(0, new FixedColor(Color.BLUE, "Blue"), GTUTypeColorer.DEFAULT, new IDGTUColorer(),
  40.                 new SpeedGTUColorer(new Speed(150, SpeedUnit.KM_PER_HOUR)),
  41.                 new DesiredSpeedColorer(new Speed(50, SpeedUnit.KM_PER_HOUR), new Speed(150, SpeedUnit.KM_PER_HOUR)),
  42.                 new AccelerationGTUColorer(Acceleration.instantiateSI(-6.0), Acceleration.instantiateSI(2)), new SplitColorer(),
  43.                 new SynchronizationColorer(), new DesiredHeadwayColorer(), new TotalDesireColorer(),
  44.                 new IncentiveColorer(IncentiveRoute.class), new IncentiveColorer(IncentiveSpeedWithCourtesy.class),
  45.                 new IncentiveColorer(IncentiveSpeed.class), new IncentiveColorer(IncentiveKeep.class),
  46.                 new IncentiveColorer(IncentiveGetInLane.class), new IncentiveColorer(IncentiveCourtesy.class),
  47.                 new IncentiveColorer(IncentiveSocioSpeed.class), new IncentiveColorer(IncentiveBusStop.class));
  48.     }

  49. }