Class MacroscopicNetworkBuilder

    • Field Detail

      • groupId

        protected IdGroupingToken groupId
        Contiguous id generation within this group id token for all instances created with factory methods in this class
    • Constructor Detail

      • MacroscopicNetworkBuilder

        public MacroscopicNetworkBuilder()
    • Method Detail

      • createMode

        public Mode createMode​(long externalModeId,
                               String name,
                               double pcu)
        Create a new mode
        Specified by:
        createMode in interface PhysicalNetworkBuilder
        Parameters:
        externalModeId - external id of the mode
        name - name of the mode
        pcu - pcu value of the mode
        Returns:
        created mode
      • createLink

        public Link createLink​(Node nodeA,
                               Node nodeB,
                               double length,
                               String name)
                        throws PlanItException
        Create a new link instance
        Specified by:
        createLink in interface PhysicalNetworkBuilder
        Parameters:
        nodeA - the first node in this link
        nodeB - the second node in this link
        length - the length of this link
        name - the name of the link
        Returns:
        created link
        Throws:
        PlanItException - thrown if there is an error
      • createLinkSegment

        public LinkSegment createLinkSegment​(Link parentLink,
                                             boolean directionAB)
        Create a new MacroscopicLinkSegment
        Specified by:
        createLinkSegment in interface PhysicalNetworkBuilder
        Parameters:
        parentLink - the parent link of this link segment
        directionAB - the direction of this link
        Returns:
        LinkSegment created
      • createLinkSegmentType

        public MacroscopicLinkSegmentType createLinkSegmentType​(String name,
                                                                double capacity,
                                                                double maximumDensity,
                                                                Object externalId,
                                                                Map<Mode,​MacroscopicModeProperties> modeProperties)
        Create a fully functional macroscopic link segment type instance
        Parameters:
        name - the name of this link type
        capacity - the capacity of this link type
        maximumDensity - the maximum density of this link type
        externalId - the external reference number of this link type
        modeProperties - the mode properties for each mode along this link
        Returns:
        macroscopicLinkSegmentType the created link segment type
      • setIdGroupingToken

        public void setIdGroupingToken​(IdGroupingToken groupId)
        Each builder needs a group if token to allow all underlying factory methods to generated ids uniquely tied to the group the entities belong to
        Specified by:
        setIdGroupingToken in interface PhysicalNetworkBuilder
        Parameters:
        groupId - , contiguous id generation within this group for instances created with the factory methods