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 Details

  • Method Details

    • addFraction

      public void addFraction​(Link link, double fraction)
      Add fraction to link, this will apply to GTUType.ALL and all time.
      Parameters:
      link - Link; link
      fraction - 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; link
      gtuType - GTUType; gtu type
      fraction - double; fraction
    • addFraction

      public void addFraction​(Link link, DurationVector time, double[] fraction)
      Add fraction to link over time, this will apply to GTUType.ALL.
      Parameters:
      link - Link; link
      time - DurationVector; time
      fraction - 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; link
      gtuType - GTUType; gtu type
      time - DurationVector; time
      fraction - 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
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object