Class SampledInteger
java.lang.Object
org.moeaframework.analysis.parameter.AbstractParameter<Integer>
org.moeaframework.analysis.parameter.SampledInteger
- All Implemented Interfaces:
NumericParameter<Integer>
,Parameter<Integer>
,SampledParameter<Integer>
,Named
public class SampledInteger
extends AbstractParameter<Integer>
implements SampledParameter<Integer>, NumericParameter<Integer>
-
Constructor Summary
ConstructorDescriptionSampledInteger
(String name, int lowerBound, int upperBound) Constructs a new integer parameter with the given sampling bounds. -
Method Summary
Modifier and TypeMethodDescriptionstatic SampledInteger
Decodes the string representation of this parameter.Encodes this parameter definition in a format suitable for storing in a file.The lower bound of this parameter.The upper bound of this parameter.Parses this parameter value from the given string.void
Samples this parameter and assigns the value to the sample.Methods inherited from class org.moeaframework.analysis.parameter.AbstractParameter
getName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.moeaframework.analysis.parameter.Parameter
assignValue, readValue
-
Constructor Details
-
SampledInteger
Constructs a new integer parameter with the given sampling bounds.- Parameters:
name
- the parameter namelowerBound
- the lower boundupperBound
- the upper bound
-
-
Method Details
-
getLowerBound
Description copied from interface:NumericParameter
The lower bound of this parameter.- Specified by:
getLowerBound
in interfaceNumericParameter<Integer>
- Returns:
- the lower bound
-
getUpperBound
Description copied from interface:NumericParameter
The upper bound of this parameter.- Specified by:
getUpperBound
in interfaceNumericParameter<Integer>
- Returns:
- the upper bound
-
parse
Description copied from interface:Parameter
Parses this parameter value from the given string. -
sample
Description copied from interface:SampledParameter
Samples this parameter and assigns the value to the sample. The scale is a value between0.0
and1.0
, typically supplied by aSequence
, used to generate the sampled value.When converting the scale to the parameter value, implementations are expected to provide equal weighting to each possible value, so that a value does not appear more or less often than any other value.
- Specified by:
sample
in interfaceSampledParameter<Integer>
- Parameters:
sample
- the samplescale
- value between0.0
and1.0
used to generate the sample
-
encode
Description copied from interface:Parameter
Encodes this parameter definition in a format suitable for storing in a file. -
decode
Decodes the string representation of this parameter.- Parameters:
tokenizer
- the tokenizerline
- the string representation- Returns:
- the decoded parameter
- Throws:
InvalidParameterException
- if the string representation is not a valid parameter
-