public class ODMatrix extends Object implements Serializable
Class
's that define the categorization.
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
ODMatrix(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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category) |
boolean |
equals(Object obj) |
Set<Category> |
getCategories(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination)
Returns the categories specified for given origin-destination combination.
|
Categorization |
getCategorization() |
org.djunits.value.vdouble.scalar.Frequency |
getDemand(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category,
org.djunits.value.vdouble.scalar.Duration time)
Returns the demand at given time.
|
org.djunits.value.vdouble.vector.FrequencyVector |
getDemandVector(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category) |
List<org.opentrafficsim.core.network.Node> |
getDestinations() |
Interpolation |
getGlobalInterpolation() |
org.djunits.value.vdouble.vector.DurationVector |
getGlobalTimeVector() |
String |
getId() |
Interpolation |
getInterpolation(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category) |
List<org.opentrafficsim.core.network.Node> |
getOrigins() |
org.djunits.value.vdouble.vector.DurationVector |
getTimeVector(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category) |
int |
hashCode() |
static void |
main(String[] args) |
void |
print()
Prints the complete OD matrix with each demand data on a single line.
|
void |
putDemandVector(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category,
org.djunits.value.vdouble.vector.FrequencyVector demand) |
void |
putDemandVector(org.opentrafficsim.core.network.Node origin,
org.opentrafficsim.core.network.Node destination,
Category category,
org.djunits.value.vdouble.vector.FrequencyVector demand,
org.djunits.value.vdouble.vector.DurationVector timeVector,
Interpolation interpolation) |
String |
toString() |
public ODMatrix(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 String getId()
public final List<org.opentrafficsim.core.network.Node> getOrigins()
public final List<org.opentrafficsim.core.network.Node> getDestinations()
public final Categorization getCategorization()
public final org.djunits.value.vdouble.vector.DurationVector getGlobalTimeVector()
public final Interpolation getGlobalInterpolation()
public final void putDemandVector(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category, org.djunits.value.vdouble.vector.FrequencyVector demand)
origin
- origindestination
- destinationcategory
- categorydemand
- demand data, length has to be equal to the global 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 void putDemandVector(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category, org.djunits.value.vdouble.vector.FrequencyVector demand, org.djunits.value.vdouble.vector.DurationVector timeVector, Interpolation interpolation)
origin
- origindestination
- destinationcategory
- categorydemand
- demand data, length has to be equal to the time vectortimeVector
- time vectorinterpolation
- interpolationIllegalArgumentException
- 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 org.djunits.value.vdouble.vector.FrequencyVector getDemandVector(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 org.djunits.value.vdouble.vector.DurationVector getTimeVector(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 Interpolation getInterpolation(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 org.djunits.value.vdouble.scalar.Frequency getDemand(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category, org.djunits.value.vdouble.scalar.Duration time)
origin
- origindestination
- destinationcategory
- categorytime
- timeIllegalArgumentException
- 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 boolean contains(org.opentrafficsim.core.network.Node origin, org.opentrafficsim.core.network.Node destination, Category category)
origin
- origindestination
- destinationcategory
- categoryIllegalArgumentException
- 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 Set<Category> getCategories(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 nullpublic final void print()
public static void main(String[] args) throws org.djunits.value.ValueException, org.opentrafficsim.core.network.NetworkException
org.djunits.value.ValueException
org.opentrafficsim.core.network.NetworkException
Copyright © 2014–2017 Delft University of Technology. All rights reserved.