Class IndicatorCollector

java.lang.Object
org.moeaframework.analysis.collector.IndicatorCollector
All Implemented Interfaces:
Collector

public class IndicatorCollector extends Object implements Collector
Collects performance indicator values from an Algorithm.
  • Constructor Details

    • IndicatorCollector

      public IndicatorCollector(Indicator indicator)
      Constructs an unattached collector for recording performance indicator values from an algorithm.
      Parameters:
      indicator - the performance indicator used by this collector
    • IndicatorCollector

      public IndicatorCollector(Indicator indicator, EpsilonBoxDominanceArchive archive)
      Constructs an unattached collector for recording performance indicator values from an algorithm, with an ε-box dominance archive to prune the approximation set to a desired resolution.
      Parameters:
      indicator - the performance indicator used by this collector
      archive - the ε-box dominance archive used to prune the approximation set to a desired resolution; or null if no such pruning is used
    • IndicatorCollector

      public IndicatorCollector(Indicator indicator, EpsilonBoxDominanceArchive archive, Algorithm algorithm)
      Constructs a collector for recording performance indicator values from the specified algorithm.
      Parameters:
      indicator - the performance indicator used by this collector
      archive - the ε-box dominance archive used to prune the approximation set to a desired resolution; or null if no such pruning is used
      algorithm - the algorithm this collector records data from
  • Method Details

    • collect

      public void collect(Observation observation)
      Description copied from interface: Collector
      Collects the requested information from the object, storing the data to the specified observation. This method must only be invoked after this collector has been attached to an appropriate object.
      Specified by:
      collect in interface Collector
      Parameters:
      observation - the observation to which the collected data is stored
    • getAttachPoint

      public AttachPoint getAttachPoint()
      Description copied from interface: Collector
      Returns the attach point describing where this collector is attached. The matched object should be unique.
      Specified by:
      getAttachPoint in interface Collector
      Returns:
      the attach point describing where this collector is attached
    • attach

      public Collector attach(Object object)
      Description copied from interface: Collector
      Returns a new instance of this collector which has been attached to the specified object as identified by the attach point returned through Collector.getAttachPoint().
      Specified by:
      attach in interface Collector
      Parameters:
      object - the matching object
      Returns:
      a new instance of this collector which has been attached to the specified object
    • getIndicatorValue

      public static double getIndicatorValue(Observation observation, String metric)
      Reads the indicator value from the observation.
      Parameters:
      observation - the observation
      metric - the name of the indicator or metric
      Returns:
      the indicator value
    • getIndicatorValue

      public static <T extends Indicator> double getIndicatorValue(Observation observation, Class<T> type)
      Reads the indicator value from the observation.
      Type Parameters:
      T - the type of indicator
      Parameters:
      observation - the observation
      type - the class type of the indicator
      Returns:
      the indicator value