ConflictPriority.java

  1. package org.opentrafficsim.road.network.lane.conflict;

  2. /**
  3.  * Priority of conflict. This tells a GTU how to respond to the conflict. Whether a GTU has priority or not may come from any
  4.  * conflict rule. This only represents the resulting priority.
  5.  * <p>
  6.  * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  7.  * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  8.  * </p>
  9.  * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
  10.  * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
  11.  * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
  12.  */
  13. public enum ConflictPriority
  14. {
  15.     /** Have priority. */
  16.     PRIORITY,

  17.     /** Yield. */
  18.     YIELD,

  19.     /** Stop and give priority. */
  20.     STOP,

  21.     /** All-way stop. */
  22.     ALL_STOP,

  23.     /** Split. */
  24.     SPLIT;

  25.     /**
  26.      * Returns whether this is a priority conflict.
  27.      * @return whether this is a priority conflict
  28.      */
  29.     public final boolean isPriority()
  30.     {
  31.         return this.equals(PRIORITY);
  32.     }

  33.     /**
  34.      * Returns whether this is a give-way conflict.
  35.      * @return whether this is a give-way conflict
  36.      */
  37.     public final boolean isGiveWay()
  38.     {
  39.         return this.equals(YIELD);
  40.     }

  41.     /**
  42.      * Returns whether this is a stop conflict.
  43.      * @return whether this is a stop conflict
  44.      */
  45.     public final boolean isStop()
  46.     {
  47.         return this.equals(STOP);
  48.     }

  49.     /**
  50.      * Returns whether this is an all-stop conflict.
  51.      * @return whether this is an all-stop conflict
  52.      */
  53.     public final boolean isAllStop()
  54.     {
  55.         return this.equals(ALL_STOP);
  56.     }

  57.     /**
  58.      * Returns whether this is a stop conflict.
  59.      * @return whether this is a stop conflict
  60.      */
  61.     public final boolean isSplit()
  62.     {
  63.         return this.equals(SPLIT);
  64.     }

  65. }