DiscreteDistSpeed.java

  1. package org.opentrafficsim.core.units.distributions;

  2. import org.djunits.unit.SpeedUnit;
  3. import org.djunits.value.vdouble.scalar.Speed;

  4. import nl.tudelft.simulation.jstats.distributions.DistDiscrete;

  5. /**
  6.  * Discretely distributed speed.
  7.  * <p>
  8.  * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  9.  * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  10.  * </p>
  11.  * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
  12.  */
  13. // This class was automatically generated
  14. public class DiscreteDistSpeed extends DiscreteDistDoubleScalar.Rel<Speed, SpeedUnit>
  15. {

  16.     /** */
  17.     private static final long serialVersionUID = 20180829L;

  18.     /**
  19.      * @param distribution distribution
  20.      * @param unit units
  21.      */
  22.     public DiscreteDistSpeed(final DistDiscrete distribution, final SpeedUnit unit)
  23.     {
  24.         super(distribution, unit);

  25.     }

  26.     @Override
  27.     public Speed draw()
  28.     {
  29.         return new Speed(getDistribution().draw(), (SpeedUnit) getUnit());
  30.     }

  31.     @Override
  32.     public final String toString()
  33.     {
  34.         return "DiscreteDistSpeed []";
  35.     }

  36. }