Package org.opentrafficsim.road.od
Class SplitFraction
java.lang.Object
org.opentrafficsim.road.od.SplitFraction
Split fraction at a node with fractions per link, optionally per gtu type.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
ConstructorDescriptionSplitFraction
(Node node, Interpolation interpolation, nl.tudelft.simulation.jstats.streams.StreamInterface random, OtsSimulatorInterface simulator) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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, org.djunits.value.vdouble.vector.DurationVector time, double[] fraction) Add fraction to link over time for gtu type.Draw next link based on split fractions.boolean
int
hashCode()
toString()
-
Constructor Details
-
SplitFraction
public SplitFraction(Node node, Interpolation interpolation, nl.tudelft.simulation.jstats.streams.StreamInterface random, OtsSimulatorInterface simulator) Constructor.- Parameters:
node
- Node; nodeinterpolation
- Interpolation; interpolationrandom
- StreamInterface; random streamsimulator
- OtsSimulatorInterface; simulator
-
-
Method Details
-
addFraction
Add fraction to link for gtu type, this will apply to all time.- Parameters:
link
- Link; linkgtuType
- GtuType; gtu typefraction
- double; fraction
-
addFraction
public void addFraction(Link link, GtuType gtuType, org.djunits.value.vdouble.vector.DurationVector time, double[] fraction) 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() -
equals
-
toString
-