ODMatrixMultiKey¶
-
public class
ODMatrixMultiKey
implements AssignableODMatrix¶ Origin-destination matrix for passenger vehicles.
Author: Milan Lovric
Constructors¶
ODMatrixMultiKey¶
ODMatrixMultiKey¶
-
public
ODMatrixMultiKey
(RealODMatrix realMatrix)¶ Constructor that rounds the flows of a real-valued OD matrix.
Parameters: - realMatrix – Origin-destination matrix with real-valued flows.
Methods¶
calculateTripEnds¶
calculateTripStarts¶
clone¶
-
public ODMatrixMultiKey
clone
()¶
createLadMatrixFromTEMProMatrix¶
-
public static ODMatrixMultiKey
createLadMatrixFromTEMProMatrix
(ODMatrixMultiKey temproMatrix, Zoning zoning)¶ Creates LAD OD matrix from TEMPro OD matrix.
Parameters: - temproMatrix – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: LAD based OD matrix.
createSparseUnitMatrix¶
-
public static ODMatrixMultiKey
createSparseUnitMatrix
(Set<String> zones, HashMap<String, Point> centroids, double threshold)¶ Creates a unit OD matrix for a given lists of zones with a distance threshold. If straight line distance between origin and destination zone centroids is larger than threshold that flow is zero.
Parameters: - zones – Set of origin zones.
- centroids – List of zone centroids.
- threshold – Distance threshold in [m].
Returns: Unit OD matrix.
createTEMProFromLadMatrix¶
-
public static ODMatrixMultiKey
createTEMProFromLadMatrix
(ODMatrixMultiKey ladODMatrix, ODMatrixMultiKey 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¶
createUnitMatrix¶
-
public static ODMatrixMultiKey
createUnitMatrix
(List<String> zones)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of origin zones.
Returns: Unit OD matrix.
createUnitMatrix¶
-
public static ODMatrixMultiKey
createUnitMatrix
(Set<String> zones)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of origin zones.
Returns: Unit OD matrix.
deleteInterzonalFlows¶
getAbsoluteDifference¶
-
public double
getAbsoluteDifference
(ODMatrixMultiKey other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
getFlow¶
getIntFlow¶
getMatrixSubset¶
getSortedDestinations¶
getSortedOrigins¶
getTotalFlow¶
-
public int
getTotalFlow
()¶ Gets sum of all the flows in the matrix.
Returns: Sum of all the flows in the matrix (i.e. number of trips).
getTotalIntFlow¶
-
public int
getTotalIntFlow
()¶ Gets sum of all the flows in the matrix.
Returns: Sum of all the flows in the matrix (i.e. number of trips).
getUnsortedDestinations¶
getUnsortedOrigins¶
printMatrixFormatted¶
saveMatrixFormatted¶
saveMatrixFormatted2¶
scaleMatrixValue¶
-
public void
scaleMatrixValue
(double factor)¶ Scales (and rounds) matrix values with a scaling factor.
Parameters: - factor – Scaling factor.
setFlow¶
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.