ODMatrixArray¶
-
public class
ODMatrixArray
implements AssignableODMatrix¶ Origin-destination matrix for passenger vehicles.
Author: Milan Lovric
Constructors¶
ODMatrixArray¶
ODMatrixArray¶
-
public
ODMatrixArray
(RealODMatrix realMatrix, Zoning zoning)¶ Constructor that rounds the flows of a real-valued OD matrix.
Parameters: - realMatrix – Origin-destination matrix with real-valued flows.
- zoning – Zoning system.
Methods¶
calculateTripEnds¶
calculateTripStarts¶
createLadMatrixFromTEMProMatrix¶
-
public static ODMatrixArray
createLadMatrixFromTEMProMatrix
(ODMatrixArrayTempro 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.
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.
createUnitMatrix¶
-
public static ODMatrixArray
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 ODMatrixArray
createUnitMatrix
(List<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of origin zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
createUnitMatrix¶
-
public static ODMatrixArray
createUnitMatrix
(Set<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of origin zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
deleteInterzonalFlows¶
getAbsoluteDifference¶
-
public int
getAbsoluteDifference
(ODMatrixArray other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
getFlow¶
getFlow¶
-
public int
getFlow
(int originZoneID, int destinationZoneID)¶ Gets the flow for a given origin-destination pair.
Parameters: - originZoneID – Origin zone ID.
- destinationZoneID – Destination zone ID.
Returns: Origin-destination flow.
getIntFlow¶
getIntFlow¶
-
public int
getIntFlow
(int originZoneID, int destinationZoneID)¶ Gets the flow for a given origin-destination pair as a whole number.
Parameters: - originZoneID – Origin zone ID.
- destinationZoneID – Destination zone ID.
Returns: Origin-destination flow.
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¶
saveMatrixFormattedList¶
scaleMatrixValue¶
-
public void
scaleMatrixValue
(double factor)¶ Scales (and rounds) matrix values with a scaling factor.
Parameters: - factor – Scaling factor.