Package org.goplanit.assignment.ltm.sltm
Class LinkSegmentData
- java.lang.Object
-
- org.goplanit.assignment.ltm.sltm.LinkSegmentData
-
- Direct Known Subclasses:
InflowOutflowData,NetworkLoadingFactorData,ReceivingFlowData,SendingFlowData
public abstract class LinkSegmentData extends Object
POJO to store Link segment based variables by the link segment internal id for sLTM link segment based data.- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description LinkSegmentData(double[] initialStateSegmentArray)ConstructorLinkSegmentData(int linkSegmentsSize, double initialValue)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcopyTo(double[] originArray, double[] destinationArray)copy from origin to destination assuming entire array is to be copied and both arrays are of equal sizeprotected double[]createinitialStateLinkSegmentDoubleArray()create a copy of the initial state doubles arrayprotected voidlimitFlowsToCapacity(double[] flowPcuHArray, MacroscopicLinkSegments linkSegments)Reduce all provided link segments' flows to capacityprotected static voidswap(int index, int index2, double[][] array2d)Swap the two 2Darray references
-
-
-
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 arrayinitialValue- 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 forindex2- second row index to swap contents forarray2d- 2d array to swap contents for based on two row indices
-
limitFlowsToCapacity
protected 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 fromdestinationArray- copy to
-
-