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
ConstructorsConstructorDescriptionSampledInteger(String name, int lowerBound, int upperBound) Constructs a new integer parameter with the given sampling bounds. -
Method Summary
Modifier and TypeMethodDescriptionstatic SampledIntegerDecodes 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.voidSamples this parameter and assigns the value to the sample.Methods inherited from class org.moeaframework.analysis.parameter.AbstractParameter
getName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:NumericParameterThe lower bound of this parameter.- Specified by:
getLowerBoundin interfaceNumericParameter<Integer>- Returns:
- the lower bound
-
getUpperBound
Description copied from interface:NumericParameterThe upper bound of this parameter.- Specified by:
getUpperBoundin interfaceNumericParameter<Integer>- Returns:
- the upper bound
-
parse
Description copied from interface:ParameterParses this parameter value from the given string. -
sample
Description copied from interface:SampledParameterSamples this parameter and assigns the value to the sample. The scale is a value between0.0and1.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:
samplein interfaceSampledParameter<Integer>- Parameters:
sample- the samplescale- value between0.0and1.0used to generate the sample
-
encode
Description copied from interface:ParameterEncodes 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
-