ODMatrixArrayTempro¶
-
public class
ODMatrixArrayTempro
implements AssignableODMatrix¶ Origin-destination matrix with real values, memory use optimised for Tempro.
Author: Milan Lovric
Methods¶
calculateTripEnds¶
calculateTripStarts¶
clone¶
-
public ODMatrixArrayTempro
clone
()¶
createLadMatrixFromTEMProMatrix¶
-
public static RealODMatrix
createLadMatrixFromTEMProMatrix
(ODMatrixArrayTempro temproMatrix, Zoning zoning)¶ Creates real-valued LAD OD matrix from real-valued TEMPro OD matrix.
Parameters: - temproMatrix – TEMPro ODMatrix which should be aggregated to LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: LAD based real-valued OD matrix.
createTEMProFromLadMatrix¶
-
public static ODMatrixArrayTempro
createTEMProFromLadMatrix
(ODMatrixArray ladODMatrix, ODMatrixArrayTempro baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
createTEMProFromLadMatrix¶
-
public static ODMatrixArrayTempro
createTEMProFromLadMatrix
(ODMatrixMultiKey ladODMatrix, ODMatrixArrayTempro baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
createUnitMatrix¶
-
public static ODMatrixArrayTempro
createUnitMatrix
(List<String> origins, List<String> destinations, Zoning zoning)¶ Creates a unit OD matrix for given lists of origin and destination zones.
Parameters: - origins – List of origin zones.
- destinations – List of destination zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
createUnitMatrix¶
-
public static ODMatrixArrayTempro
createUnitMatrix
(List<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of zones.
Returns: Unit OD matrix.
createUnitMatrix¶
-
public static ODMatrixArrayTempro
createUnitMatrix
(Set<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
createUnitMatrix¶
-
public static ODMatrixArrayTempro
createUnitMatrix
(Zoning zoning)¶ Creates a quadratic unit OD matrix.
Parameters: - zoning – Zoning system.
Returns: Unit OD matrix.
deleteInterzonalFlows¶
getAbsoluteDifference¶
-
public int
getAbsoluteDifference
(ODMatrixArrayTempro other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
getFlow¶
getIntFlow¶
getSortedDestinations¶
getSortedOrigins¶
getTotalIntFlow¶
-
public int
getTotalIntFlow
()¶ Gets sum of all the (rounded) flows in the matrix.
Returns: Sum of all the (rounded) flows in the matrix (i.e. number of trips).
getUnsortedDestinations¶
getUnsortedOrigins¶
printMatrixFormatted¶
saveMatrixFormatted¶
saveMatrixFormatted2¶
saveMatrixFormatted3¶
scaleMatrixValue¶
-
public void
scaleMatrixValue
(double factor)¶ Scales matrix values with a scaling factor.
Parameters: - factor – Scaling factor.
scaleMatrixValue¶
-
public void
scaleMatrixValue
(ODMatrixArrayTempro scalingMatrix)¶ Scales matrix values with another matrix (element-wise multiplication).
Parameters: - scalingMatrix – Scaling matrix.
setFlow¶
setFlow¶
-
public void
setFlow
(int originCode, int destinationCode, int flow)¶ Sets the flow for a given origin-destination pair.
Parameters: - originCode – Origin zone integer code.
- destinationCode – Destination zone integer code.
- flow – Origin-destination flow.
sumMatrixSubset¶
-
public int
sumMatrixSubset
(List<String> origins, List<String> destinations)¶ Sums the elements of a matrix subset (provided as two lists of origins and destinations).
Parameters: - origins – List of origin zones (a subset).
- destinations – List of destination zones (a subset).
Returns: Sum of the subset.