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-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 8 * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>. 9 * <p> 10 * @version $Revision$, $LastChangedDate$, by $Author$, initial version Jun 2, 2016 <br> 11 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a> 12 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a> 13 * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a> 14 */ 15 public enum ConflictPriority 16 { 17 /** Have priority. */ 18 PRIORITY, 19 20 /** Turn on red. */ 21 TURN_ON_RED, 22 23 /** Yield. */ 24 YIELD, 25 26 /** Stop and give priority. */ 27 STOP, 28 29 /** All-way stop. */ 30 ALL_STOP, 31 32 /** Split. */ 33 SPLIT; 34 35 /** 36 * Returns whether this is a priority conflict. 37 * @return whether this is a priority conflict 38 */ 39 public final boolean isPriority() 40 { 41 return this.equals(PRIORITY); 42 } 43 44 /** 45 * Returns whether this is a turn on red conflict. 46 * @return whether this is a turn on red conflict 47 */ 48 public final boolean isTurnOnRed() 49 { 50 return this.equals(TURN_ON_RED); 51 } 52 53 /** 54 * Returns whether this is a give-way conflict. 55 * @return whether this is a give-way conflict 56 */ 57 public final boolean isGiveWay() 58 { 59 return this.equals(YIELD); 60 } 61 62 /** 63 * Returns whether this is a stop conflict. 64 * @return whether this is a stop conflict 65 */ 66 public final boolean isStop() 67 { 68 return this.equals(STOP); 69 } 70 71 /** 72 * Returns whether this is an all-stop conflict. 73 * @return whether this is an all-stop conflict 74 */ 75 public final boolean isAllStop() 76 { 77 return this.equals(ALL_STOP); 78 } 79 80 /** 81 * Returns whether this is a stop conflict. 82 * @return whether this is a stop conflict 83 */ 84 public final boolean isSplit() 85 { 86 return this.equals(SPLIT); 87 } 88 89 }