public class LaneType extends HierarchicalType<LaneType> implements Serializable, Compatibility<GTUType,LaneType>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-08-30 00:16:51 +0200 (Sun, 30 Aug 2015) $, @version $Revision: 1329 $, by $Author: averbraeck $,
initial version Aug 21, 2014
| Modifier and Type | Class and Description |
|---|---|
static class |
LaneType.DEFAULTS
Default types with their name.
|
| Constructor and Description |
|---|
LaneType(String id,
GTUCompatibility<LaneType> compatibility,
RoadNetwork network)
Create a new Lane type with a compatibility set.
|
LaneType(String id,
LaneType parent,
GTUCompatibility<LaneType> compatibility,
RoadNetwork network)
Create a new Lane type with a compatibility set.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGtuCompatability(GTUType gtuType,
LongitudinalDirectionality direction)
Add GTU type to compatibility.
|
boolean |
equals(Object obj) |
GTUCompatibility<LaneType> |
getCompatibility() |
LongitudinalDirectionality |
getDirectionality(GTUType gtuType)
Get the permitted driving directions for a given GTU type on this Lane.
|
LongitudinalDirectionality |
getDirectionality(GTUType gtuType,
boolean tryParentsOfGTUType) |
RoadNetwork |
getNetwork() |
int |
hashCode() |
LaneType |
inv()
Construct a new Lane type based on another Lane type with longitudinally inverted compatibility.
|
Boolean |
isCompatible(GTUType gtuType,
GTUDirectionality direction)
Compatibility is solely determined by a specific lane type, and independent of compatibility in super or sub types.
|
boolean |
isOfType(LaneType.DEFAULTS type)
Whether this, or any of the parent types, equals the given type.
|
String |
toString() |
commonAncestor, getId, getParent, isOfTypepublic LaneType(String id, GTUCompatibility<LaneType> compatibility, RoadNetwork network) throws NullPointerException
id - String; the id of the lane type.compatibility - GTUCompatibility<LaneType>; the collection of compatible GTUTypes for this LaneType.
Compatibility is solely determined by a specific lane type, and independent of compatibility in super or sub
types.network - RoadNetwork; The network to which the LaneType belongsNullPointerException - if either the id is null, or the compatibilitySet is nullpublic LaneType(String id, LaneType parent, GTUCompatibility<LaneType> compatibility, RoadNetwork network) throws NullPointerException
id - String; the id of the lane type.parent - LaneType; parent typecompatibility - GTUCompatibility<LaneType>; the collection of compatible GTUTypes for this LaneType.
Compatibility is solely determined by a specific lane type, and independent of compatibility in super or sub
types.network - RoadNetwork; The network to which the LaneType belongsNullPointerException - if either the id is null, or the compatibilitySet is nullpublic boolean isOfType(LaneType.DEFAULTS type)
type - DEFAULTS; typepublic final LaneType inv()
public GTUCompatibility<LaneType> getCompatibility()
public RoadNetwork getNetwork()
public final Boolean isCompatible(GTUType gtuType, GTUDirectionality direction)
isCompatible in interface Compatibility<GTUType,LaneType>gtuType - GTUType; GTU type to look for compatibility.direction - GTUDirectionality; the direction that the GTU is moving (with respect to the direction of the design
line of the Link)public final LongitudinalDirectionality getDirectionality(GTUType gtuType)
gtuType - GTUType; the GTU typepublic final void addGtuCompatability(GTUType gtuType, LongitudinalDirectionality direction)
gtuType - GTUType; the GTU type to adddirection - LongitudinalDirectionality; permitted direction of movementpublic int hashCode()
hashCode in class HierarchicalType<LaneType>public boolean equals(Object obj)
equals in class HierarchicalType<LaneType>public final LongitudinalDirectionality getDirectionality(GTUType gtuType, boolean tryParentsOfGTUType)
getDirectionality in interface Compatibility<GTUType,LaneType>Copyright © 2014–2019 Delft University of Technology. All rights reserved.