Package org.moeaframework.analysis.tools
Class ReferenceSetMerger
java.lang.Object
org.moeaframework.util.CommandLineUtility
org.moeaframework.analysis.tools.ReferenceSetMerger
Utility for merging two or more populations identified by unique sources and determining the contribution of each
source to the combined non-dominated population. A command line interface is also provided.
-
Constructor Summary
ConstructorDescriptionClass constructor for merging populations and determining which contributed to the resulting non-dominated population.ReferenceSetMerger
(NondominatedPopulation combinedPopulation) Class constructor for merging population and determining which contributed to the resulting non-dominated population. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String source, Population population) Adds the population from the specified source.Returns the combined non-dominated population.getContributionFrom
(String source) Returns the solutions in the combined non-dominated population originating from the specified source.org.apache.commons.cli.Options
Returns the options made available by this command line utility.getPopulation
(String source) Returns the original population associated with the specified source.Returns the sources that have been added to the combined non-dominated population.static void
Starts the command line utility for merging two or more sets.void
run
(org.apache.commons.cli.CommandLine commandLine) Runs this command line utility with the specified command line arguments.Methods inherited from class org.moeaframework.util.CommandLineUtility
getCommandString, getLocalizedOptions, setCommandString, showHelp, start
-
Constructor Details
-
ReferenceSetMerger
public ReferenceSetMerger()Class constructor for merging populations and determining which contributed to the resulting non-dominated population. -
ReferenceSetMerger
Class constructor for merging population and determining which contributed to the resulting non-dominated population.- Parameters:
combinedPopulation
- an (empty) population for maintaining non-dominated solutions
-
-
Method Details
-
add
Adds the population from the specified source.- Parameters:
source
- the source of the populationpopulation
- the population- Throws:
IllegalArgumentException
- if a population has been added previously with the specified source
-
getCombinedPopulation
Returns the combined non-dominated population.- Returns:
- the combined non-dominated population
-
getSources
Returns the sources that have been added to the combined non-dominated population.- Returns:
- the sources that have been added to the combined non-dominated population
-
getPopulation
Returns the original population associated with the specified source.- Parameters:
source
- the source- Returns:
- the original population associated with the specified source
-
getContributionFrom
Returns the solutions in the combined non-dominated population originating from the specified source.- Parameters:
source
- the source whose solutions in the combined non-dominated population are returned- Returns:
- the solutions in the combined non-dominated population originating from the specified source
-
getOptions
public org.apache.commons.cli.Options getOptions()Description copied from class:CommandLineUtility
Returns the options made available by this command line utility. The base implementation automatically provides the-h,--help
option. Implementations overriding this method and begin with a call tosuper.getOptions()
.- Overrides:
getOptions
in classCommandLineUtility
- Returns:
- the options made available by this command line utility
-
run
Description copied from class:CommandLineUtility
Runs this command line utility with the specified command line arguments.- Specified by:
run
in classCommandLineUtility
- Parameters:
commandLine
- the command line arguments- Throws:
Exception
- if any exception occurred while running this command
-
main
Starts the command line utility for merging two or more sets.- Parameters:
args
- the command line arguments- Throws:
Exception
- if an error occurred
-