Class InstrumentedExtension
java.lang.Object
org.moeaframework.algorithm.extension.PeriodicExtension
org.moeaframework.analysis.runtime.InstrumentedExtension
Decorates an algorithm to periodically collect information about its runtime behavior. The NFE and result are
automatically recorded by this extension.
-
Field Summary
Fields inherited from class org.moeaframework.algorithm.extension.PeriodicExtension
frequency, iteration, lastInvocation -
Constructor Summary
ConstructorsConstructorDescriptionInstrumentedExtension(Frequency frequency) Decorates the specified algorithm to periodically collect information about its runtime behavior. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCollector(Collector collector) Adds a collector to this instrumented algorithm.voidThe action that is called by this extension.Returns the data collected from this algorithm, which is a series of results collected at the defined frequency.voidloadState(ObjectInputStream stream) Loads the state of this object from the stream.voidsaveState(ObjectOutputStream stream) Writes the state of this object to the stream.Methods inherited from class org.moeaframework.algorithm.extension.PeriodicExtension
onRegister, onStepMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.moeaframework.algorithm.extension.Extension
onInitialize, onRun, onTerminate
-
Constructor Details
-
InstrumentedExtension
Decorates the specified algorithm to periodically collect information about its runtime behavior.- Parameters:
frequency- the frequency that data is collected
-
-
Method Details
-
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 data collected from this algorithm, which is a series of results collected at the defined frequency.- Returns:
- the result series
-
doAction
Description copied from class:PeriodicExtensionThe action that is called by this extension.- Specified by:
doActionin classPeriodicExtension- Parameters:
algorithm- the algorithm associated with this extension
-
saveState
Description copied from interface:StatefulWrites the state of this object to the stream. The order that objects are written to the stream is important. We recommend first callingsuper.saveState(stream)followed by writing each field.- Specified by:
saveStatein interfaceStateful- Overrides:
saveStatein classPeriodicExtension- Parameters:
stream- the stream- Throws:
IOException- if an I/O error occurred
-
loadState
Description copied from interface:StatefulLoads the state of this object from the stream. The order for reading objects from the stream must match the order they are written to the stream inStateful.saveState(ObjectOutputStream).- Specified by:
loadStatein interfaceStateful- Overrides:
loadStatein classPeriodicExtension- Parameters:
stream- the stream- Throws:
IOException- if an I/O error occurredClassNotFoundException- if the stream referenced a class that is not defined
-