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-2023 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://dittlab.tudelft.nl">Wouter Schakel</a>
13   */
14  public enum ConflictPriority
15  {
16      /** Have priority. */
17      PRIORITY,
18  
19      /** Turn on red. */
20      TURN_ON_RED,
21  
22      /** Yield. */
23      YIELD,
24  
25      /** Stop and give priority. */
26      STOP,
27  
28      /** All-way stop. */
29      ALL_STOP,
30  
31      /** Split. */
32      SPLIT;
33  
34      /**
35       * Returns whether this is a priority conflict.
36       * @return whether this is a priority conflict
37       */
38      public final boolean isPriority()
39      {
40          return this.equals(PRIORITY);
41      }
42  
43      /**
44       * Returns whether this is a turn on red conflict.
45       * @return whether this is a turn on red conflict
46       */
47      public final boolean isTurnOnRed()
48      {
49          return this.equals(TURN_ON_RED);
50      }
51  
52      /**
53       * Returns whether this is a give-way conflict.
54       * @return whether this is a give-way conflict
55       */
56      public final boolean isGiveWay()
57      {
58          return this.equals(YIELD);
59      }
60  
61      /**
62       * Returns whether this is a stop conflict.
63       * @return whether this is a stop conflict
64       */
65      public final boolean isStop()
66      {
67          return this.equals(STOP);
68      }
69  
70      /**
71       * Returns whether this is an all-stop conflict.
72       * @return whether this is an all-stop conflict
73       */
74      public final boolean isAllStop()
75      {
76          return this.equals(ALL_STOP);
77      }
78  
79      /**
80       * Returns whether this is a stop conflict.
81       * @return whether this is a stop conflict
82       */
83      public final boolean isSplit()
84      {
85          return this.equals(SPLIT);
86      }
87  
88  }