Class Distribution.FrequencyAndObject<O>
java.lang.Object
org.opentrafficsim.core.distributions.Distribution.FrequencyAndObject<O>
- Type Parameters:
O
- Type of the object returned by the draw method
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Distribution<O>
Immutable storage for a frequency (or probability) plus a Generator.
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
- See Also:
-
Constructor Summary
ConstructorDescriptionFrequencyAndObject
(double frequency, O object) Construct a new FrequencyAndObject instance. -
Method Summary
-
Constructor Details
-
FrequencyAndObject
Construct a new FrequencyAndObject instance.- Parameters:
frequency
- double; the (not cumulative) frequency (or probability) of the generatingObjectobject
- O; an object
-
-
Method Details
-
getFrequency
public final double getFrequency()Retrieve the frequency (or probability) of this FrequencyAndObject.- Returns:
- double; the frequency (or probability) of this FrequencyAndObject
-
getObject
Call the draw method of the generatingObject and return its result.- Returns:
- O; the result of a call to the draw method of the generatingObject
-
hashCode
public final int hashCode() -
equals
-
toString
-