Class FundamentalDiagramComponent

    • Field Detail

      • RELAXED_HASH_CODE_SCALE

        public static final int RELAXED_HASH_CODE_SCALE
        precision scale to apply for the relaxed hash code to compare fundamental diagrams on being identical regarding their floating point variables, where 6 equates to 6 decimals of precision
        See Also:
        Constant Field Values
    • Constructor Detail

      • FundamentalDiagramComponent

        public FundamentalDiagramComponent​(IdGroupingToken groupId)
        Base constructor
        Parameters:
        groupId - token
      • FundamentalDiagramComponent

        public FundamentalDiagramComponent​(FundamentalDiagramComponent other,
                                           boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • initialiseDefaultFundamentalDiagramsForLayer

        protected abstract void initialiseDefaultFundamentalDiagramsForLayer​(MacroscopicNetworkLayer parentNetworkLayer)
        Initialise the default available fundamental diagrams for the layer the component is registered on. This includes the fundamental diagrams for the link segment types and possible anomalies for links where the physical link segment characteristics would overrule the link segment type defaults
        Parameters:
        parentNetworkLayer - to initialise default fundamental diagrams for
      • register

        protected FundamentalDiagram register​(MacroscopicLinkSegment linkSegment,
                                              FundamentalDiagram fundamentalDiagram)
        Register the given fundamental diagram for the link segment. This overrules the fundamental diagram that would be used based on the link segment's type. In case there already exists an identical fundamental diagram (based on relaxed hashcode comparison), the link segment is assigned the already present fundamental diagram. The fundamental diagram used for the link segment is returned, which is either the passed in one, or an already present functionally identical version
        Parameters:
        linkSegment - to use
        fundamentalDiagram - to register
        Returns:
        used Fd for the link segment, can be different (but functionally equivalent) if registered Fd was already present for another link segment
      • register

        protected FundamentalDiagram register​(MacroscopicLinkSegmentType linkSegmentType,
                                              FundamentalDiagram fundamentalDiagram)
        Register the given fundamental diagram for the link segment type. In case there already exists an identical fundamental diagram (based on relaxed hashcode comparison), the link segment type is assigned the already present fundamental diagram. The fundamental diagram used for the link segment type is returned, which is either the passed in one, or an already present functionally identical version
        Parameters:
        linkSegmentType - to use
        fundamentalDiagram - to register
        Returns:
        used Fd for the link segment type, can be different (but functionally equivalent) if registered Fd was already present for another link segment
      • get

        public FundamentalDiagram get​(MacroscopicLinkSegment linkSegment)
        Collect the fundamental diagram for the given link segment.
        Parameters:
        linkSegment - to collect fundamental diagram for
        Returns:
        related fundamental diagram, null if not present
      • get

        public FundamentalDiagram get​(MacroscopicLinkSegmentType linkSegmentType)
        Collect the fundamental diagram for the given link segment type.
        Parameters:
        linkSegmentType - to collect fundamental diagram for
        Returns:
        related fundamental diagram, null if not present
      • setCapacityLinkSegmentPcuHourLane

        public void setCapacityLinkSegmentPcuHourLane​(MacroscopicLinkSegment linkSegment,
                                                      double capacityPcuHourLane)
        Set the capacity in pcu/h/lane to use for the Newell FD for a given link segment. This only impacts the backward wave speed used to keep the FD viable.
        Parameters:
        linkSegment - the specified link segment
        capacityPcuHourLane - to use
      • setMaximumDensityLinkSegmentPcuKmLane

        public void setMaximumDensityLinkSegmentPcuKmLane​(MacroscopicLinkSegment linkSegment,
                                                          double maxDensityPcuKmLane)
        Set the maximum density in pcu/km/lane to use for the Newell FD for a given link segment. This only impacts the backward wave speed used to keep the FD viable. one to change the capacity.
        Parameters:
        linkSegment - the specified link segment
        maxDensityPcuKmLane - to use
      • setCapacityLinkSegmentTypePcuHourLane

        public void setCapacityLinkSegmentTypePcuHourLane​(MacroscopicLinkSegmentType linkSegmentType,
                                                          double capacityPcuHourLane)
        Set the capacity in pcu/h/lane to use for the Newell FD for a given link segment type. This only impacts the backward wave speed used to keep the FD viable.
        Parameters:
        linkSegmentType - the specified link segment type
        capacityPcuHourLane - to use
      • setMaximumDensityLinkSegmentTypePcuKmLane

        public void setMaximumDensityLinkSegmentTypePcuKmLane​(MacroscopicLinkSegmentType linkSegmentType,
                                                              double maxDensityPcuKmLane)
        Set the maximum density in pcu/km/lane to use for the Newell FD for a given link segment type. This only impacts the backward wave speed used to keep the FD viable. one to change the capacity.
        Parameters:
        linkSegmentType - the specified link segment type
        maxDensityPcuKmLane - to use
      • asLinkSegmentIndexedArray

        public FundamentalDiagram[] asLinkSegmentIndexedArray​(MacroscopicLinkSegments linkSegments)
        Method to collect all fundamental diagrams for the given link segments in a 1:1 fashion in a raw array based on the current setup of this component. The returned array is indexed by the link segments linkSegmentId (not id). The returned array is a newly created array yet the fundamental diagrams contained in it are references to the fundamental diagrams registered on this component. Further, it is also assumed that the provided link segments are indeed the segments (and types) on which the registered fundamental diagrams on this component are based. If not, then this would result in undefined behaviour.
        Parameters:
        linkSegments - to collect fundamental diagrams for
        Returns:
        fundamental diagrams per link segment by linkSegmentId, if no fd is present, the entry remains null