SkimMatrix

public interface SkimMatrix

Skim matrix for storing inter-zonal travel times or costs (for passenger vehicles).

Author:Milan Lovric

Methods

getAbsoluteDifference

public double getAbsoluteDifference(SkimMatrix other)

Gets sum of absolute differences between elements of two matrices.

Parameters:
  • other – The other matrix.
Returns:

Sum of absolute differences.

getCost

public double getCost(String originZone, String destinationZone)

Gets cost for a given origin-destination pair using ONS codes.

Parameters:
  • originZone – Origin zone ONS code.
  • destinationZone – Destination zone ONS code.
Returns:

Origin-destination cost.

getCost

public double getCost(int originZoneID, int destinationZoneID)

Gets cost for a given origin-destination pair using int zone IDs.

Parameters:
  • originZone – Origin zone ID.
  • destinationZone – Destination zone ID.
Returns:

Origin-destination cost.

getSortedDestinations

public List<String> getSortedDestinations()

Gets the sroted list of destinations.

Returns:List of destination zones.

getSortedOrigins

public List<String> getSortedOrigins()

Gets the sorted list of origins.

Returns:List of origin zones.

getUnsortedDestinations

public List<String> getUnsortedDestinations()

Gets the unsorted list of destinations.

Returns:List of destination zones.

getUnsortedOrigins

public List<String> getUnsortedOrigins()

Gets the unsorted list of origins.

Returns:List of origin zones.

printMatrix

public void printMatrix()

Prints the matrix.

printMatrixFormatted

public void printMatrixFormatted()

Prints the matrix as a formatted table.

printMatrixFormatted

public void printMatrixFormatted(String s)

Prints the matrix as a formatted table, with a print message.

Parameters:
  • s – Print message

saveMatrixFormatted

public void saveMatrixFormatted(String outputFile)

Saves the matrix into a csv file (matrix format).

Parameters:
  • outputFile – Path to the output file.

saveMatrixFormattedList

public void saveMatrixFormattedList(String outputFile)

Saves the matrix into a csv file (list format).

Parameters:
  • outputFile – Path to the output file.

setCost

public void setCost(String originZone, String destinationZone, double cost)

Sets cost for a given origin-destination pair using ONS codes.

Parameters:
  • originZone – Origin zone.
  • destinationZone – Destination zone.
  • cost – Origin-destination cost.

setCost

public void setCost(int originZoneID, int destinationZoneID, double cost)

Sets cost for a given origin-destination pair using int zone IDs.

Parameters:
  • originZoneID – Origin zone ID.
  • destinationZoneID – Destination zone ID.
  • cost – Origin-destination cost.