Interface Compatible
public interface Compatible
Interface for infrastructure types to assess traversability by GTU types.
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 Aug 25, 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Field Summary
Fields Modifier and Type Field Description static CompatibleEVERYTHINGDefaultCompatiblethat allows every GTU type in every direction.static CompatibleMINUSMinus directionCompatiblethat allows all GTU types in the minus direction.static CompatiblePLUSPlus directionCompatiblethat allows all GTU types in the plus direction. -
Method Summary
Modifier and Type Method Description booleanisCompatible(GTUType gtuType, GTUDirectionality directionality)Test if a GTUType is handled by the infrastructure in the given direction.
-
Field Details
-
EVERYTHING
DefaultCompatiblethat allows every GTU type in every direction. -
PLUS
Plus directionCompatiblethat allows all GTU types in the plus direction. -
MINUS
Minus directionCompatiblethat allows all GTU types in the minus direction.
-
-
Method Details
-
isCompatible
Test if a GTUType is handled by the infrastructure in the given direction. For Lane and Link, handled means that GTUs of this type can travel over this infrastructure in the direction. For Sensors it means that the sensor will detect GTUs that travel over it in the given direction.- Parameters:
gtuType- GTUType; the type of the GTUdirectionality- GTUDirectionality; the direction of the GTU with respect to the design direction of the infrastructure- Returns:
- boolean; true if the GTU is handled by the infrastructure in the given direction
-