Class PopulationSizeCollector
java.lang.Object
org.moeaframework.analysis.runtime.PopulationSizeCollector
- All Implemented Interfaces:
Collector
Collects the population size and archive size, if available, from an
EvolutionaryAlgorithm.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an unattached collector for recording the population size and archive size, if available, from anEvolutionaryAlgorithm.PopulationSizeCollector(EvolutionaryAlgorithm algorithm) Constructs a collector for recording the population size and archive size, if available, from the specifiedEvolutionaryAlgorithm. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new instance of this collector which has been attached to the specified object as identified by the attach point returned throughCollector.getAttachPoint().voidcollect(ResultEntry result) Collects the requested information from the object, storing the data to the given result.static intgetArchiveSize(ResultEntry result) Reads the archive size from the result.Returns the attach point describing where this collector is attached.static intgetPopulationSize(ResultEntry result) Reads the population size from the result.
-
Constructor Details
-
PopulationSizeCollector
public PopulationSizeCollector()Constructs an unattached collector for recording the population size and archive size, if available, from anEvolutionaryAlgorithm. -
PopulationSizeCollector
Constructs a collector for recording the population size and archive size, if available, from the specifiedEvolutionaryAlgorithm.- Parameters:
algorithm- the algorithm this collector records data from
-
-
Method Details
-
getAttachPoint
Description copied from interface:CollectorReturns the attach point describing where this collector is attached. The matched object should be unique.- Specified by:
getAttachPointin interfaceCollector- Returns:
- the attach point describing where this collector is attached
-
attach
Description copied from interface:CollectorReturns a new instance of this collector which has been attached to the specified object as identified by the attach point returned throughCollector.getAttachPoint(). -
collect
Description copied from interface:CollectorCollects the requested information from the object, storing the data to the given result. This method must only be invoked after this collector has been attached to an appropriate object. -
getPopulationSize
Reads the population size from the result.- Parameters:
result- the result- Returns:
- the population size
-
getArchiveSize
Reads the archive size from the result.- Parameters:
result- the result- Returns:
- the archive size
-