|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.Analyzer
public class Analyzer
Performs basic end-of-run analysis. For example, the following demonstrates its typical use. First construct and configure the analyzer:
Analyzer analyzer = new Analyzer()
.withProblem("DTLZ2_2")
.includeGenerationalDistance()
.includeInvertedGenerationalDistance()
.includeAdditiveEpsilonIndicator()
.includeContribution()
.showAggregate()
.showStatisticalSignificance();
The problem must always be specified. Next, add the data to be analyzed:
Executor executor = new Executor().withProblem("DTLZ2_2");
add("NSGAII", executor.withAlgorithm("NSGAII").run());
add("eMOEA", executor.withAlgorithm("eMOEA").run());
Lastly, print the results of the analysis:
analyzer.printAnalysis();The output produced is compatible with the YAML format, and thus can be postprocessed easily with any YAML parser.
| Constructor Summary | |
|---|---|
Analyzer()
Constructs a new analyzer initialized with default settings. |
|
| Method Summary | |
|---|---|
Analyzer |
add(String name,
NondominatedPopulation result)
Adds a new sample with the specified name. |
Analyzer |
addAll(String name,
Collection<NondominatedPopulation> results)
Adds the collection of new samples with the specified name. |
Analyzer |
clear()
Clears all data stored in this analyzer. |
NondominatedPopulation |
getReferenceSet()
Returns the reference set used by this analyzer. |
Analyzer |
includeAdditiveEpsilonIndicator()
Enables the evaluation of the additive ε-indicator metric. |
Analyzer |
includeAllMetrics()
Enables the evaluation of all metrics. |
Analyzer |
includeContribution()
Enables the evaluation of the contribution metric. |
Analyzer |
includeGenerationalDistance()
Enables the evaluation of the generational distance metric. |
Analyzer |
includeHypervolume()
Enables the evaluation of the hypervolume metric. |
Analyzer |
includeInvertedGenerationalDistance()
Enables the evaluation of the inverted generational distance metric. |
Analyzer |
includeMaximumParetoFrontError()
Enables the evaluation of the maximum Pareto front error metric. |
Analyzer |
includeR1()
Enables the evaluation of the R1 indicator. |
Analyzer |
includeR2()
Enables the evaluation of the R2 indicator. |
Analyzer |
includeR3()
Enables the evaluation of the R3 indicator. |
Analyzer |
includeSpacing()
Enables the evaluation of the spacing metric. |
Analyzer |
loadAs(String name,
File resultFile)
Loads the samples stored in a result file using ResultFileReader. |
Analyzer |
loadData(File directory,
String prefix,
String suffix)
Loads data into this analyzer, which was previously saved using saveData(File, String, String) with matching arguments. |
Analyzer |
printAnalysis()
Prints the analysis of all data recorded in this analyzer to standard output. |
Analyzer |
printAnalysis(PrintStream ps)
Prints the analysis of all data recorded in this analyzer. |
Analyzer |
saveAnalysis(File file)
Saves the analysis of all data recorded in this analyzer to the specified file. |
Analyzer |
saveAs(String name,
File resultFile)
Saves the samples to a result file using ResultFileWriter. |
Analyzer |
saveData(File directory,
String prefix,
String suffix)
Saves all data stored in this analyzer, which can subsequently be read using loadData(File, String, String) with matching arguments. |
Analyzer |
saveReferenceSet(File file)
Saves the reference set to the specified file. |
Analyzer |
showAggregate()
Enables the output of the metric value of the aggregate approximation set, produced by merging all individual seeds. |
Analyzer |
showAll()
Enables the output of all analysis results. |
Analyzer |
showIndividualValues()
Enables the output of individual metric values for each seed. |
Analyzer |
showStatistic(org.apache.commons.math3.stat.descriptive.UnivariateStatistic statistic)
Specifies the UnivariateStatistics calculated during the
analysis. |
Analyzer |
showStatisticalSignificance()
Enables the output of statistical significance tests. |
Analyzer |
usingProblemFactory(ProblemFactory problemFactory)
Sets the problem factory used by this builder. |
Analyzer |
withEpsilon(double... epsilon)
Sets the ε values used by this builder, specifying the archive returned by newArchive(). |
Analyzer |
withProblem(String problemName)
Sets the problem used by this builder. |
Analyzer |
withProblemClass(Class<?> problemClass,
Object... problemArguments)
Sets the problem used by this builder. |
Analyzer |
withProblemClass(String problemClassName,
Object... problemArguments)
Sets the problem used by this builder. |
Analyzer |
withReferenceSet(File referenceSetFile)
Sets the file containing the reference set to be used by this builder. |
Analyzer |
withSameProblemAs(org.moeaframework.ProblemBuilder builder)
Configures this builder to use the same problem, reference set, ε values and ProblemFactory as the specified instance. |
Analyzer |
withSignifianceLevel(double significanceLevel)
Sets the level of significance used when testing the statistical significance of observed differences in the medians. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Analyzer()
| Method Detail |
|---|
public Analyzer withSameProblemAs(org.moeaframework.ProblemBuilder builder)
ProblemFactory as the specified instance.
builder - the instance whose problem, reference set, ε
values and ProblemFactory are to be copied
public Analyzer usingProblemFactory(ProblemFactory problemFactory)
problemFactory - the problem factory
public Analyzer withProblem(String problemName)
problemName - the problem name
public Analyzer withProblemClass(Class<?> problemClass,
Object... problemArguments)
Class.newInstance() method. Ensure the problem
class satisfies all the conditions of newInstance(), otherwise
exceptions may be thrown when attempting to create an instance of the
problem.
problemClass - the problem classproblemArguments - the arguments passed to the problem constructor
public Analyzer withProblemClass(String problemClassName,
Object... problemArguments)
throws ClassNotFoundException
Class.newInstance() method. Ensure the problem
class satisfies all the conditions of newInstance(), otherwise
exceptions may be thrown when attempting to create an instance of the
problem.
problemClassName - the problem class nameproblemArguments - the arguments passed to the problem constructor
ClassNotFoundException - if the specified problem class name could
not be foundpublic Analyzer withEpsilon(double... epsilon)
newArchive().
epsilon - the ε values
public Analyzer withReferenceSet(File referenceSetFile)
referenceSetFile - the reference set file
public Analyzer includeHypervolume()
public Analyzer includeGenerationalDistance()
public Analyzer includeInvertedGenerationalDistance()
public Analyzer includeAdditiveEpsilonIndicator()
public Analyzer includeMaximumParetoFrontError()
public Analyzer includeSpacing()
public Analyzer includeContribution()
public Analyzer includeR1()
public Analyzer includeR2()
public Analyzer includeR3()
public Analyzer includeAllMetrics()
public Analyzer showAll()
public Analyzer showIndividualValues()
public Analyzer showAggregate()
public Analyzer showStatisticalSignificance()
public Analyzer showStatistic(org.apache.commons.math3.stat.descriptive.UnivariateStatistic statistic)
UnivariateStatistics calculated during the
analysis. If none are specified by the user, then Min,
Median and Max are used.
statistic - the statistic to calculate
public Analyzer withSignifianceLevel(double significanceLevel)
0.05 and 0.01.
significanceLevel - the level of significance
public Analyzer addAll(String name,
Collection<NondominatedPopulation> results)
name - the name of these samplesresults - the approximation sets
public Analyzer add(String name,
NondominatedPopulation result)
name - the name of this sampleresult - the approximation set
public Analyzer saveData(File directory,
String prefix,
String suffix)
throws IOException
loadData(File, String, String) with matching arguments.
directory - the directory in which the data is storedprefix - the prefix for filenamessuffix - the suffix (extension) for filenames
IOException - if an I/O error occurred
public Analyzer loadData(File directory,
String prefix,
String suffix)
throws IOException
saveData(File, String, String) with matching arguments.
directory - the directory in which the data is storedprefix - the prefix for filenamessuffix - the suffix (extension) for filenames
IOException - if an I/O error occurred
public Analyzer loadAs(String name,
File resultFile)
throws IOException
ResultFileReader.
name - the name of the samplesresultFile - the result file to load
IOException - if an I/O error occurred
public Analyzer saveAs(String name,
File resultFile)
throws IOException
ResultFileWriter. If
name is null, the reference set is saved. Otherwise,
the approximation sets for the named entries are saved.
name - the name of the samplesresultFile - the result file to which the data is saved
IOException - if an I/O error occurred
public Analyzer saveAnalysis(File file)
throws IOException
file - the file to which the analysis is saved
IOException - if an I/O error occurred
public Analyzer printAnalysis()
throws IOException
IOException - if an I/O error occurred
public Analyzer saveReferenceSet(File file)
throws IOException
file - the file to which the reference set is saved
IOException - if an I/O error occurredgetReferenceSet()public NondominatedPopulation getReferenceSet()
withReferenceSet(File) has been set, the contents of
the reference set file are returned;
ProblemFactory.getReferenceSet(String) method, this
reference set is returned;
IllegalArgumentException - if the reference set could not be loaded
public Analyzer printAnalysis(PrintStream ps)
throws IOException
ps - the stream to which the analysis is written
IOException - if an I/O error occurredpublic Analyzer clear()
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||