View Javadoc
1   package org.opentrafficsim.road.network.lane.conflict;
2   
3   /**
4    * Priority of conflict. This tells a GTU how to respond to the conflict. Whether a GTU has priority or not may come from any
5    * conflict rule. This only represents the resulting priority.
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://github.com/averbraeck">Alexander Verbraeck</a>
11   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
12   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
13   */
14  public enum ConflictPriority
15  {
16      /** Have priority. */
17      PRIORITY,
18  
19      /** Yield. */
20      YIELD,
21  
22      /** Stop and give priority. */
23      STOP,
24  
25      /** All-way stop. */
26      ALL_STOP,
27  
28      /** Split. */
29      SPLIT;
30  
31      /**
32       * Returns whether this is a priority conflict.
33       * @return whether this is a priority conflict
34       */
35      public final boolean isPriority()
36      {
37          return this.equals(PRIORITY);
38      }
39  
40      /**
41       * Returns whether this is a give-way conflict.
42       * @return whether this is a give-way conflict
43       */
44      public final boolean isGiveWay()
45      {
46          return this.equals(YIELD);
47      }
48  
49      /**
50       * Returns whether this is a stop conflict.
51       * @return whether this is a stop conflict
52       */
53      public final boolean isStop()
54      {
55          return this.equals(STOP);
56      }
57  
58      /**
59       * Returns whether this is an all-stop conflict.
60       * @return whether this is an all-stop conflict
61       */
62      public final boolean isAllStop()
63      {
64          return this.equals(ALL_STOP);
65      }
66  
67      /**
68       * Returns whether this is a stop conflict.
69       * @return whether this is a stop conflict
70       */
71      public final boolean isSplit()
72      {
73          return this.equals(SPLIT);
74      }
75  
76  }