Interface Node

All Superinterfaces:
Drawable, Identifiable, Locatable, Serializable
All Known Implementing Classes:
OTSNode

public interface Node
extends Locatable, Serializable, Identifiable, Drawable
The Node is a point with an id. It is used in the network to connect Links.

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: 2019-06-21 14:44:04 +0200 (Fri, 21 Jun 2019) $, @version $Revision: 5531 $, by $Author: wjschakel $, initial version Aug 19, 2014

Author:
Alexander Verbraeck, Peter Knoppers, Guus Tamminga
  • Method Details

    • getNetwork

      Network getNetwork()
      Return the network in which this link is registered. Cannot be null.
      Returns:
      Network; the network in which this link is registered
    • getId

      String getId()
      Specified by:
      getId in interface Identifiable
      Returns:
      node id.
    • getPoint

      OTSPoint3D getPoint()
      Returns:
      point.
    • getHeading

      double getHeading()
      Returns:
      heading.
    • addLink

      void addLink​(Link link)
      Add a link to this Node.
      Parameters:
      link - Link; the link to add.
    • removeLink

      void removeLink​(Link link)
      Remove a link from this Node.
      Parameters:
      link - Link; the link to remove.
    • getLinks

      ImmutableSet<Link> getLinks()
      Returns:
      a safe copy of the links connected to this Node
    • nextLinks

      Set<Link> nextLinks​(GTUType gtuType, Link prevLink) throws NetworkException
      Determine the links connecting from the previous link via this Node for the given GTU type.
      Parameters:
      gtuType - GTUType; the GTU type to determine the next links for
      prevLink - Link; the incoming link to the Node
      Returns:
      a set of links connecting from the previous link via this Node for the given GTU type
      Throws:
      NetworkException - if the incoming link is not connected to this node for the given GTU type
    • isDirectionallyConnectedTo

      boolean isDirectionallyConnectedTo​(GTUType gtuType, Node toNode)
      Check if the current node is linked to the given Node in the specified direction for the given GTUType. This can mean there is a Link from this node to toNode, and the LongitudinalDirectionality for the Link between this node and toNode is FORWARD or BOTH; or there is a Link from toNode to this node, and the LongitudinalDirectionality for the Link between toNode and this node is BACKWARD or BOTH for the provided GTUType.
      Parameters:
      gtuType - GTUType; the GTU type to check the connection for.
      toNode - Node; the to node
      Returns:
      whether two nodes are linked in the specified direction.