public class ODMatrixTrips extends ODMatrix
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
ODMatrixTrips(String id,
List<org.opentrafficsim.core.network.Node> origins,
List<org.opentrafficsim.core.network.Node> destinations,
Categorization categorization,
org.djunits.value.vdouble.vector.DurationVector globalTimeVector,
Interpolation globalInterpolation)
Constructs an OD matrix based on trips.
|
Modifier and Type | Method and Description |
---|---|
int |
destinationTotal(org.opentrafficsim.core.network.Node destination)
Calculates total number of trips over time for given destination.
|
int |
getTrips(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category,
int periodIndex)
Returns the number of trips in the given time period.
|
int[] |
getTripsVector(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category) |
void |
increaseTrips(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category,
int periodIndex,
int trips)
Adds a number of trips to given origin-destination combination, category and time period.
|
int |
matrixTotal()
Calculates total number of trips over time for the complete matrix.
|
int |
originDestinationTotal(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination)
Calculates total number of trips over time for given origin-destination combination.
|
int |
originTotal(org.opentrafficsim.core.network.Node origin)
Calculates total number of trips over time for given origin.
|
void |
putTripsVector(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category,
int[] trips) |
void |
putTripsVector(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category,
int[] trips,
org.djunits.value.vdouble.vector.DurationVector timeVector)
Sets demand data by number of trips.
|
String |
toString() |
contains, equals, getCategories, getCategorization, getDemand, getDemandVector, getDestinations, getGlobalInterpolation, getGlobalTimeVector, getId, getInterpolation, getOrigins, getTimeVector, hashCode, main, print, putDemandVector, putDemandVector
public ODMatrixTrips(String id, List<org.opentrafficsim.core.network.Node> origins, List<org.opentrafficsim.core.network.Node> destinations, Categorization categorization, org.djunits.value.vdouble.vector.DurationVector globalTimeVector, Interpolation globalInterpolation)
id
- idorigins
- origin nodesdestinations
- destination nodescategorization
- categorization of dataglobalTimeVector
- default timeglobalInterpolation
- interpolation of demand dataNullPointerException
- if any input is nullpublic final void putTripsVector(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category, int[] trips)
origin
- origindestination
- destinationcategory
- categorytrips
- trip data, length has to be equal to the global time vector - 1IllegalArgumentException
- if origin or destination is not part of the OD matrixIllegalArgumentException
- if the category does not belong to the categorizationNullPointerException
- if an input is nullpublic final void putTripsVector(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category, int[] trips, org.djunits.value.vdouble.vector.DurationVector timeVector)
origin
- origindestination
- destinationcategory
- categorytrips
- trip data, length has to be equal to the time vector - 1timeVector
- time vectorIllegalArgumentException
- if origin or destination is not part of the OD matrixIllegalArgumentException
- if the category does not belong to the categorizationNullPointerException
- if an input is nullpublic final int[] getTripsVector(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category)
origin
- origindestination
- destinationcategory
- categorynull
if no data is givenIllegalArgumentException
- if origin or destination is not part of the OD matrixIllegalArgumentException
- if the category does not belong to the categorizationNullPointerException
- if an input is nullpublic final int getTrips(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category, int periodIndex)
origin
- origindestination
- destinationcategory
- categoryperiodIndex
- index of time periodIllegalArgumentException
- if origin or destination is not part of the OD matrixIllegalArgumentException
- if the category does not belong to the categorizationIllegalArgumentException
- if the period is outside of the specified rangeNullPointerException
- if an input is nullpublic final void increaseTrips(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category, int periodIndex, int trips)
origin
- origindestination
- destinationcategory
- categoryperiodIndex
- index of time periodtrips
- trips to add (may be negative)IllegalArgumentException
- if origin or destination is not part of the OD matrixIllegalArgumentException
- if the category does not belong to the categorizationIllegalArgumentException
- if the period is outside of the specified rangeUnsupportedOperationException
- if the interpolation of the data is not stepwiseNullPointerException
- if an input is nullpublic final int originTotal(org.opentrafficsim.core.network.Node origin)
origin
- originIllegalArgumentException
- if origin is not part of the OD matrixNullPointerException
- if origin is nullpublic final int destinationTotal(org.opentrafficsim.core.network.Node destination)
destination
- destinationIllegalArgumentException
- if destination is not part of the OD matrixNullPointerException
- if destination is nullpublic final int matrixTotal()
public final int originDestinationTotal(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination)
origin
- origindestination
- destinationIllegalArgumentException
- if origin or destination is not part of the OD matrixNullPointerException
- if an input is nullCopyright © 2014–2016 Delft University of Technology. All rights reserved.