Class Observation

java.lang.Object
org.moeaframework.analysis.collector.Observation
All Implemented Interfaces:
Serializable, Comparable<Observation>

public class Observation extends Object implements Serializable, Comparable<Observation>
An observation records information about an algorithm at a point in time.
See Also:
  • Constructor Details

    • Observation

      public Observation(int nfe)
      Creates a new observation recorded at the given number of function evaluations.
      Parameters:
      nfe - the number of function evaluations
  • Method Details

    • getNFE

      public int getNFE()
      Returns the number of function evaluations during which this record was created.
      Returns:
      the number of function evaluations
    • keys

      public Set<String> keys()
      Returns the keys recorded in this observation.
      Returns:
      the keys
    • get

      public Serializable get(String key)
      Returns the value of the given key.
      Parameters:
      key - the key
      Returns:
      the value
      Throws:
      IllegalArgumentException - if no observation exists for the key
    • set

      public void set(String key, Serializable value)
      Sets the value of the given key. At a minimum, these values must be serializable to support saving these observations, but we recommend using primitive types (int, double, etc.) whenever possible for formatted output.
      Parameters:
      key - the key
      value - the value
    • compareTo

      public int compareTo(Observation other)
      Specified by:
      compareTo in interface Comparable<Observation>