Class IndicatorCollector
java.lang.Object
org.moeaframework.analysis.collector.IndicatorCollector
- All Implemented Interfaces:
Collector
Collects performance indicator values from an
Algorithm
.-
Constructor Summary
ConstructorDescriptionIndicatorCollector
(Indicator indicator) Constructs an unattached collector for recording performance indicator values from an algorithm.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.IndicatorCollector
(Indicator indicator, EpsilonBoxDominanceArchive archive, Algorithm algorithm) Constructs a collector for recording performance indicator values from the specified algorithm. -
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()
.void
collect
(Observation observation) Collects the requested information from the object, storing the data to the specified observation.Returns the attach point describing where this collector is attached.static <T extends Indicator>
doublegetIndicatorValue
(Observation observation, Class<T> type) Reads the indicator value from the observation.static double
getIndicatorValue
(Observation observation, String metric) Reads the indicator value from the observation.
-
Constructor Details
-
IndicatorCollector
Constructs an unattached collector for recording performance indicator values from an algorithm.- Parameters:
indicator
- the performance indicator used by this collector
-
IndicatorCollector
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 collectorarchive
- the ε-box dominance archive used to prune the approximation set to a desired resolution; ornull
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 collectorarchive
- the ε-box dominance archive used to prune the approximation set to a desired resolution; ornull
if no such pruning is usedalgorithm
- the algorithm this collector records data from
-
-
Method Details
-
collect
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. -
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 interfaceCollector
- Returns:
- the attach point describing where this collector is attached
-
attach
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 throughCollector.getAttachPoint()
. -
getIndicatorValue
Reads the indicator value from the observation.- Parameters:
observation
- the observationmetric
- 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 observationtype
- the class type of the indicator- Returns:
- the indicator value
-