MOEA Framework 2.12
API Specification

org.moeaframework.util
Class ReferenceSetMerger

java.lang.Object
  extended by org.moeaframework.util.CommandLineUtility
      extended by org.moeaframework.util.ReferenceSetMerger

public class ReferenceSetMerger
extends CommandLineUtility

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.


Field Summary
static String SOURCE_ATTRIBUTE
          The attribute key used to store the file from which each solution originated.
 
Constructor Summary
ReferenceSetMerger()
          Class 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
 void add(String source, Population population)
          Adds the population from the specified source.
 NondominatedPopulation getCombinedPopulation()
          Returns the combined non-dominated population.
 NondominatedPopulation getContributionFrom(String source)
          Returns the solutions in the combined non-dominated population originating from the specified source.
 org.apache.commons.cli.Options getOptions()
          Returns the options made available by this command line utility.
 Population getPopulation(String source)
          Returns the original population associated with the specified source.
 Set<String> getSources()
          Returns the sources that have been added to the combined non-dominated population.
static void main(String[] args)
          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, setCommandString, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCE_ATTRIBUTE

public static final String SOURCE_ATTRIBUTE
The attribute key used to store the file from which each solution originated.

See Also:
Constant Field Values
Constructor Detail

ReferenceSetMerger

public ReferenceSetMerger()
Class constructor for merging populations and determining which contributed to the resulting non-dominated population.


ReferenceSetMerger

public ReferenceSetMerger(NondominatedPopulation combinedPopulation)
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 Detail

add

public void add(String source,
                Population population)
Adds the population from the specified source.

Parameters:
source - the source of the population
population - the population
Throws:
IllegalArgumentException - if a population has been added previously with the specified source

getCombinedPopulation

public NondominatedPopulation getCombinedPopulation()
Returns the combined non-dominated population.

Returns:
the combined non-dominated population

getSources

public Set<String> 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

public Population getPopulation(String source)
Returns the original population associated with the specified source.

Parameters:
source - the source
Returns:
the original population associated with the specified source

getContributionFrom

public NondominatedPopulation getContributionFrom(String source)
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 to super.getOptions().

Overrides:
getOptions in class CommandLineUtility
Returns:
the options made available by this command line utility

run

public void run(org.apache.commons.cli.CommandLine commandLine)
         throws Exception
Description copied from class: CommandLineUtility
Runs this command line utility with the specified command line arguments.

Specified by:
run in class CommandLineUtility
Parameters:
commandLine - the command line arguments
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Starts the command line utility for merging two or more sets.

Parameters:
args - the command line arguments
Throws:
Exception - if an error occurred

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!