public class OTSNode extends Object implements Node, Locatable, Serializable
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: 2016-04-23 23:05:47 +0200 (Sat, 23 Apr 2016) $, @version $Revision: 1976 $, by $Author: averbraeck $,
initial version Aug 19, 2014
| Constructor and Description |
|---|
OTSNode(String id,
OTSPoint3D point)
Construction of a Node.
|
OTSNode(String id,
OTSPoint3D point,
org.djunits.value.vdouble.scalar.Direction direction,
org.djunits.value.vdouble.scalar.Direction slope)
Construction of a Node.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnection(GTUType gtuType,
Link incomingLink,
Link outgoingLink)
Add a single connection for a GTU type to the connections map.
|
void |
addConnections(GTUType gtuType,
Link incomingLink,
Set<Link> outgoingLinks)
Add a set of connections for a GTU type to the connections map.
|
void |
addLink(Link link)
Add a link to this Node.
|
boolean |
equals(Object obj) |
Bounds |
getBounds() |
org.djunits.value.vdouble.scalar.Direction |
getDirection() |
String |
getId() |
Set<Link> |
getLinks() |
DirectedPoint |
getLocation() |
OTSPoint3D |
getPoint() |
org.djunits.value.vdouble.scalar.Direction |
getSlope() |
int |
hashCode() |
boolean |
isDirectionallyConnectedTo(GTUType gtuType,
Node toNode)
Note: this method does not take into account explicitly defined connections, as the previous link is not given.
|
Set<Link> |
nextLinks(GTUType gtuType,
Link prevLink)
Determine the links connecting from the previous link via this Node for the given GTU type.
|
void |
removeLink(Link link)
Remove a link from this Node.
|
String |
toString() |
public OTSNode(String id, OTSPoint3D point, org.djunits.value.vdouble.scalar.Direction direction, org.djunits.value.vdouble.scalar.Direction slope)
id - the id of the Node.point - the point with usually an x and y setting.direction - the 3D direction. "East" is 0 degrees. "North" is 90 degrees (1/2 pi radians).slope - the slope as an angle. Horizontal is 0 degrees.public OTSNode(String id, OTSPoint3D point)
id - the id of the Node.point - the point with usually an x and y setting.public final OTSPoint3D getPoint()
public final void addLink(Link link)
public final void removeLink(Link link)
removeLink in interface Nodelink - the link to remove.public final void addConnection(GTUType gtuType, Link incomingLink, Link outgoingLink) throws NetworkException
gtuType - the GTU type for which this connection is madeincomingLink - the link that connects to this NodeoutgoingLink - the link that the GTU can use to depart from this Node when coming from the incoming linkNetworkException - in case one of the links is not (correctly) connected to this Nodepublic final void addConnections(GTUType gtuType, Link incomingLink, Set<Link> outgoingLinks) throws NetworkException
gtuType - the GTU type for which this connection is madeincomingLink - the link that connects to this NodeoutgoingLinks - a set of links that the GTU can use to depart from this Node when coming from the incoming linkNetworkException - in case one of the links is not (correctly) connected to this Nodepublic final Set<Link> nextLinks(GTUType gtuType, Link prevLink) throws NetworkException
nextLinks in interface NodegtuType - the GTU type to determine the next links forprevLink - the incoming link to the NodeNetworkException - if thhe incoming link is not connected to this node for the given GTU typepublic final boolean isDirectionallyConnectedTo(GTUType gtuType, Node toNode)
isDirectionallyConnectedTo in interface NodegtuType - the GTU type to check the connection for.toNode - the to nodepublic final org.djunits.value.vdouble.scalar.Direction getDirection()
getDirection in interface Nodepublic final org.djunits.value.vdouble.scalar.Direction getSlope()
public final DirectedPoint getLocation()
getLocation in interface LocatablegetLocation in interface Nodepublic final Bounds getBounds()
Copyright © 2014–2016 Delft University of Technology. All rights reserved.