Class Observations

java.lang.Object
org.moeaframework.analysis.collector.Observations
All Implemented Interfaces:
Serializable, Iterable<Observation>, Displayable, Formattable<Observation>

public class Observations extends Object implements Serializable, Iterable<Observation>, Formattable<Observation>
The observations collected over the course of a single algorithm run.
See Also:
  • Constructor Details

    • Observations

      public Observations()
      Constructs an empty observations object.
  • Method Details

    • add

      public void add(Observation observation)
      Adds a new observation to this collection.
      Parameters:
      observation - the observation
    • size

      public int size()
      Returns the number of observations recorded.
      Returns:
      the number of observations
    • isEmpty

      public boolean isEmpty()
      Returns true if this collection of observations is empty; false otherwise.
      Returns:
      true if this collection of observations is empty; false otherwise
    • keys

      public Set<String> keys()
      Returns the keys - the name of individual observations - that have been recorded. This assumes that each recorded observation contains identical keys.
      Returns:
      the keys
    • first

      public Observation first()
      Returns the first observation.
      Returns:
      the first observation
    • last

      public Observation last()
      Returns the last observation.
      Returns:
      the last observation
    • at

      public Observation at(int NFE)
      Returns the observation at the specified NFE. If there is no exact match, it returns the next largest NFE. If at the end of the list, returns null.
      Parameters:
      NFE - the NFE to locate
      Returns:
      the matching observation
    • iterator

      public Iterator<Observation> iterator()
      Specified by:
      iterator in interface Iterable<Observation>
    • asTabularData

      public TabularData<Observation> asTabularData()
      Description copied from interface: Formattable
      Returns the contents of this object as a TabularData instance, which can be used to save, print, or format the data in various ways.
      Specified by:
      asTabularData in interface Formattable<Observation>
      Returns:
      the TabularData instance