Class SplitFraction
- java.lang.Object
-
- org.opentrafficsim.road.gtu.strategical.od.SplitFraction
-
public class SplitFraction extends Object
Split fraction at a node with fractions per link, optionally per gtu type.Copyright (c) 2013-2020 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFraction(Link link, double fraction)Add fraction to link, this will apply toGTUType.ALLand all time.voidaddFraction(Link link, DurationVector time, double[] fraction)Add fraction to link over time, this will apply toGTUType.ALL.voidaddFraction(Link link, GTUType gtuType, double fraction)Add fraction to link for gtu type, this will apply to all time.voidaddFraction(Link link, GTUType gtuType, DurationVector time, double[] fraction)Add fraction to link over time for gtu type.Linkdraw(GTUType gtuType)Draw next link based on split fractions.booleanequals(Object obj)inthashCode()StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
addFraction
public void addFraction(Link link, double fraction)
Add fraction to link, this will apply toGTUType.ALLand all time.- Parameters:
link- Link; linkfraction- double; fraction
-
addFraction
public void addFraction(Link link, GTUType gtuType, double fraction)
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, DurationVector time, double[] fraction)
Add fraction to link over time, this will apply toGTUType.ALL.- Parameters:
link- Link; linktime- DurationVector; timefraction- double[]; fraction
-
addFraction
public void addFraction(Link link, GTUType gtuType, 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
public Link draw(GTUType gtuType)
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
-
-