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-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
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(java.lang.Object obj)inthashCode()java.lang.StringtoString()
-
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.ALLand 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-