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>
Parameter representing a Long value, ranging from -9223372036854775808L to 9223372036854775807L.
  • Constructor Details

    • SampledLong

      public SampledLong(String name, long lowerBound, long upperBound)
      Constructs a new long parameter with the given sampling bounds.
      Parameters:
      name - the parameter name
      lowerBound - the lower bound
      upperBound - the upper bound
  • Method Details

    • getLowerBound

      public Long getLowerBound()
      Description copied from interface: NumericParameter
      The lower bound of this parameter.
      Specified by:
      getLowerBound in interface NumericParameter<Long>
      Returns:
      the lower bound
    • getUpperBound

      public Long getUpperBound()
      Description copied from interface: NumericParameter
      The upper bound of this parameter.
      Specified by:
      getUpperBound in interface NumericParameter<Long>
      Returns:
      the upper bound
    • parse

      public Long parse(String str)
      Description copied from interface: Parameter
      Parses this parameter value from the given string.
      Specified by:
      parse in interface Parameter<Long>
      Parameters:
      str - the string
      Returns:
      the parameter value
    • sample

      public void sample(Sample sample, double scale)
      Description copied from interface: SampledParameter
      Samples this parameter and assigns the value to the sample. The scale is a value between 0.0 and 1.0, typically supplied by a Sequence, 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 interface SampledParameter<Long>
      Parameters:
      sample - the sample
      scale - value between 0.0 and 1.0 used to generate the sample
    • encode

      public String encode(Tokenizer tokenizer)
      Description copied from interface: Parameter
      Encodes this parameter definition in a format suitable for storing in a file.
      Specified by:
      encode in interface Parameter<Long>
      Parameters:
      tokenizer - the tokenizer
      Returns:
      the string representation
    • decode

      public static SampledLong decode(Tokenizer tokenizer, String line)
      Decodes the string representation of this parameter.
      Parameters:
      tokenizer - the tokenizer
      line - the string representation
      Returns:
      the decoded parameter
      Throws:
      InvalidParameterException - if the string representation is not a valid parameter