Package org.planit.od.odmatrix
Class ODMatrix
- java.lang.Object
-
- org.planit.od.ODDataImpl<Double>
-
- org.planit.od.odmatrix.ODMatrix
-
- Direct Known Subclasses:
ODDemandMatrix
,ODSkimMatrix
public abstract class ODMatrix extends ODDataImpl<Double>
This class contains common methods for handling origin-demand matrices.- Author:
- gman6028
-
-
Field Summary
Fields Modifier and Type Field Description protected org.ojalgo.array.Array2D<Double>
matrixContents
matrix of data values-
Fields inherited from class org.planit.od.ODDataImpl
zones
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
getValue(Zone origin, Zone destination)
Returns the value for a specified origin and destinationODMatrixIterator
iterator()
Returns an iterator which can iterate through all the origin-destination cells in the matrixvoid
setValue(Zone origin, Zone destination, Double value)
Sets the value for a specified origin and destination-
Methods inherited from class org.planit.od.ODDataImpl
getNumberOfTravelAnalysisZones
-
-
-
-
Field Detail
-
matrixContents
protected org.ojalgo.array.Array2D<Double> matrixContents
matrix of data values
-
-
Constructor Detail
-
ODMatrix
public ODMatrix(Zones<?> zones)
Constructor for matrix based OD demand matrix- Parameters:
zones
- holder for zones considered in the matrix
-
-
Method Detail
-
setValue
public void setValue(Zone origin, Zone destination, Double value)
Sets the value for a specified origin and destination- Parameters:
origin
- specified origindestination
- specified destinationvalue
- value at the specified cell
-
getValue
public Double getValue(Zone origin, Zone destination)
Returns the value for a specified origin and destination- Parameters:
origin
- specified origindestination
- specified destination- Returns:
- value at the specified cell
-
iterator
public ODMatrixIterator iterator()
Returns an iterator which can iterate through all the origin-destination cells in the matrix- Returns:
- iterator through all the origin-destination cells
-
-