Class Observations
java.lang.Object
org.moeaframework.analysis.collector.Observations
- All Implemented Interfaces:
Serializable
,Iterable<Observation>
,Displayable
,Formattable<Observation>
public class Observations
extends Object
implements Serializable, Iterable<Observation>, Formattable<Observation>
The observations collected over the course of a single algorithm run.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Observation observation) Adds a new observation to this collection.Returns the contents of this object as aTabularData
instance, which can be used to save, print, or format the data in various ways.at
(int NFE) Returns the observation at the specified NFE.first()
Returns the first observation.boolean
isEmpty()
Returnstrue
if this collection of observations is empty;false
otherwise.iterator()
keys()
Returns the keys - the name of individual observations - that have been recorded.last()
Returns the last observation.int
size()
Returns the number of observations recorded.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.util.format.Displayable
display
Methods inherited from interface org.moeaframework.util.format.Formattable
display, display, display, save, saveCSV
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Observations
public Observations()Constructs an empty observations object.
-
-
Method Details
-
add
Adds a new observation to this collection.- Parameters:
observation
- the observation
-
size
public int size()Returns the number of observations recorded.- Returns:
- the number of observations
-
isEmpty
public boolean isEmpty()Returnstrue
if this collection of observations is empty;false
otherwise.- Returns:
true
if this collection of observations is empty;false
otherwise
-
keys
Returns the keys - the name of individual observations - that have been recorded. This assumes that each recorded observation contains identical keys.- Returns:
- the keys
-
first
Returns the first observation.- Returns:
- the first observation
-
last
Returns the last observation.- Returns:
- the last observation
-
at
Returns the observation at the specified NFE. If there is no exact match, it returns the next largest NFE. If at the end of the list, returnsnull
.- Parameters:
NFE
- the NFE to locate- Returns:
- the matching observation
-
iterator
- Specified by:
iterator
in interfaceIterable<Observation>
-
asTabularData
Description copied from interface:Formattable
Returns the contents of this object as aTabularData
instance, which can be used to save, print, or format the data in various ways.- Specified by:
asTabularData
in interfaceFormattable<Observation>
- Returns:
- the
TabularData
instance
-