Class CapacityOTSLink

    • Constructor Detail

      • CapacityOTSLink

        public CapacityOTSLink​(Network network,
                               String id,
                               Node startNode,
                               Node endNode,
                               LinkType linkType,
                               OTSLine3D designLine,
                               Frequency capacity)
                        throws NetworkException
        Construct a new link.
        Parameters:
        network - OTSNetwork; the network.
        id - String; the link id
        startNode - Node; start node (directional)
        endNode - Node; end node (directional)
        linkType - LinkType; Link type to indicate compatibility with GTU types
        designLine - OTSLine3D; the OTSLine3D design line of the Link
        capacity - Frequency; link capacity in GTUs per hour // XXX per direction? which GTUType?
        Throws:
        NetworkException - if link already exists in the network, if name of the link is not unique, or if the start node or the end node of the link are not registered in the network.
      • CapacityOTSLink

        protected CapacityOTSLink​(Network newNetwork,
                                  CapacityOTSLink link)
                           throws NetworkException
        Clone a link for a new network.
        Parameters:
        newNetwork - OTSNetwork; the new network to which the clone belongs
        link - CapacityOTSLink; the link to clone from
        Throws:
        NetworkException - if link already exists in the network, if name of the link is not unique, or if the start node or the end node of the link are not registered in the network.
    • Method Detail

      • setCapacity

        public final void setCapacity​(Frequency capacity)
        Set the link capacity.
        Specified by:
        setCapacity in interface Capacity
        Parameters:
        capacity - Frequency; the new capacity of the link as a frequency in GTUs per time unit.