Class SplitFraction
java.lang.Object
org.opentrafficsim.road.gtu.strategical.od.SplitFraction
public class SplitFraction
extends java.lang.Object
Split fraction at a node with fractions per link, optionally per gtu type.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 4 mei 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors Constructor Description SplitFraction(Node node, Interpolation interpolation, StreamInterface random, DEVSSimulatorInterface.TimeDoubleUnit simulator)
Constructor. -
Method Summary
Modifier and Type Method Description void
addFraction(Link link, double fraction)
Add fraction to link, this will apply toGTUType.ALL
and all time.void
addFraction(Link link, DurationVector time, double[] fraction)
Add fraction to link over time, this will apply toGTUType.ALL
.void
addFraction(Link link, GTUType gtuType, double fraction)
Add fraction to link for gtu type, this will apply to all time.void
addFraction(Link link, GTUType gtuType, DurationVector time, double[] fraction)
Add fraction to link over time for gtu type.Link
draw(GTUType gtuType)
Draw next link based on split fractions.boolean
equals(java.lang.Object obj)
int
hashCode()
java.lang.String
toString()
-
Constructor Details
-
SplitFraction
public SplitFraction(Node node, Interpolation interpolation, StreamInterface random, DEVSSimulatorInterface.TimeDoubleUnit simulator)Constructor.- Parameters:
node
- Node; nodeinterpolation
- Interpolation; interpolationrandom
- StreamInterface; random streamsimulator
- DEVSSimulatorInterface.TimeDoubleUnit; simulator
-
-
Method Details
-
addFraction
Add fraction to link, this will apply toGTUType.ALL
and all time.- Parameters:
link
- Link; linkfraction
- double; fraction
-
addFraction
Add fraction to link for gtu type, this will apply to all time.- Parameters:
link
- Link; linkgtuType
- GTUType; gtu typefraction
- double; fraction
-
addFraction
Add fraction to link over time, this will apply toGTUType.ALL
.- Parameters:
link
- Link; linktime
- DurationVector; timefraction
- double[]; fraction
-
addFraction
Add fraction to link over time for gtu type.- Parameters:
link
- Link; linkgtuType
- GTUType; gtu typetime
- DurationVector; timefraction
- double[]; fraction
-
draw
Draw next link based on split fractions. If no fractions were defined, split fractions are determined based on the number of lanes per link.- Parameters:
gtuType
- GTUType; gtuType- Returns:
- next link
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-