public class ArrivalsHeadwayGenerator extends Object implements org.opentrafficsim.core.distributions.Generator<org.djunits.value.vdouble.scalar.Duration>
Arrivals.
 
 Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. 
 BSD-style license. See OpenTrafficSim License.
 
| Modifier and Type | Class and Description | 
|---|---|
static interface  | 
ArrivalsHeadwayGenerator.HeadwayDistribution
Headway distribution. 
 | 
| Constructor and Description | 
|---|
ArrivalsHeadwayGenerator(Arrivals arrivals,
                        org.opentrafficsim.core.dsol.OTSSimulatorInterface simulator,
                        nl.tudelft.simulation.jstats.streams.StreamInterface stream,
                        ArrivalsHeadwayGenerator.HeadwayDistribution distribution)  | 
| Modifier and Type | Method and Description | 
|---|---|
org.djunits.value.vdouble.scalar.Duration | 
draw()
Returns a new headway  
h assuming that the previous vehicle arrived at the current time t0. | 
public ArrivalsHeadwayGenerator(Arrivals arrivals, org.opentrafficsim.core.dsol.OTSSimulatorInterface simulator, nl.tudelft.simulation.jstats.streams.StreamInterface stream, ArrivalsHeadwayGenerator.HeadwayDistribution distribution)
arrivals - Arrivals; arrivalssimulator - OTSSimulatorInterface; simulatorstream - StreamInterface; random stream to draw headwaydistribution - HeadwayDistribution; random headway distributionpublic org.djunits.value.vdouble.scalar.Duration draw()
                                               throws org.opentrafficsim.core.distributions.ProbabilityException,
                                                      org.opentrafficsim.base.parameters.ParameterException
h assuming that the previous vehicle arrived at the current time t0. The vehicle
 thus arrives at t1 = t0 + h. This method guarantees that no vehicle arrives during periods where demand is zero,
 while maintaining random headways based on average demand over a certain time period.h such that the integral of the demand pattern D from t0 until
 t1 equals r: ΣD(t0 > t1) = r. One can think of r as being 1 and representing an
 additional vehicle to arrive. The headway h that results correlates directly to the mean demand between
 t0 and t1.r always has a mean of 1, but may vary between specific vehicle arrivals depending on the headway
 distribution. When assuming constant headways for any given demand level, r always equals 1. For exponentially
 distributed headways r may range anywhere between 0 and infinity.r guarantees that no vehicles arrive during periods with 0 demand. For example:
 r < 0.5 (stepwise demand) or 0.25
 (linear demand), a vehicle will simply arrive between 299s and 300s.draw in interface org.opentrafficsim.core.distributions.Generator<org.djunits.value.vdouble.scalar.Duration>org.opentrafficsim.core.distributions.ProbabilityException - if the stored collection is emptyorg.opentrafficsim.base.parameters.ParameterException - in case of a parameter exceptionCopyright © 2014–2018 Delft University of Technology. All rights reserved.