Class DefaultConflictRule
- java.lang.Object
-
- org.opentrafficsim.road.network.lane.conflict.DefaultConflictRule
-
- All Implemented Interfaces:
ConflictRule
public class DefaultConflictRule extends java.lang.Object implements ConflictRule
Default determination of priority based on link priority, or right-hand traffic. Note that this class is stateful as the priorities are cached. So each conflict pair should receive a separateDefaultConflictRule. This rule is only for use on merge and crossing conflicts. For split conflicts there is a separate ruleSplitConflictRule.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 26 jan. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description DefaultConflictRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConflictRuleclone(SimulatorInterface.TimeDoubleUnit newSimulator)Creates a clone of the conflict rule.ConflictPrioritydeterminePriority(Conflict conflict)Determines the priority for the given conflict.java.lang.StringtoString()
-
-
-
Method Detail
-
determinePriority
public ConflictPriority determinePriority(Conflict conflict)
Determines the priority for the given conflict.- Specified by:
determinePriorityin interfaceConflictRule- Parameters:
conflict- Conflict; conflict- Returns:
- priority for the given conflict
-
clone
public final ConflictRule clone(SimulatorInterface.TimeDoubleUnit newSimulator)
Creates a clone of the conflict rule.- Specified by:
clonein interfaceConflictRule- Parameters:
newSimulator- SimulatorInterface.TimeDoubleUnit; new simulator- Returns:
- clone of the conflict rule
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-