Interface Compatible
-
public interface CompatibleInterface for infrastructure types to assess traversability by GTU types.Copyright (c) 2013-2022 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisCompatible(GTUType gtuType, GTUDirectionality directionality)Test if a GTUType is handled by the infrastructure in the given direction.
-
-
-
Field Detail
-
EVERYTHING
static final Compatible EVERYTHING
DefaultCompatiblethat allows every GTU type in every direction.
-
PLUS
static final Compatible PLUS
Plus directionCompatiblethat allows all GTU types in the plus direction.
-
MINUS
static final Compatible MINUS
Minus directionCompatiblethat allows all GTU types in the minus direction.
-
-
Method Detail
-
isCompatible
boolean isCompatible(GTUType gtuType, GTUDirectionality directionality)
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
-
-