FreightMatrix¶
-
public class
FreightMatrix
¶ Origin-destination matrix for freight vehicles (following the format of DfT’s BYFM 2006 study).
Author: Milan Lovric
Fields¶
Constructors¶
Methods¶
createUnitBYFMMatrix¶
-
public static FreightMatrix
createUnitBYFMMatrix
()¶ Creates a unit freight matrix for the specific DfT BYFM 2006 zoning system.
Returns: Unit BYFM freight matrix.
createUnitMatrix¶
deleteInterzonalFlows¶
-
public void
deleteInterzonalFlows
(int zone)¶ Deletes all inter-zonal flows to/from a particular zone (leaving only intra-zonal flows)
Parameters: - zone – Zone for which inter-zonal flows need to be deleted from the freight matrix.
getAbsoluteDifference¶
-
public double
getAbsoluteDifference
(FreightMatrix other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
getFlow¶
-
public int
getFlow
(int origin, int destination, int vehicleType)¶ Gets the flow for a given origin-destination pair.
Parameters: - origin – Freight origin.
- destination – Freight destination.
- vehicleType – Vehicle type.
Returns: Origin-destination flow.
getScaledMatrix¶
-
public FreightMatrix
getScaledMatrix
(double scale)¶ Multiplies each value of the matrix with a scaling factor.
Parameters: - scale – Scaling factor.
Returns: Scaled freight matrix.
getSortedDestinations¶
getSortedOrigins¶
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¶
getVehicleTypes¶
printMatrixFormatted¶
saveMatrixFormatted¶
scaleMatrix¶
-
public void
scaleMatrix
(SkimMatrixFreight scale)¶ Scales matrix flows using a real-valued scaling matrix.
Parameters: - scale – Scaling factors.