Class SampledLong
java.lang.Object
org.moeaframework.analysis.parameter.AbstractParameter<Long>
org.moeaframework.analysis.parameter.SampledLong
- All Implemented Interfaces:
NumericParameter<Long>,Parameter<Long>,SampledParameter<Long>,Named
public class SampledLong
extends AbstractParameter<Long>
implements SampledParameter<Long>, NumericParameter<Long>
-
Constructor Summary
ConstructorsConstructorDescriptionSampledLong(String name, long lowerBound, long upperBound) Constructs a new long parameter with the given sampling bounds. -
Method Summary
Modifier and TypeMethodDescriptionstatic SampledLongDecodes 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
-
SampledLong
Constructs a new long 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<Long>- Returns:
- the lower bound
-
getUpperBound
Description copied from interface:NumericParameterThe upper bound of this parameter.- Specified by:
getUpperBoundin interfaceNumericParameter<Long>- 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<Long>- 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
-