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 Compatible
EVERYTHING
DefaultCompatible
that allows every GTU type in every direction.static Compatible
MINUS
Minus directionCompatible
that allows all GTU types in the minus direction.static Compatible
PLUS
Plus directionCompatible
that allows all GTU types in the plus direction. -
Method Summary
Modifier and Type Method Description boolean
isCompatible(GTUType gtuType, GTUDirectionality directionality)
Test if a GTUType is handled by the infrastructure in the given direction.
-
Field Details
-
EVERYTHING
DefaultCompatible
that allows every GTU type in every direction. -
PLUS
Plus directionCompatible
that allows all GTU types in the plus direction. -
MINUS
Minus directionCompatible
that 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
-