Class InputParameterDistDiscrete
java.lang.Object
nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameter<DistDiscrete,DistDiscrete>
nl.tudelft.simulation.dsol.model.inputparameters.InputParameterDistDiscrete
- All Implemented Interfaces:
Serializable
,Cloneable
,InputParameter<DistDiscrete,
DistDiscrete>
InputParameterDistDiscrete provides a choice for a discrete distribution.
Copyright (c) 2003-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
Copyright (c) 2003-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
- Author:
- Alexander Verbraeck
- See Also:
-
Constructor Summary
ConstructorDescriptionInputParameterDistDiscrete
(String key, String shortName, String description, StreamInterface stream, DistDiscrete defaultValue, double displayPriority) Construct a new InputParameterDistDiscrete. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Provide the clone() method to make a deep copy.Retrieve the calculated value of the input parameter.void
setDistValue
(DistDiscrete dist) Set the value of the distribution.void
setStream
(StreamInterface stream) Methods inherited from class nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameter
getDefaultValue, getDescription, getDisplayPriority, getExtendedKey, getKey, getParent, getShortName, getValue, isReadOnly, setDefaultValue, setParent, setReadOnly, setValue, toString
-
Constructor Details
-
InputParameterDistDiscrete
public InputParameterDistDiscrete(String key, String shortName, String description, StreamInterface stream, DistDiscrete defaultValue, double displayPriority) throws InputParameterException Construct a new InputParameterDistDiscrete.- Parameters:
key
- String; unique (within the parent's input parameter map) name of the new InputParameterDistDiscreteshortName
- String; concise description of the input parameterdescription
- String; long description of the input parameter (may use HTML markup)stream
- StreamInterface; the random number stream to use for the chosen distributiondefaultValue
- DistDiscrete; the default value of this input parameterdisplayPriority
- double; sorting order when properties are displayed to the user- Throws:
NullPointerException
- when key, shortName, defaultValue, or description is nullInputParameterException
- in case the default value is not part of the listNullPointerException
- when key, shortName, defaultValue, description, or stream is nullIllegalArgumentException
- when displayPriority is NaN
-
-
Method Details
-
getCalculatedValue
Retrieve the calculated value of the input parameter. This is often the same as the value type, except in situations where a sub-map or sub-list calculates a different value. This is, for instance, the case with distribution functions where the parameters are present in a sub-map (the value) and the return type of the value is a distribution function class.- Returns:
- CT; the calculated value of the input parameter
- Throws:
InputParameterException
- when calculation fails
-
getStream
- Returns:
- stream
-
setStream
- Parameters:
stream
- StreamInterface; set stream- Throws:
NullPointerException
- when stream is null
-
setDistValue
Set the value of the distribution.- Parameters:
dist
- DistDiscrete; the distribution to set the value to- Throws:
NullPointerException
- when dist is nullInputParameterException
- when this InputParameter is read-only, or dist is not valid
-
clone
Provide the clone() method to make a deep copy.- Specified by:
clone
in interfaceInputParameter<DistDiscrete,
DistDiscrete> - Overrides:
clone
in classAbstractInputParameter<DistDiscrete,
DistDiscrete> - Returns:
- a deep copy of the InputParameter
-