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
      • 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.
      • isCentroid

        boolean isCentroid()
        Checks whether the node has only connector links going in and/or out, and no other links.
        Returns:
        boolean; whether the node is a centroid, i.e. it only has connector links going in and out