Class InstrumentedAlgorithm<T extends Algorithm>
java.lang.Object
org.moeaframework.algorithm.extension.AlgorithmWrapper<T>
org.moeaframework.analysis.runtime.InstrumentedAlgorithm<T>
- Type Parameters:
T
- the type of the algorithm
- All Implemented Interfaces:
Algorithm
,Extensible
,Configurable
,Named
,Stateful
Wraps an algorithm to indicate it is instrumented to collect runtime data.
-
Constructor Summary
ConstructorDescriptionInstrumentedAlgorithm
(T algorithm) Wraps the given algorithm to create an instrumented version. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCollector
(Collector collector) Adds a collector to this instrumented algorithm.Returns the collected runtime data as a result series.registerExtension
(Frequency frequency) Registers the extension with the algorithm if one does not already exist.Methods inherited from class org.moeaframework.algorithm.extension.AlgorithmWrapper
evaluate, getAlgorithm, getExtensions, getName, getNumberOfEvaluations, getProblem, getResult, initialize, isInitialized, isTerminated, loadState, saveState, step, terminate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.algorithm.Algorithm
evaluateAll, evaluateAll, run, run
Methods inherited from interface org.moeaframework.core.configuration.Configurable
applyConfiguration, getConfiguration
Methods inherited from interface org.moeaframework.algorithm.extension.Extensible
addExtension, removeExtension
-
Constructor Details
-
InstrumentedAlgorithm
Wraps the given algorithm to create an instrumented version.- Parameters:
algorithm
- the algorithm
-
-
Method Details
-
registerExtension
Registers the extension with the algorithm if one does not already exist.- Parameters:
frequency
- the frequency- Returns:
- the extension
-
addCollector
Adds a collector to this instrumented algorithm. The collector should have already been attached to the algorithm.- Parameters:
collector
- the collector
-
getSeries
Returns the collected runtime data as a result series. Each result entry contains the approximation set fromAlgorithm.getResult()
along with any properties stored by the collectors.- Returns:
- the result series
-