public class LinkType extends HierarchicalType<LinkType> implements Serializable, Identifiable, Compatibility<GTUType,LinkType>
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 | Field and Description |
|---|---|
static LinkType |
CONNECTOR
Virtual connection between nodes, e.g.
|
static LinkType |
FREEWAY
One-directional road, accessible to all road GTU types (excluding PEDESTRIAN and BICYCLE).
|
static LinkType |
NONE
The link type that does not allow any vehicles, or pedestrians.
|
static LinkType |
RAILWAY
Two-directional rail link.
|
static LinkType |
ROAD
Two-directional road, accessible to all road GTU types (including PEDESTRIAN).
|
static LinkType |
WATERWAY
Two-directional water way.
|
| Constructor and Description |
|---|
LinkType(String id,
LinkType parent,
GTUCompatibility<LinkType> compatibility)
Create a new Link type with compatibility set.
|
| Modifier and Type | Method and Description |
|---|---|
LongitudinalDirectionality |
getDirectionality(GTUType gtuType,
boolean tryParentsOfGTUType)
Retrieve the allowed driving directions for a GTUType.
|
Boolean |
isCompatible(GTUType gtuType,
GTUDirectionality directionality)
Test if a GTUType can travel over the infrastructure.
|
boolean |
isConnector() |
boolean |
isNone() |
boolean |
isRailWay() |
boolean |
isRoad() |
boolean |
isWaterWay() |
LinkType |
reverse()
Returns a link type with directionality reversed.
|
String |
toString() |
commonAncestor, equals, getId, getParent, hashCode, isOfTypeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetIdpublic static final LinkType NONE
public static final LinkType ROAD
public static final LinkType FREEWAY
public static final LinkType WATERWAY
public static final LinkType RAILWAY
public static final LinkType CONNECTOR
public LinkType(String id, LinkType parent, GTUCompatibility<LinkType> compatibility)
id - String; the id of the lane type (may not be null)parent - LinkType; the parent type (may be null)compatibility - the collection of compatible GTUTypes for this LinkType; can be null (resulting in a LinkType that
is inaccessible to all GTU types). This constructor makes a deep copy of the compatibility.public Boolean isCompatible(GTUType gtuType, GTUDirectionality directionality)
isCompatible in interface Compatibility<GTUType,LinkType>gtuType - G; the type of the GTUdirectionality - GTUDirectionality; the direction of the GTU with respect to the design direction of the
infrastructureisCompatible on a higher level in the infrastructure hierarchypublic final LinkType reverse()
public final boolean isNone()
NONEpublic final boolean isRoad()
ROADpublic final boolean isWaterWay()
WATER_WAYpublic final boolean isRailWay()
RAIL_WAYpublic final boolean isConnector()
CONNECTORpublic final LongitudinalDirectionality getDirectionality(GTUType gtuType, boolean tryParentsOfGTUType)
tryParentsOfGTUType. tryParentsOfGTUType is false, the value null is returned. If true; the parent of the GTUType is used and
the search is repeated, etc. If none of the parents of the GTUType yields a result, this method returns
LongitudinalDirectionality.DIR_NONE.getDirectionality in interface Compatibility<GTUType,LinkType>gtuType - G; type of the GTUtryParentsOfGTUType - boolean; if true; the parents of the GTUType are tried if no match was found for the given
GTUTypeLongitudinalDirectionality.DIR_NONE if neither the GTUType or any of its parents specifies a
directionalityCopyright © 2014–2019 Delft University of Technology. All rights reserved.