public class OTSLink extends Object implements Link, Serializable, LocatableInterface
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-11-11 13:25:26 +0100 (Wed, 11 Nov 2015) $, @version $Revision: 1548 $, by $Author: averbraeck $,
initial version Aug 19, 2014
| Constructor and Description |
|---|
OTSLink(String id,
OTSNode startNode,
OTSNode endNode,
LinkType linkType,
OTSLine3D designLine,
LongitudinalDirectionality directionality)
Construct a new link, with a directionality for all GTUs as provided.
|
OTSLink(String id,
OTSNode startNode,
OTSNode endNode,
LinkType linkType,
OTSLine3D designLine,
Map<GTUType,LongitudinalDirectionality> directionalityMap)
Construct a new link.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDirectionality(GTUType gtuType,
LongitudinalDirectionality directionality)
This method sets the directionality of the link for a GTU type.
|
boolean |
equals(Object obj) |
Bounds |
getBounds() |
OTSLine3D |
getDesignLine() |
LongitudinalDirectionality |
getDirectionality(GTUType gtuType)
This method returns the directionality of the link for a GTU type.
|
OTSNode |
getEndNode() |
String |
getId() |
org.djunits.value.vdouble.scalar.Length.Rel |
getLength() |
LinkType |
getLinkType() |
DirectedPoint |
getLocation() |
OTSNode |
getStartNode() |
int |
hashCode() |
void |
removeDirectionality(GTUType gtuType)
This method removes an earlier provided directionality of the link for a given GTU type, e.g.
|
String |
toString() |
public OTSLink(String id, OTSNode startNode, OTSNode endNode, LinkType linkType, OTSLine3D designLine, Map<GTUType,LongitudinalDirectionality> directionalityMap)
id - the link idstartNode - start node (directional)endNode - end node (directional)linkType - Link type to indicate compatibility with GTU typesdesignLine - the OTSLine3D design line of the LinkdirectionalityMap - the directions (FORWARD, BACKWARD, BOTH, NONE) that GTUtypes can traverse this linkpublic OTSLink(String id, OTSNode startNode, OTSNode endNode, LinkType linkType, OTSLine3D designLine, LongitudinalDirectionality directionality)
id - the link idstartNode - start node (directional)endNode - end node (directional)linkType - Link type to indicate compatibility with GTU typesdesignLine - the OTSLine3D design line of the Linkdirectionality - the directionality for all GTUspublic final LongitudinalDirectionality getDirectionality(GTUType gtuType)
getDirectionality in interface LinkgtuType - the GTU type to request the directionality forpublic final void addDirectionality(GTUType gtuType, LongitudinalDirectionality directionality)
addDirectionality in interface LinkgtuType - the GTU type to set the directionality for.directionality - the longitudinal directionality of the link (FORWARD, BACKWARD, BOTH or NONE) for the given GTU
type.public final void removeDirectionality(GTUType gtuType)
removeDirectionality in interface LinkgtuType - the GTU type to remove the directionality for.public final OTSNode getStartNode()
getStartNode in interface Linkpublic final OTSNode getEndNode()
getEndNode in interface Linkpublic final LinkType getLinkType()
getLinkType in interface Linkpublic final OTSLine3D getDesignLine()
getDesignLine in interface Linkpublic final org.djunits.value.vdouble.scalar.Length.Rel getLength()
public final DirectedPoint getLocation()
getLocation in interface LocatableInterfacegetLocation in interface Linkpublic final Bounds getBounds()
getBounds in interface LocatableInterfacegetBounds in interface LinkCopyright © 2014–2016 Delft University of Technology. All rights reserved.