Class LinkSegmentData

    • Constructor Detail

      • LinkSegmentData

        public LinkSegmentData​(double[] initialStateSegmentArray)
        Constructor
        Parameters:
        initialStateSegmentArray - empty array used to initialize data stores
      • LinkSegmentData

        public LinkSegmentData​(int linkSegmentsSize,
                               double initialValue)
        Constructor
        Parameters:
        linkSegmentsSize - to use for initial state array
        initialValue - to use for the initial state arrays entries
    • Method Detail

      • createinitialStateLinkSegmentDoubleArray

        protected double[] createinitialStateLinkSegmentDoubleArray()
        create a copy of the initial state doubles array
        Returns:
        initial state doubles array the size of the emptySegmentArray provided to the constructor
      • swap

        protected static void swap​(int index,
                                   int index2,
                                   double[][] array2d)
        Swap the two 2Darray references
        Parameters:
        index - first row index to swap contents for
        index2 - second row index to swap contents for
        array2d - 2d array to swap contents for based on two row indices
      • limitFlowsToCapacity

        protected static void limitFlowsToCapacity​(double[] flowPcuHArray,
                                                   MacroscopicLinkSegments linkSegments)
        Reduce all provided link segments' flows to capacity
        Parameters:
        flowPcuHArray - to apply limit on (pcuPerHour)
        linkSegments - to use
      • copyTo

        public static void copyTo​(double[] originArray,
                                  double[] destinationArray)
        copy from origin to destination assuming entire array is to be copied and both arrays are of equal size
        Parameters:
        originArray - copy from
        destinationArray - copy to