Class SplitFraction

java.lang.Object
org.opentrafficsim.road.od.SplitFraction

public class SplitFraction extends Object
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 Details

    • SplitFraction

      public SplitFraction(Node node, Interpolation interpolation, nl.tudelft.simulation.jstats.streams.StreamInterface random, OtsSimulatorInterface simulator)
      Constructor.
      Parameters:
      node - Node; node
      interpolation - Interpolation; interpolation
      random - StreamInterface; random stream
      simulator - OtsSimulatorInterface; simulator
  • Method Details

    • 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, GtuType gtuType, org.djunits.value.vdouble.vector.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 Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object