Class PopulationSizeCollector

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

public class PopulationSizeCollector extends Object implements Collector
Collects the population size and archive size, if available, from an EvolutionaryAlgorithm.
  • Constructor Details

    • PopulationSizeCollector

      public PopulationSizeCollector()
      Constructs an unattached collector for recording the population size and archive size, if available, from an EvolutionaryAlgorithm.
    • PopulationSizeCollector

      public PopulationSizeCollector(EvolutionaryAlgorithm algorithm)
      Constructs a collector for recording the population size and archive size, if available, from the specified EvolutionaryAlgorithm.
      Parameters:
      algorithm - the algorithm this collector records data from
  • Method Details

    • 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
    • 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
    • getPopulationSize

      public static int getPopulationSize(Observation observation)
      Reads the population size from the observation.
      Parameters:
      observation - the observation
      Returns:
      the population size
    • getArchiveSize

      public static int getArchiveSize(Observation observation)
      Reads the archive size from the observation.
      Parameters:
      observation - the observation
      Returns:
      the archive size