Interface Node

    • Method Detail

      • 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()
        Retrieve the id of this Node.
        Specified by:
        getId in interface Identifiable
        Returns:
        String; the id of this Node
      • getPoint

        Point3d getPoint()
        Retrieve the point of this Node.
        Returns:
        Point3d; the point of this Node
      • getHeading

        double getHeading()
        Retrieve the heading of this Node.
        Returns:
        double; the heading of this node in Radians from the East direction (North is Pi/2; etc.)
      • addLink

        void addLink​(Link link)
        Add a link to this Node. This method should only be called from the constructor of the Link.
        Parameters:
        link - Link; the link to add
      • removeLink

        void removeLink​(Link link)
        Remove a Link from this Node. TODO decide if an attempt to remove a Link that is not linked to this Node should throw some exception.
        Parameters:
        link - Link; the link to remove
      • getLinks

        ImmutableSet<Link> getLinks()
        Return an ImmutableSet of all Links at this Node.
        Returns:
        ImmutableSet<Link>; an immutable set 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:
        Set<Link>; a set of links connecting from the previous link via this Node for the given GTU type. This set is mutable and the caller may modify the result as it is created specifically for each invocation of this method
        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 this Node is linked to a specific 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:
        boolean; true if the nodes are directly linked in the specified direction for the specified GTUType; false if the nodes are not directly linked in the specified direction for the specified GTUType
      • isCentroid

        boolean isCentroid()
        Checks whether this Node has only connector links going in and/or out, and no other links.
        Returns:
        boolean; true if this Node is a centroid, i.e. it only has connector links going in and out; false if this Node is not a centroid