jMetal

jMetal stands for Metaheuristic Algorithms in Java, and it is an object-oriented Java-based framework for multi-objective optimization with metaheuristics.

Warning

Documentation is WIP!! Some information may be missing.

Contributing

Contributions to the jMetal project are welcome. Please, take into account the following guidelines (all developers should follow these guidelines):

Git WorkFlow

We have a set of branches on the remote Git server. Some branches are temporary, and others are constant throughout the life of the repository.

  • Branches always present in the repository:
    • master: You have the latest released to production, receive merges from the develop branch, or merge from a hotfix branch (emergency).
      • Do I have to put a TAG when doing a merge from develop to master? yes
      • Do I have to put a TAG when doing a merge from a hotfix branch to master? yes
      • After merge from a hotfix to master, do I have to merge from master to develop? yes
    • develop: It is considered the “Next Release”, receives merges from branches of each developer, either corrections (fix) or new features (feature).
  • Temporary branches:
    • feature/<task-id>-<description>: When we are doing a development, we create a local branch with the prefix “feature/”, then only if there is a task id, we indicate it and we add a hyphen. The following we indicate a description according to the functionality that we are developing. The words are separated by hyphens.
      • Where does this branch emerge? This branch always emerge from the develop branch
      • When I finish the development in my feature branch, which branch to merge into?: You always merge feature branch into develop branch
    • fix/<task-id>-<description>: When we are making a correction, we create a local branch with the prefix “fix/”, then only if there is a task id, we indicate it and we add a hyphen. The following we indicate a description according to the functionality that we are correcting. The words are separated by hyphens.
      • Where does this branch emerge? This branch always emerge from the develop branch
      • When I finish the correction in my fix branch, which branch to merge into?: You always merge feature branch into develop branch
    • hotfix/<task-id>-<description>: When we are correcting an emergency incidence in production, we create a local branch with the prefix “hotfix/”, then only if there is a task id, we indicate it and we add a hyphen. The following we indicate a description according to the functionality that we are correcting. The words are separated by hyphens.
      • Where does this branch emerge?: This branch always emerge from the master branch
      • When I finish the correction in my hotfix branch, which branch to merge into?: This branch always emerge from the master and develop branch
  • Steps to follow when you are creating or going to work on a branch of any kind (feature / fix / hotfix):
    1. After you create your branch (feature / fix / hotfix) locally, upload it to the remote Git server. The integration system will verify your code from the outset.
    2. Each time you commit, as much as possible, you send a push to the server. Each push will trigger the automated launch of the tests, etc.
    3. Once the development is finished, having done a push to the remote Git server, and that the test phase has passed without problem, you create an pull request.

Note

Do not forget to remove your branch (feature / fix / hotfix) once the merge has been made.

Some useful Git commands:

  • git fetch –prune: Cleaning branches removed and bringing new branches

Installation steps

Requirements

jMetal is implemented in Java. Since version 5.2, we are using features of Java 8, so a Java 8 JDK or higher is required to compile the project.

As jMetal is a Maven project, this tool is also a requirement to compile, test and package the code.

Optionally, R and Latex are needed if you use the code to carry out experimental studies to run the R scripts and compile the Latex files that will be generated.

Compiling

Once you have the source code of jMetal you can use it in to ways: from an IDE or from the command line of a terminal. The IDE alternative is the simplest one and, if you are used to the tool, compiling and running algorithms is easy.

IntelliJ Idea

To build the project you have to select Build -> Make Project

Building with IntelliJ Idea

Eclipse

If the Project -> Build Automatically is set, Eclipse will automatically build the project. Otherwise, select Project -> Build Project

Building with Eclipse

Netbeans

In Netbeans you have to select Run -> Build Project

Building with Netbeans

Building from the command line

Once you have downloaded the source code you can use the command line to build the project by using Maven commands. If you open a terminal you will have something similar to this:

jMetal in a terminal

Then you have Maven to your disposal to work with the project:

  • mvn clean: cleaning the project
  • mvn compile: compiling
  • mvn test: testing
  • mvn package: compiling, testing, generating documentation, and packaging in jar files
  • mvn site: generates a site for the project

Getting started

The Algorithm interface

A metaheuristic or algorithm in jMetal 5 is an entity that implements the Algorithm interface:

package org.uma.jmetal.algorithm;

/**
 * Interface representing an algorithm
 * @author Antonio J. Nebro
 * @version 0.1
 * @param <Result> Result
 */
public interface Algorithm<Result> extends Runnable {
  void run() ;
  Result getResult() ;
}

This interface is very generic: it specifies that an algorithm must have a run() method and return a result by the getResult() method. As it extends Runnable, any algorithm can be executed in a thread.

The symplicity of Algorithm offers plenty of freedom to implement a metaheuristic according to your favorite preferences. However, as jMetal 5 is a framework it includes a set of resources and strategies to help in the implementation of algorithms with the idea of promoting good design, code reusing, and flexibility. The key components are the use of the builder pattern and algorithm templates. In the next section we give a detailed description of how the well-known NSGA-II algorithm is implemented, configured, and extended.

Case study: NSGA-II

NSGA-II is a genetic algorithm (GA), i.e. it belongs to the evolutionary algorithms (EAs) family. The implementation of NSGA-II provided in jMetal 5.0 follows the evolutionary algorithm template described in the algorithm templates section of the documentation. This means that it must define the methods of the AbstractEvolutionaryAlgorithm class. According to this template, the flow control of the algorithm is defined in the run() method:

@Override public void run() {
    List<S> offspringPopulation;
    List<S> matingPopulation;

    population = createInitialPopulation();
    population = evaluatePopulation(population);
    initProgress();
    while (!isStoppingConditionReached()) {
      matingPopulation = selection(population);
      offspringPopulation = reproduction(matingPopulation);
      offspringPopulation = evaluatePopulation(offspringPopulation);
      population = replacement(population, offspringPopulation);
      updateProgress();
    }
  }

We describe next how these methods are implemented in the NSGAII class.

The class declaration is as follows:

public class NSGAII<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>> {
   ...
}

which indicates that it extends the AbstractGeneticAlgorithm. The generic S allows to specify the encoding of the solutions that will manipulate the algorithm, and it will determine the kind of problems that can be solved as well as the operators that can be used. This is exemplified in the class constructor:

 public NSGAII(Problem<S> problem, int maxIterations, int populationSize,
      CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator,
      SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator) {
    super() ;
    this.problem = problem;
    this.maxIterations = maxIterations;
    this.populationSize = populationSize;

    this.crossoverOperator = crossoverOperator;
    this.mutationOperator = mutationOperator;
    this.selectionOperator = selectionOperator;

    this.evaluator = evaluator;
  }

The constructor parameter contains:

  • The problem to solve.
  • The main algorithm parameters: the population size and the maximum number of iterations.
  • The genetic operators: crossover, mutation, and selection.
  • An evaluator object to evaluate the solutions in the population.

We can observe that all the parameters depend on S. This way, if S is instantiated e.g. to DoubleSolution, then the problems to be solved must extend Problem<DoubleSolution> and all the operators must manipulate DoubleSolution objects. The interesting point of this approch is the compiler can ensure that there are no errors related with the application of wrong operators to a given solution.

The default createInitialPopulation() method adds a number of populationSize new solutions to a list:

  @Override protected List<S> createInitialPopulation() {
    List<S> population = new ArrayList<>(populationSize);
    for (int i = 0; i < populationSize; i++) {
      S newIndividual = problem.createSolution();
      population.add(newIndividual);
    }
    return population;
  }

The evalution of lists of solutions are delegated to Evaluator objects, so the evaluatePopulation() method is very simple:

  @Override protected List<S> evaluatePopulation(List<S> population) {
    population = evaluator.evaluate(population, problem);

    return population;
  }

The NSGA-II implementation assumes that the stopping condition will be defined around a maximum number of iterations:

  @Override protected boolean isStoppingConditionReached() {
    return iterations >= maxIterations;
  }

so the initProgress() method initalizes the iteration counter (the initial value is 1 because it is assumed that the initial populatio has been already evaluated):

  @Override protected void initProgress() {
    iterations = 1;
  }

and the updateProgress() method merely increments the counter:

  @Override protected void updateProgress() {
    iterations++;
  }

Accordig to the EA template, the Selection() method must create a mating pool from the population, so it is implemented this way:

  @Override protected List<S> selection(List<S> population) {
    List<S> matingPopulation = new ArrayList<>(population.size());
    for (int i = 0; i < populationSize; i++) {
      S solution = selectionOperator.execute(population);
      matingPopulation.add(solution);
    }

    return matingPopulation;
  }

and the reproduction() method applies the crossover and mutation operators to the mating population, leading to new individuals that are added to an offspring population:

  @Override protected List<S> reproduction(List<S> population) {
    List<S> offspringPopulation = new ArrayList<>(populationSize);
    for (int i = 0; i < populationSize; i += 2) {
      List<S> parents = new ArrayList<>(2);
      parents.add(population.get(i));
      parents.add(population.get(i + 1));

      List<S> offspring = crossoverOperator.execute(parents);

      mutationOperator.execute(offspring.get(0));
      mutationOperator.execute(offspring.get(1));

      offspringPopulation.add(offspring.get(0));
      offspringPopulation.add(offspring.get(1));
    }
    return offspringPopulation;
  }

Finally, the replacement() method joins the current and offspring populations to produce the population of the next generation by applying the ranking and crowding distance selection:

  @Override protected List<S> replacement(List<S> population, List<S> offspringPopulation) {
    List<S> jointPopulation = new ArrayList<>();
    jointPopulation.addAll(population);
    jointPopulation.addAll(offspringPopulation);

    Ranking<S> ranking = computeRanking(jointPopulation);

    return crowdingDistanceSelection(ranking);
  }

Case study: Steady-state NSGA-II

An advantage of using the EA template to implement NSGA-II is that it allows to simplify the implementation of variants of the algorithm. To give an example, we describe here the SteadyStateNSGAII class, which implements a steady-state version of NSGA-II. This version is basically NSGA-II but with an auxiliar population of size 1, so the SteadyStateNSGAII is an extension of class NSGAII:

public class SteadyStateNSGAII<S extends Solution<?>> extends NSGAII<S> {
}

and the class constructor is similar to the one of NSGA-II:

  public SteadyStateNSGAII(Problem<S> problem, int maxIterations, int populationSize,
      CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator,
      SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator) {
    super(problem, maxIterations, populationSize, crossoverOperator, mutationOperator,
        selectionOperator, evaluator);
  }

The only differences between the two algorithm variants are in the selection() (the mating pool is composed of two parents) and reproduction()(only a child is generated) methods:

  @Override protected List<S> selection(List<S> population) {
    List<S> matingPopulation = new ArrayList<>(2);

    matingPopulation.add(selectionOperator.execute(population));
    matingPopulation.add(selectionOperator.execute(population));

    return matingPopulation;
  }

  @Override protected List<S> reproduction(List<S> population) {
    List<S> offspringPopulation = new ArrayList<>(1);

    List<S> parents = new ArrayList<>(2);
    parents.add(population.get(0));
    parents.add(population.get(1));

    List<S> offspring = crossoverOperator.execute(parents);

    mutationOperator.execute(offspring.get(0));

    offspringPopulation.add(offspring.get(0));
    return offspringPopulation;
  }

This way, most of the code of the NSGAII class is reused and only two methods have had to be redefined.

Using the builder pattern to configure NSGA-II

To configure the algorithms in jMetal 5 we have adopted the approach of using the builder pattern, which is represented by the AlgorithmBuilder interface:

/**
 * Interface representing algorithm builders
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 */
public interface AlgorithmBuilder<A extends Algorithm<?>> {
  public A build() ;
}

TO BE COMPLETED

Algorithm templates

Most of metaheuristic families are characterized by a common behaviour which is shared by all the algorithms belonging to the family. This behaviour can be expressed as a template that can be instatiated to implement a particular algorithm. From a software engineering point of view, an algorithm whose behavior falls in a basic template would only require to implement some specific methods for the new technique; the common behavior would not be needed to be programmed, therefore resulting in less code replication. This inversion of control if a characteristic of software frameworks, as is the case of jMetal.

The Evolutionary Algorithm Template

Many papers about evolutionary algorithms (EAs) include a pseudo-code to describe them similar to this one:

P(0) ← GenerateInitialSolutions() 
t ← 0
Evaluate(P(0))
while not StoppingCriterion() do
  P'(t) ← selection(P(t))
  P''(t) ← Variation(P'(t)) 
  Evaluate(P''(t))
  P (t + 1) ← Update(P (t), P''(t)) 
  t←t+1
end while

To mimic this pseudo-code, jMetal 5 incorporates a template in the form of an abstract class named AbstractEvolutionaryAlgorithm, which contains the following code:

package org.uma.jmetal.algorithm.impl;

/**
 * Created by Antonio J. Nebro on 26/10/14.
 * @param <S> Solution
 * @param <R> Result
 */
public abstract class AbstractEvolutionaryAlgorithm<S extends Solution<?>, R>  implements Algorithm<R>{
  private List<S> population;
  public List<S> getPopulation() {
    return population;
  }
  public void setPopulation(List<S> population) {
    this.population = population;
  }

  protected abstract void initProgress();
  protected abstract void updateProgress();
  protected abstract boolean isStoppingConditionReached();
  protected abstract List<S> createInitialPopulation();
  protected abstract List<S> evaluatePopulation(List<S> population);
  protected abstract List<S> selection(List<S> population);
  protected abstract List<S> reproduction(List<S> population);
  protected abstract List<S> replacement(List<S> population, List<S> offspringPopulation);
  @Override public abstract R getResult();

  @Override public void run() {
    List<S> offspringPopulation;
    List<S> matingPopulation;

    population = createInitialPopulation();
    population = evaluatePopulation(population);
    initProgress();
    while (!isStoppingConditionReached()) {
      matingPopulation = selection(population);
      offspringPopulation = reproduction(matingPopulation);
      offspringPopulation = evaluatePopulation(offspringPopulation);
      population = replacement(population, offspringPopulation);
      updateProgress();
    }
  }
}  

The generics in the class declaration indicate that an algorithm works with subclasses of the Solution interface (e.g., DoubleSolution, BinarySolution, and so on) and returns a result (typically, a single solution in the case of single-objective metaheuristics and a list of solutions in the case of multi-objective techniques). We can observe as the population is implemented a list of solutions.

To develop an EA, all the abstract the methods used in the run() method must be implemented. We describe those methods next:

  • createInitialPopulation(): This method fills the population with a set of tentative solutions. The typical strategy consists in generating randomly initialized solutions, but any other approach can be applied.
  • evaluatePopulation(population): All the solutions in the population argument are evaluated and a population, which can be the same one passed as a parameter or a new one, is returned as a result.
  • initProgress(): The progress of an EA is usually measured by counting iterations or function evaluations. This method initializes the progess counter.
  • isStoppingConditionReached(): the stopping condition establishes when the algorithm finishes its execution.
  • selection(population): the selection method chooses a number of solutions from the population to become the mating pool.
  • reproduction(matingPopulation): the solutions in the mating pool are manipulated somehow, by modifying them or by using them to create new ones, yielding to new solutions that constitute the offspring population.
  • replacement(population, offspringPopulation): the population for the next generation is built from individuals of the current and the offspring populations.
  • updateProgress(): the counter of the progress of the algorithm (evaluations, iterations, or whatever) is updated.
Genetic algorithms

If we are interested in implementing a genetic algorithm, a subfamily of EAs characterized by applying a selection operator and by using a crossover and a mutation operator for the reproduction step, a subclass of AbstractEvolutionaryAlgorithm called AbstractGeneticAlgorithm is provided:

package org.uma.jmetal.algorithm.impl;

/**
 * Created by ajnebro on 26/10/14.
 */
public abstract class AbstractGeneticAlgorithm<S extends Solution<?>, Result> extends AbstractEvolutionaryAlgorithm<S, Result> {
  protected SelectionOperator<List<S>, S> selectionOperator ;
  protected CrossoverOperator<S> crossoverOperator ;
  protected MutationOperator<S> mutationOperator ;
}

Popular metaheuristics such as NSGA-II, SPEA2, PESA2, MOCell or SMS-EMOA are based on this template.

Evolution strategies

Another subfamily of EAs are evolution strategies, which are based on applying only mutation in the reproduction step. The corresponding abstract class for EAs is AbstractEvolutionStragegy:

package org.uma.jmetal.algorithm.impl;

/**
 * Created by ajnebro on 26/10/14.
 */
public abstract class AbstractEvolutionStrategy<S extends Solution<?>, Result> extends AbstractEvolutionaryAlgorithm<S, Result> {
  protected MutationOperator<S> mutationOperator ;
}

The PAES algorithm is based on this template

TO BE COMPLETED

Architecture

The architecture of jMetal 5 relies on four interfaces:


jMetal architecture

This diagram captures the typical functionality provided by jMetal: an Algorithm solves a Problem by manipulating a set of potential Solution objects through the use of several Operators. The Solution interface represents the individuals in evolutionary algorithms and the particles in the case of particle swarm optmization algorithms. A Problem can create new solutions and evaluate them. Compared to previous versions of jMetal, there is not a class for the concept of population or swarm. In jMetal 5 a population is merely a list of solutions (List<Solution> in Java).

Generics

We can observe the use of parametrized types to model the use of Java generics, which are now widely applied.

The use of generics in the architecture allows to align all the components in metaheuristic so that the Java compiler can check that everything fit. For example, this code represents all the elements to configure a the well-known NSGA-II algorithm to solve a continuous problem:

    Problem<DoubleSolution> problem;
    Algorithm<List<DoubleSolution>> algorithm;
    CrossoverOperator<DoubleSolution> crossover;
    MutationOperator<DoubleSolution> mutation;
    SelectionOperator<List<DoubleSolution>, DoubleSolution> selection;

    ...

    algorithm = new NSGAIIBuilder<DoubleSolution>(problem, crossover, mutation)
        .setSelectionOperator(selection)
        .setMaxEvaluations(25000)
        .setPopulationSize(100)
        .build() ;

Evaluators

To be written ...

Experimental studies

Since version 5.1, jMetal incorporates support for making experimental studies, i.e. configuring an experiment where a set of algorithms solve a number of problems and, as a result, a number of output files (latex tables, R scripts) are generated.

Some examples of experimental studies are included in jMetal 5.2:

  • NSGAIIStudy: four variants of NSGA-II (with different values of the polynomial mutation and SBX crossover distribution indexes) are tested to solve the five ZDT real-coded problems. The experiment carries out 25 inpendent runs per configuration and 8 cores are used.
  • NSGAIIStudy2: the same as before but it is assumed that the reference Pareto fronts are not known, so they are obtained from all the fronts obtained by all the algorithms per problem; the contributio of each algorithm to the reference is also computed (only for continuous problems)
  • ZDTStudy: the same as NSGAIIStudy but three diffent algorithms are compared: NSGA-II, SPEA2 and SMPSO.
  • ZDTStudy2: the same as before, but the reference Pareto fronts are computed as in NSGAIIStudy.
  • BinaryProblemsStudy: An example of experiment solving binary-coded problems.
  • ZDTScalabilityIStudy: This is an example of how using several variants of same problem in an experimental study. Concretely, this study is about solving five variants of the ZDT1 problem, each of them having a different number of decision variables.

Measures

A novelty in jMetal 5.0 is the inclusion of measures, which allows to obtain algorithm-specific information during its execution. The current implementation supports two types of measures: a PullMeasure provides the value of the measure on demand (synchronous), while a PushMeasure allows to register listeners (or observers) to receive the value of the measure when it is produced (asynchronous).

What are measures?

Measures are designed to access specific properties of a running algorithm. For instance, one could know the size of the current population in a genetic algorithm, the current velocity of the particles in a particle swarm optimization, the current iteration, etc. In order to deal properly with the many properties that an algorithm could have, two types of measures are provided.

Usually, properties are accessed by getters, like getPopulationSize() or getCurrentIteration(). These properties are accessed in a synchronous way, which means that we obtain (and process) them on the user's demand. Each property of this kind can be accessed through a PullMeasure, as shows the PullMeasure.get() method:

public interface PullMeasure<Value> extends Measure<Value> {
    public Value get();
}

At the opposite, a PushMeasure allows to obtain the value of a property in an asynchronous way, which means that the value is provided upon generation, the user having no control on when such a value will be provided to him. This is achieved by using an observer design pattern, such that the user registers one or several MeasureListener instances to receive and process the value when it is produced:

public interface PushMeasure<Value> extends Measure<Value> {
    public void register(MeasureListener<Value> listener);
    public void unregister(MeasureListener<Value> listener);
}

public interface MeasureListener<Value> {
    public void measureGenerated(Value value);
}

Some people could wonder why these interfaces only require reading methods: the PullMeasure does not provide a set(value) method to assign its value, and the PushMeasure does not provide some kind of push(value) method neither. This is because these interfaces are designed from a user perspective, not an algorithm designer perspective, and the user can only read these values, not write them. One could say that it makes the thing harder for the designer, but actually the designer needs to know exactly which implementation to use, because he is the one who know how the values will be provided. So if he uses an existing implementation, he should of course know the specific methods of this implementation, which can include methods to set/push his values. Only the user does not need to know about the specific implementation used by the measure, so he is the one who will have to deal with generic PullMeasure and PushMeasure. Moreover, while it is natural to think about these set and push methods, it is actually not the only way to implement these measures. For instance, the algorithm designer could use a field to store the value of a property, and the update of this property (and the related PullMeasure) will be done through this variable rather than through the call of some methods. More detailed explanations are provided in the section How to create measures?.

One could notice that both the measure interfaces extend Measure. This one is an empty interface which is used as a root interface to both PullMeasure and PushMeasure. By having it, we give the possibility for programers to manage measures in a generic way, without having to consider both types of measures separately nor to use Object to have them together. Thus, it is only here to simplify the use of measures for some highly generic cases in jMetal. No algorithm designer nor user should normally need it.

Additionally to the measures themselves, jMetal 5 also provides the notion of MeasureManager, which deals with measures management features:

public interface MeasureManager {
    public Collection<Object> getMeasureKeys();
    public <T> PullMeasure<T> getPullMeasure(Object key);
    public <T> PushMeasure<T> getPushMeasure(Object key);
}

You can notice that we provide a method for each type rather than a generic method returning a Measure. This is because, as mentionned before, the Measure interface is empty, thus has no practical value. Moreover, when the user want to exploit a measure, he should know which type of measure is implemented to know how to interact with it. Rather than providing a Measure and arbitrarily cast it, we prefered to provide methods which directly provide the right type of measure. Notice that a measure instance can implement both interfaces (or two instances can be made available for the same property), so both methods can return an instance (same or not) for the same key, giving to the user the choice of using one way or another. In the case where only one is provided (the other being null), it is possible to complete it, as described in the section dedicated to conversions. The key identifies the specific property to measure and is algorithm-dependent, justifying the presence of an additional getMeasureKeys() for the user to retrieve them.

Finally, in order for an algorithm to explicit that it provides measures, it should implement the Measurable interface, which simply requires to provide a MeasureManager:

public interface Measurable {
    public MeasureManager getMeasureManager();
}

So far, an Algorithm does not automatically implements Measurable, but it may change in future releases if we assess the relevance of the interface for a generic purpose.

One could wonder why we introduced the intermediary concept of MeasureManager rather than putting directly its methods into the Measurable interface. Indeed, by construction, the designer could simply decide to implement both the interfaces on the algorithm and implement getMeasureManager() by simply returning this, showing that we can artificially ignore the intermediary concept. Also, in the case where we actually reduce to the Measurable interface, the designer could add an intermediary objects which implements Measurable (so the methods of MeasureManager), and implement it also for the algorithm, but using his custom object in background. So technically, we see that introducing an intermediary notion of MeasureManager does not impose any constraint, justifying that we use the most simple design (no intermediary concept). Anyway, we made this design choice for the following reason: while the MeasureManager should focus on the measure management strategy, a Measurable should focus on which measures to provide. For instance, a MeasureManager could implement an advanced management strategy which, for measures implementing only one of the measure interfaces, would automatically instantiate a PullMeasure/PushMeasure in order to have all the features for each measure, with some smart inspection management for PushMeasures corresponding to PullMeasures. On the other hand, a Measurable instance, typically an algorithm, would focus on choosing which measures to provide and feeding them, delegating any measure management process to a dedicated MeasureManager implementation.

Why using measures?

Usually, properties are accessed by getters, like getPopulationSize() or getCurrentIteration(). The advantage of this design is that it gives a simple way to access these properties. However, we quickly face the limitations of this design when we want to read properties which evolve in time, like the current iteration. Indeed, such a design imposes to read these properties on a regular basis, sometime on a frequent basis to see all the updates (also called polling, spinning, or busy-waiting). Such a design becomes particularly cumbersome when we want to access short-term values, like which individuals have been generated at a given iteration of a genetic algorithm. These individuals are usually forgotten at the next iteration (only the good ones are kept), thus imposing a frequent check. Accessing such properties at runtime would require whether to consume a lot of computation time to continuously inspect some getGeneratedIndividuals() method, or to consume a lot of space to store all the data generated and access it through some getGeneratedIndividuals(int iteration) method.

The design we choose for jMetal 5 is based on the notion of measure, which further split into two categories: PullMeasure and PushMeasure. The simplest one, the PullMeasure, is designed for the first kind of property, which can be easily accessed (pulled) from a getter. While one could simply use a getter, the PullMeasure provides a more generic access to the property, allowing to apply generic evaluations on the algorithm (like generic experiments, which are not yet available in jMetal 5.0). The other type of measure, the PushMeasure, is designed for the other kind of properties, which are not easily managed through getters and need to be provided (pushed) in real-time by the algorithm. By using such a measure, the values can be received and processed without risking to loose any update, and without the need to continuously inspect the property.

Another advantage of having both these measures is that it can be easily integrated to an algorithm without requiring significant additional resources: indeed, for cases where a value have to be stored into a variable for the algorithm to use it, like an iteration counter to stop after N iterations, such a value can be covered (or replaced) by a PullMeasure. At the opposite, when a value is generated but not stored during the running of the algorithm, a PushMeasure can be used to push the value to any potential listener and forget about it, letting the listeners decide whether or not this value should be stored or further processed. The additional resources consumed are only:

  • the stored measures, which are often lightweight and less numerous than the solutions to store
  • the calls to the listeners of the PushMeasures, which are negligible if no listener is registered, otherwise fully controlled by the user (not by a priori decisions from the algorithm designer)

How to use measures?

Measures have been defined to be particularly easy to use. On one hand, a PullMeasure can be used basically like a getter, where instead of calling getXxx() we call xxxMeasure.get(). This results in using a PullMeasure directly when required by the user. On the other hand, because a PushMeasure only allows a user to register and unregister listeners (the notification generation is the responsibility of the algorithm), the user have no control on when the processing will occur: the process have to be put in the listener to exploit the data when it arrives, or the listener should store the value while letting another thread dealing with the processing. It is generally recommended to reduce the time spent in a listener to the minimum in order to let the source of the notification (the algorithm here) continues its job.

In other words, a process using PullMeasures should generally have this form, where the measures are used once the algorithm is running:

Algorithm<?> algorithm = new MyAlgorithm();

/* retrieval of the measures */
/* (only if the algorithm implements Measurable) */
MeasureManager measures = algorithm.getMeasureManager();
PullMeasure<Object> pullMeasure = measures.getPullMeasure(key);
...

/* preparation of the run */
...
/* run the algorithm in parallel */
Thread thread = new Thread(algorithm);
thread.start();

/* user process */
while (thread.isAlive()) {
    ...
    /* use the value */
    Object value = pullMeasure.get();
    ...
}

At the opposite, a process using PushMeasures should generally have this form, where the process is setup before to run the algorithm:

Algorithm<?> algorithm = new MyAlgorithm();

/* retrieval of the measures */
/* (only if the algorithm implements Measurable) */
MeasureManager measures = algorithm.getMeasureManager();
PushMeasure<Object> pushMeasure = measures.getPushMeasure(key);
pushMeasure.register(new MeasureListener<Object>() {
    
    @Override
    public void measureGenerated(Object value) {
        /* use the value */
        ...
    }
});
...

/* preparation of the run */
...
/* run the algorithm in parallel */
Thread thread = new Thread(algorithm);
thread.start();

/* other processes */
while (thread.isAlive()) {
    ...
}

In the case where only PushMeasures are used, one could also remove all the Thread management and simply call algorithm.run() and wait for it to finish. All the processes setup via PushMeasures will occur automatically.

How to create measures?

Create a PullMeasure

Usually, one implements an algorithm by storing some values in dedicated public fields, so a user can retrieve them on the fly. A really common example is a population of solutions, that we can find in many algorithms managing several solutions at the same time, like a genetic algorithm. Some others prefer to use getters, like getPopulation(), to provide a read-only access (while the field can be changed by the external user). These fields and getters are the best candidates for PullMeasures, because they can be wrapped in a straightforward manner. For our population example:

PullMeasure<Collection<Path>> populationMeasure = new PullMeasure<Collection<Path>>() {
    
    @Override
    public String getName() {
        return "population";
    }
    
    @Override
    public String getDescription() {
        return "The set of paths used so far.";
    }
    
    @Override
    public Collection<Path> get() {
        return getPopulation();
    }
};

The name and description are additional data to describe the measure itself, to know what it provides, and any measure should implement it, which makes the implementation of the interface quite heavy. However, this code can be reduced by using SimplePullMeasure, which takes the name and description in argument to focus on the value to retrieve:

PullMeasure<Collection<Path>> populationMeasure
= new SimplePullMeasure<Collection<Path>>("population",
                                          "The set of paths used so far.") {
    @Override
    public Collection<Path> get() {
        return getPopulation();
    }
};

If no getter is available, a field can also be used exactly the same way. These cases are the most basic uses of a PullMeasure. They are also the most common if you adapt an existing implementation to use the jMetal formalism. Indeed, using fields and getters is the simple way to provide an access to the internal data of an algorithm, which gives a lot of occasions to use PullMeasures. But these cases are not the only ones. Indeed, any computation can be defined in the get() method, which allows to add new measures even for inexistent fields and getters. For instance, assuming that the algorithm manages the time spent in some of its steps, it could store an internal startTime value which indicates when the algorithm have been started. From this variable, one could measure how long the algorithm has run:

PullMeasure<Long> runningTimeMeasure
= new SimplePullMeasure<Long>("running time",
                              "The time spent so far in running the algorithm.") {
    @Override
    public Long get() {
        return System.currentTimeMillis() - startTime;
    }
};

The advantage of putting the computation directly into the get() method is that the value is computed only when requested. Thus, it is the responsibility of the external user to decide when it is worth to compute it.

So far, we saw that a PullMeasure is basically used in the same way than a getter (we can also use a getter to make some computation). This is actually its principal purpose, but it does it in a standardised way: indeed, given that you have an algorithm which provides you some getters or equivalent, you can wrap all of them into PullMeasures, which gives you a unified way to access these values in a generic context (where you do not know which method to use nor how to use them, unless reflexion is used). Moreover, if you have an algorithm which provides a set of PullMeasures, you can extend them by creating new ones (while you cannot add getters nor fields to an instance):

PullMeasure<Integer> populationSizeMeasure
= new SimplePullMeasure<Integer>("population size",
                                 "The number of solutions used so far.") {
    @Override
    public Integer get() {
        // reuse a measure to compute another property
        return populationMeasure.get().size();
    }
};

With the ability to extend a set of measures, one can create the relevant measures for a specific experiments for instance (not yet implemented in jMetal 5.0). In other words, the algorithm designer can focus on providing a minimal set of measures and let the external user define new ones when required.

Finally, additional facilities are provided by jMetal to simplify the creation of PullMeasures. We already mentionned the SimplePullMeasure which focuses on defining the get() method, but in the case where the measure wraps a field, one could prefer to use directly the measure instead of the field itself by using a BasicMeasure, which directly stores the value by defining an additional set(value) method. More specific measures are also defined, like the CountingMeasure which allows to count occurrences, typically like a number of iterations or a number of solutions generated, or the DurationMeasure to evaluate the time spent in some activities. Several implementations of PullMeasure also implement PushMeasure, thus allowing a high flexibility on their use. In the case where one want to add PullMeasures to an existing algorithm, it is also possible to use the MeasureFactory to facilitate the instantiation of several PullMeasures at once:

  • createPullsFromFields(object) instantiates a PullMeasure for each field of an object and returns a Map associating the name of each field to the corresponding measure,
  • createPullsFromGetters(object) instantiates a PullMeasure for each getter in a similar way.
Create a PushMeasure

A PushMeasure standardises the observer design pattern for algorithms. As an observer is supposed to be notified when the value it observes is updated, a PushMeasure notifies a listener (a broadly used term for observers in Java, especially in Swing) when a property of the algorithm changes. Noticeably, the interface PushMeasure is really reduced: it only requires the methods to add and remove listeners. Because of that, it is the responsibility of the measure implementer to decide how the listeners are notified. Several implementations are already provided in jMetal to simplify this work. In particular, probably most of the cases will find their way in using SimplePushMeasure, for instance if we want to notify when a new solution is generated:

SimplePushMeasure<MySolution> lastGeneratedSolution = new SimplePushMeasure<>(
        "last solution",
        "The last solution generated during the running of the algorithm.");

At the opposite of a passive PullMeasure (this is the user who decides when to call it), a PushMeasure is an active measure, in the sense that it is a particular event occuring during the run of the algorithm which triggers the notification process. For our example of last generated solution, we could have a basic hill-climbing method which starts from a random solution and then creates mutants to iteratively improve it. These random and mutant generations are the two relevant events in the algorithm for using our measure:

MySolution best = createRandomSolution();
lastGeneratedSolution.push(best);

while (running) {
    MySolution mutant = createMutantSolutionFrom(best);
    lastGeneratedSolution.push(mutant);
    
    // ...
    // remaining of the loop
    // ...
}

This example is illustrative in two ways: first, there can have several events to consider for a single measure, and second, the notification process should be done as soon as the event has occurred. This implies that a PushMeasure is generally deeply involved in the code of the algorithm itself, at the opposite of a PullMeasure which can wrap a field or a getter method, letting the algorithm itself untouched. Moreover, it also means that some extra computation time is consumed each time such a relevant event occurs. Because of that, a PushMeasure is well suited for notifying about a result already computed (because the algorithm need it) rather than to compute extra data for the sole purpose of measuring some properties. For an extra computation, it is wiser to exploit both a PushMeasure, to notify about the already computed stuff which serves as a basis for the extra computation (if any), with an additional PullMeasure, which will make the extra computation only if requested by the user.

Several implementations provided by jMetal already implement the PushMeasure interface. We already saw the SimplePushMeasure, which should be sufficient for many cases, but one can also notice the CountingMeasure, which allows to count the events (the value notified is an integer incremented at each notification). This implementation is for instance well suited for notifying the start/end of an iteration or how many solutions have been generated so far. It also implements the PullMeasure interface, allowing to retrieve the last value notified on demand.

Conversions PullMeasure <-> PushMeasure

Some measures implement both PullMeasure and PushMeasure, but in the case where a single one is implemented, it is still possible to create another measure to complement it. This can be achieved by using the MeasureFactory, which provides conversions in both directions:

  • createPullFromPush(push, initialValue) creates a PullMeasure from a PushMeasure. Every time the initial PushMeasure notifies its listeners, the PullMeasure is updated and stores the value for future calls of its get(). The initialValue provided to the method tells which value to use before the next notification occurs (typically null or the actual value if it is known).
  • createPushFromPull(pull, period) creates a PushMeasure from a PullMeasure. Because there is no particular event produced by a PullMeasure, we artificially poll it (frequently check its value) at the given period to see when it changes. Identifying a change will result in generating a notification from the created PushMeasure. A short period offers a better reactivity but increases the computation cost, explaining why this method should not be used unless it is necessary. This is also why it is generally preferable, when it is possible to choose, to setup a PushMeasure rather than a PullMeasure: the conversion costs way less in that direction.
Add measures to an algorithm

In order for an algorithm to provide measures, it should implement the Measurable interface, which asks to provide a MeasureManager. This manager is the one storing and giving access to all the measures of the algorithm. While one can implement his own manager, jMetal already provide the SimpleMeasureManager implementation which provides the following methods:

public class SimpleMeasureManager implements MeasureManager {

    // Methods to configure the PullMeasures
    public void setPullMeasure(Object key, PullMeasure<?> measure) {...}
    public <T> PullMeasure<T> getPullMeasure(Object key) {...}
    public void removePullMeasure(Object key) {...}
    
    // Methods to configure the PushMeasures
    public void setPushMeasure(Object key, PushMeasure<?> measure) {...}
    public <T> PushMeasure<T> getPushMeasure(Object key) {...}
    public void removePushMeasure(Object key) {...}

    // Methods to configure any measure (auto-recognition of the type)
    public void setMeasure(Object key, Measure<?> measure) {...}
    public void removeMeasure(Object key) {...}
    public void setAllMeasures(Map<? extends Object, ? extends Measure<?>> measures) {...}
    public void removeAllMeasures(Iterable<? extends Object> keys) {...}
    
    // Provide the keys of the configured measures
    public Collection<Object> getMeasureKeys() {...}
}

While there is the basic, type-specific methods, there is also generic methods which automatically recognize the type of the measure provided, and apply the corresponding type-specific methods. Measures which implement both PullMeasure and PushMeasure are also recognized and added both as a PullMeasure and a PushMeasure, so calling getPullMeasure(key) and getPushMeasure(key) with the same key will return the same measure. The generic methods also provide a massive configuration feature by managing several keys and measures at once.

It is worth noting that, if an instance of a non-jMetal algorithm is provided, one can easily try to retrieve some measures from it by using MeasureFactory.createPullsFromFields(object) and MeasureFactory.createPullsFromGetters(object). The maps returned by these two methods can then be provided to SimpleMeasureManager.setAllMeasures(measures) to have a fully featured, ready to use MeasureManager, without knowing anything about the actual algorithm. Given that we know how to run it, it is then possible to run it in a dedicated thread, as described in the section How to use measures?, and to exploit the available measures to obtain some information about the algorithm. However, as underlined in the section Conversions PullMeasure <-> PushMeasure, it is costly to make PushMeasures from PullMeasures, while the reverse is quite cheap. Thus, although it can be tempting to simply implement an algorithm independently of jMetal and use this procedure to obtain a set of PullMeasures, someone designing an algorithm with the possibility to use the formalism of jMetal should focus on PushMeasures (or a combination of both) to retrieve more information in a more optimized way.

The Operator interface

Metaheuristic techniques are based on modifying or generating new solutions from existing ones by means of the application of different operators. For example, EAs make use of crossover, mutation, and selection operators for modifying solutions. In jMetal, any operation altering or generating solutions (or sets of them) implements or extends the Operator interface:

package org.uma.jmetal.operator;

/**
 * Interface representing an operator
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 * @version 0.1
 * @param <Source> Source Class of the object to be operated with
 * @param <Result> Result Class of the result obtained after applying the operator
 */
public interface Operator<Source, Result> {
  /**
   * @param source The data to process
   */
  public Result execute(Source source) ;
}

The generics in this interface are intended to indicate that an operator is applied to a Source object and returns as a result Result object.

The framework already incorporates a number of operators, which can be classiffed into four different classes:

  • Crossover. Represents the recombination or crossover operators used in EAs. Some of the included operators are the simulated binary (SBX) crossover and the single-point crossover for real and binary encodings, respectively.
  • Mutation. Represents the mutation operator used in EAs. Examples of included operators are polynomial mutation (real encoding) and bit-flip mutation (binary encoding).
  • Selection. This kind of operator is used for performing the selection procedures in many metaheuristics. An example of selection operator is the binary tournament.
  • LocalSearch. This class is intended for representing local search procedures. It contains a method for consulting how many evaluations have been performed after been applied.

We review the interfaces and implementations of these operators next.

Crossover operators

The CrossoverOperator interface represents any crossover in jMetal 5:

package org.uma.jmetal.operator;

/**
 * Interface representing crossover operators. They will receive a list of solutions and return
 * another list of solutions
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 *
 * @param <S> The class of the solutions
 */
public interface CrossoverOperator<S extends Solution<?>> extends Operator<List<S>,List<S>> {
}

This interface simply states that a crossover has as a source a list of Solution objects and return as a result another list of solutions. Let us examine two implementations of this interface, one for double solutons and another one for binary solutions.

The simulated binary crossover (SBX) is the default crossover operator in many multiobjective evolutionary algorithms (e.g., NSGA-II, SPEA2, SMS-EMOA, MOCell, etc). A scheme of the SBXCrossover class is shown next:

package org.uma.jmetal.operator.impl.crossover;

/**
 * This class allows to apply a SBX crossover operator using two parent solutions (Double encoding).
 * A {@link RepairDoubleSolution} object is used to decide the strategy to apply when a value is out
 * of range.
 *
 * The implementation is based on the NSGA-II code available in
 * <a href="http://www.iitk.ac.in/kangal/codes.shtml">http://www.iitk.ac.in/kangal/codes.shtml</a>
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 * @author Juan J. Durillo
 */
public class SBXCrossover implements CrossoverOperator<DoubleSolution> {
  /** EPS defines the minimum difference allowed between real values */
  private static final double EPS = 1.0e-14;

  private double distributionIndex ;
  private double crossoverProbability  ;
  private RepairDoubleSolution solutionRepair ;

  private JMetalRandom randomGenerator ;

  /** Constructor */
  public SBXCrossover(double crossoverProbability, double distributionIndex) {
    this (crossoverProbability, distributionIndex, new RepairDoubleSolutionAtBounds()) ;
  }

  /** Constructor */
  public SBXCrossover(double crossoverProbability, double distributionIndex, RepairDoubleSolution solutionRepair) {
    if (crossoverProbability < 0) {
      throw new JMetalException("Crossover probability is negative: " + crossoverProbability) ;
    } else if (distributionIndex < 0) {
      throw new JMetalException("Distribution index is negative: " + distributionIndex);
    }

    this.crossoverProbability = crossoverProbability ;
    this.distributionIndex = distributionIndex ;
    this.solutionRepair = solutionRepair ;

    randomGenerator = JMetalRandom.getInstance() ;
  }

  /** Execute() method */
  @Override
  public List<DoubleSolution> execute(List<DoubleSolution> solutions) {
    if (null == solutions) {
      throw new JMetalException("Null parameter") ;
    } else if (solutions.size() != 2) {
      throw new JMetalException("There must be two parents instead of " + solutions.size()) ;
    }

    return doCrossover(crossoverProbability, solutions.get(0), solutions.get(1)) ;
  }
  
  ...

TO BE COMPLETED

The Problem interface

To include a problem in jMetal, it must implement the Problem interface:

package org.uma.jmetal.problem;

/**
 * Interface representing a multi-objective optimization problem
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 *
 * @param <S> Encoding
 */
public interface Problem<S extends Solution<?>> extends Serializable {
  /* Getters */
  public int getNumberOfVariables() ;
  public int getNumberOfObjectives() ;
  public int getNumberOfConstraints() ;
  public String getName() ;

  /* Methods */
  public void evaluate(S solution) ;
  public S createSolution() ;

Every problem is characterized by the number of decision variables, the number of objective functions and the number of constraints, so getter methods for returning those values have to be defined. The genetic type S allows to determine the encoding of the solutions of the problem. This way, a problem must include a method for evaluating any solution of class S as well as providing a createSolution() method for creating a new solution.

The Solution interface is generic, so jMetal 5 has a number of interfaces extending it to represent double (i.e., continous) problems, binary problems, etc. This way, the DoubleProblem interface is defined in this way:

package org.uma.jmetal.problem;

/**
 * Interface representing continuous problems
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 */
public interface DoubleProblem extends Problem<DoubleSolution> {
  Double getLowerBound(int index) ;
  Double getUpperBound(int index) ;
}

Problems implementing DoubleProblem only accept DoubleSolution objects, and methods for getting the lower and upper limits of each variable have to be implemented. jMetal 5 provides a default abstract class that implements DoubleProblem called AbstractDoubleProblem:

package org.uma.jmetal.problem.impl;

public abstract class AbstractDoubleProblem extends AbstractGenericProblem<DoubleSolution>
  implements DoubleProblem {

  private List<Double> lowerLimit ;
  private List<Double> upperLimit ;

  /* Getters */
  @Override
  public Double getUpperBound(int index) {
    return upperLimit.get(index);
  }

  @Override
  public Double getLowerBound(int index) {
    return lowerLimit.get(index);
  }

  /* Setters */
  protected void setLowerLimit(List<Double> lowerLimit) {
    this.lowerLimit = lowerLimit;
  }

  protected void setUpperLimit(List<Double> upperLimit) {
    this.upperLimit = upperLimit;
  }

  @Override
  public DoubleSolution createSolution() {
    return new DefaultDoubleSolution(this)  ;
  }
}

As an example of double problem, we include next the implementation of the known Kursawe problem:

package org.uma.jmetal.problem.multiobjective;

/**
 * Class representing problem Kursawe
 */
public class Kursawe extends AbstractDoubleProblem {

  /**
   * Constructor.
   * Creates a default instance of the Kursawe problem.
   */
  public Kursawe() {
    // 3 variables by default
    this(3);
  }

  /**
   * Constructor.
   * Creates a new instance of the Kursawe problem.
   *
   * @param numberOfVariables Number of variables of the problem
   */
  public Kursawe(Integer numberOfVariables) {
    setNumberOfVariables(numberOfVariables);
    setNumberOfObjectives(2);
    setName("Kursawe");

    List<Double> lowerLimit = new ArrayList<>(getNumberOfVariables()) ;
    List<Double> upperLimit = new ArrayList<>(getNumberOfVariables()) ;

    for (int i = 0; i < getNumberOfVariables(); i++) {
      lowerLimit.add(-5.0);
      upperLimit.add(5.0);
    }

    setLowerLimit(lowerLimit);
    setUpperLimit(upperLimit);
  }

  /** Evaluate() method */
  public void evaluate(DoubleSolution solution){
    double aux, xi, xj;
    double[] fx = new double[getNumberOfObjectives()];
    double[] x = new double[getNumberOfVariables()];
    for (int i = 0; i < solution.getNumberOfVariables(); i++) {
      x[i] = solution.getVariableValue(i) ;
    }

    fx[0] = 0.0;
    for (int var = 0; var < solution.getNumberOfVariables() - 1; var++) {
      xi = x[var] * x[var];
      xj = x[var + 1] * x[var + 1];
      aux = (-0.2) * Math.sqrt(xi + xj);
      fx[0] += (-10.0) * Math.exp(aux);
    }

    fx[1] = 0.0;

    for (int var = 0; var < solution.getNumberOfVariables(); var++) {
      fx[1] += Math.pow(Math.abs(x[var]), 0.8) +
        5.0 * Math.sin(Math.pow(x[var], 3.0));
    }

    solution.setObjective(0, fx[0]);
    solution.setObjective(1, fx[1]);
  }
}

Similarly to the DoubleProblem interface and AbstractDoubleProblem, we can found BinaryProblem and AbstractBinaryProblem, IntegerProblem and AbstractIntegerProblem, etc. The packages related to defining and implementing problems are:

Constrained problems

There are two ways of dealing with constrained problems in jMetal 5. The first choice is to include the code to deal with constraint violation in the evaluate() method; the second one is to implement the ConstrainedProblem interface which includes a method for evaluating constraints:

package org.uma.jmetal.problem;

/**
 * Interface representing problems having constraints
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 */
public interface ConstrainedProblem<S extends Solution<?>> extends Problem<S> {

 /* Getters */
  public int getNumberOfConstraints() ;
    
  /* Methods */
  public void evaluateConstraints(S solution) ;
}

In jMetal 5 the default approach is the second one. The following code contains the implementation of the Tanaka problem, which has two constraints:

package org.uma.jmetal.problem.multiobjective;

/**
 * Class representing problem Tanaka
 */
public class Tanaka extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution> {
  public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree ;
  public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints ;

  /**
   * Constructor.
   * Creates a default instance of the problem Tanaka
   */
  public Tanaka() {
    setNumberOfVariables(2);
    setNumberOfObjectives(2);
    setNumberOfConstraints(2);
    setName("Tanaka") ;

    List<Double> lowerLimit = new ArrayList<>(getNumberOfVariables()) ;
    List<Double> upperLimit = new ArrayList<>(getNumberOfVariables()) ;

    for (int i = 0; i < getNumberOfVariables(); i++) {
      lowerLimit.add(10e-5);
      upperLimit.add(Math.PI);
    }

    setLowerLimit(lowerLimit);
    setUpperLimit(upperLimit);

    overallConstraintViolationDegree = new OverallConstraintViolation<DoubleSolution>() ;
    numberOfViolatedConstraints = new NumberOfViolatedConstraints<DoubleSolution>() ;
  }

  @Override
  public void evaluate(DoubleSolution solution)  {
    solution.setObjective(0, solution.getVariableValue(0));
    solution.setObjective(1, solution.getVariableValue(1));
  }

  /** EvaluateConstraints() method */
  @Override
  public void evaluateConstraints(DoubleSolution solution)  {
    double[] constraint = new double[this.getNumberOfConstraints()];

    double x1 = solution.getVariableValue(0) ;
    double x2 = solution.getVariableValue(1) ;

    constraint[0] = (x1 * x1 + x2 * x2 - 1.0 - 0.1 * Math.cos(16.0 * Math.atan(x1 / x2)));
    constraint[1] = -2.0 * ((x1 - 0.5) * (x1 - 0.5) + (x2 - 0.5) * (x2 - 0.5) - 0.5);

    double overallConstraintViolation = 0.0;
    int violatedConstraints = 0;
    for (int i = 0; i < getNumberOfConstraints(); i++) {
      if (constraint[i]<0.0){
        overallConstraintViolation+=constraint[i];
        violatedConstraints++;
      }
    }

    overallConstraintViolationDegree.setAttribute(solution, overallConstraintViolation);
    numberOfViolatedConstraints.setAttribute(solution, violatedConstraints);
  }
}

Discussion

The inclusion of the ConstrainedProblem interface was motivated by the former jMetal versions, where every problem had the evaluate() and evaluateConstraints() methods. In the case of a non-constrained problem, evaluateConstraints() was implemented as an empty method. To avoid this violation of the Interface Segregation Principle, in jMetal 5 only those problems having side constraints need to evaluate constraints.

In the original jMetal, evaluating a solution needed two sentences:

Problem problem ;
Solution solution ;
...
problem.evaluate(solution) ;
problem.evaluateContraints(solution) ;

Now a check has to be included to determine whether a problem has constraints or not:

DoubleProblem problem ;
DoubleSolution solution ;

problem.evaluate(solution);
if (problem instanceof ConstrainedProblem) {
  ((ConstrainedProblem<DoubleSolution>) problem).evaluateConstraints(solutionn);
}

Quality indicators

Quality indicators are considered in jMetal 5 as components of the core package (jmetal-core). As many other components, there is a generic interface and an impl package containing the provided implementations of that interface.

The QualityIndicator interface is very simple:

package org.uma.jmetal.qualityindicator;

/**
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 *
 * @param <Evaluate> Entity to evaluate
 * @param <Result> Result of the evaluation
 */
public interface QualityIndicator<Evaluate, Result> extends DescribedEntity {
  public Result evaluate(Evaluate evaluate) ;
  public String getName() ;
}

The idea is than every quality indicator is applied to some entity (Evaluate) to be evaluated, and it returns a Result. The use of generics allows to represent indicators returning anything, from a double value (the most usual return type) to a pair of values as in the case of our implementation of Set Coverage. The quality indicators also has an associated name.

Auxiliary classes

Before describing how quality indicators are implemented, we must comment before a number of auxiliary classes that are used:

  • The Front interface and ArrayFront class: Frequently, a reference Pareto front is stored in a file containing the objective values of a number of solutions. A Front is an entity intended to store the contents of these files; in the case of the ArrayFront class, it stores the front into an array of points.
  • The FrontNormalizer class: many indicators normalize the list of solutions to be evaluated, and this class is intended to do this: given a reference front or the maximum and minimum values, it returns a normalized list of solutions.

An example of indicator: Epsilon

To illustrate a quality indicator in jMetal 5, we describe next the code of the Epsilon indicator.

The declaration of the Epsilon class is included in this piece of code:

public class Epsilon<Evaluate extends List<? extends Solution<?>>>
    extends SimpleDescribedEntity
    implements QualityIndicator<Evaluate,Double> {
  ...    

Although at a first glance it seems a very complex declaration, it simply states that Evaluate must be a List of any kind of jMetal Solution, so any attempt to use the indicator with a non compatible object will be detected at compiling time.

Our approach to implement most of indicators is to consider that most of them require a reference front to be computed, so that front must be incorporated as a parameter of the class constructor:

  private Front referenceParetoFront ;

  /**
   * Constructor
   *
   * @param referenceParetoFrontFile
   * @throws FileNotFoundException
   */
  public Epsilon(String referenceParetoFrontFile) throws FileNotFoundException {
    super("EP", "Epsilon quality indicator") ;
    if (referenceParetoFrontFile == null) {
      throw new JMetalException("The reference pareto front is null");
    }

    Front front = new ArrayFront(referenceParetoFrontFile);
    referenceParetoFront = front ;
  }
...

Then, the evaluate method computes the indicator value by using the reference front:

  /**
   * Evaluate() method
   *
   * @param solutionList
   * @return
   */
  @Override public Double evaluate(Evaluate solutionList) {
    if (solutionList == null) {
      throw new JMetalException("The pareto front approximation list is null") ;
    }

    return epsilon(new ArrayFront(solutionList), referenceParetoFront);
  }

Readers interested in how the Epsilon is computed can find all the code here

About normalization

An important issue to take into account is that quality indicators do not normalize the solution list to be evaluated. Instead, the user can choose if the fronts are normalized or not before using them.

This piece of code shows an example of how reading a reference from a file and how to get a FrontNormalized from it:

Front referenceFront = new ArrayFront("fileName");
FrontNormalizer frontNormalizer = new FrontNormalizer(referenceFront) ;

Then, the front normalizer can be use to a normalized reference front:

Front normalizedReferenceFront = frontNormalizer.normalize(referenceFront) ;

And then, given any solution list to be normalized, it can be done this way:

List<Solution> population ;
...
Front normalizedFront = frontNormalizer.normalize(new ArrayFront(population)) ;

Using quality indicators

One we have decided about normalization, we can create a quality indicator and use it. We select the Hypervolume as an example:

Hypervolume<List<? extends Solution<?>>> hypervolume ;
hypervolume = new Hypervolume<List<? extends Solution<?>>>(referenceFront) ;

double hvValue = hypervolume.evaluate(population) ;

Discussion

Leaving the normalization up to the user can be error prone, but there is a performance advantage: if the same indicator has to be applied to many solution lists, the normalization of the reference front is carried out only once. This is the case, for example, when some indicator-based algorithms have to find the solution contributing the least to the Hypervolume.

Computing quality indicators from the command line

If you need to compute the value of a given quality indicator of a front of solutions from the command line you can use the CommandLineIndicatorRunner class.

The usage of this program is:

java org.uma.jmetal.qualityIndicator.CommandLineIndicatorRunner indicatorName referenceFront frontToEvaluate TRUE | FALSE

where indicator name can be:

  • GD: Generational distance
  • IGD: Inverted generational distance
  • IGD+: Inverted generational distance plus
  • EP: Epsilon
  • HV: Hypervolume
  • SPREAD: Spread (two objectives)
  • GSPREAD: Generalized spread (more than two objectives
  • ER: Error ratio
  • ALL: Select all the available indicators

The last parameter is used to indicate whether the fronts are to be normalized or not before computing the quality indicators.

We include some examples next. First, we run NSGA-II to solve problem ZDT2:

$ java org.uma.jmetal.runner.multiobjective.NSGAIIRunner org.uma.jmetal.problem.multiobjective.zdt.ZDT2

ago 01, 2015 6:08:16 PM org.uma.jmetal.runner.multiobjective.NSGAIIRunner main
INFORMACIÓN: Total execution time: 1445ms
ago 01, 2015 6:08:17 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Random seed: 1438445295477
ago 01, 2015 6:08:17 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Objectives values have been written to file FUN.tsv
ago 01, 2015 6:08:17 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Variables values have been written to file VAR.tsv

Now we use CommandLineIndicatorRunner to compute the Hypervolume value by normalizing first the fronts:

$ java org.uma.jmetal.qualityIndicator.CommandLineIndicatorRunner HV jmetal-problem/src/test/resources/pareto_fronts/ZDT2.pf FUN.tsv TRUE

The fronts are NORMALIZED before computing the indicators
0.32627228626895705

If we are interested in computing all the quality indicators, we execute the following command:

$ java org.uma.jmetal.qualityIndicator.CommandLineIndicatorRunner ALL jmetal-problem/src/test/resources/pareto_fronts/ZDT2.pf FUN.tsv TRUE

The fronts are NORMALIZED before computing the indicators
EP: 0.01141025767271403
HV: 0.32627228626895705
GD: 1.862557951719542E-4
IGD: 1.8204928590462744E-4
IGD+: 0.003435437983027875
SPREAD: 0.33743702454536517
GSPREAD: 0.40369897027563534
R2: 0.19650995040071226
ER: 1.0
SC(refPF, front): 0.89
SC(front, refPF): 0.0

Running algorithms

To run an algorithm in jMetal you have two choices: using an IDE or using the command line. We explain both methods in this section. We comment first how to configure a metaheuristic algorithm to solve a problem.

Configuring algorithms

In jMetal 5, to configure and run an algorithm we need to write a class for that purpose; we refer to such a class as runner. Configuring an algorithm from an external configuration file is still a missing feature.

We provide at least a runner class for every algorithm included in jMetal. They can be found in the jmetal-exec module, in the folder https://github.com/jMetal/jMetal/tree/master/jmetal-exec/src/main/java/org/uma/jmetal/runner/multiobjective.

As explanatory examples, we include different runners for the NSGA-II algorithm, showing different ways of configuring and using it:

  • NSGAIIRunner: configuration of the standard NSGA-II to solve continuous problems.
  • NSGAIIIntegerRunner: configuration to solve integer problems.
  • NSGAIIBinaryRunner: configuration to solve binary problems.
  • NSGAIIMeasuresRunner: similar to NSGAIIRunner, but it includes examples of how to use measures.
  • NSGAIIMeasuresWithChartsRunner: similar to NSGAIIMeasuresRunner, but plotting a graph showing the evolution of the front during the execution of the algorithm.
  • NSGAIIStoppingByTimeRunner: example showing how to configure NSGA-II to use a stopping condition based on a predefined time instead of a given number of evaluations.
  • ParallelNSGAIIRunner: as NSGAIIRunner but configured to use threads to evaluate the populations in parallel.

We describe next the NSGAIIRunner class. The Javadoc comment indicates the program parameters: the first one is the class of the problem to solve; the second one, is an optional parameter, indicating the path to a file containing a reference front. This front is an approximation to the optimal Pareto front of the problem to be solved, and in case of being provided, it will be used to compute all the quality indicators available:

public class NSGAIIRunner extends AbstractAlgorithmRunner {
  /**
   * @param args Command line arguments.
   * @throws JMetalException
   * @throws FileNotFoundException
   * Invoking command: java org.uma.jmetal.runner.multiobjetive.NSGAIIRunner problemName [referenceFront]
   */
  public static void main(String[] args) throws JMetalException, FileNotFoundException {

The first part of the main method declares the type of the problem to solve (a problem dealing with DoubleSolution individuals in this example) and the operators. The referenceParetoFront is used to indicate the name of the optional reference front:

    Problem<DoubleSolution> problem;
    Algorithm<List<DoubleSolution>> algorithm;
    CrossoverOperator<DoubleSolution> crossover;
    MutationOperator<DoubleSolution> mutation;
    SelectionOperator<List<DoubleSolution>, DoubleSolution> selection;
    String referenceParetoFront = "" ;

The next group of sentences parse the program arguments. A benchmark problem (ZDT1 in the example) is solved by default when no arguments are indicated:

    String problemName ;
    if (args.length == 1) {
      problemName = args[0];
    } else if (args.length == 2) {
      problemName = args[0] ;
      referenceParetoFront = args[1] ;
    } else {
      problemName = "org.uma.jmetal.problem.multiobjective.zdt.ZDT1";
      referenceParetoFront = "jmetal-problem/src/test/resources/pareto_fronts/ZDT1.pf" ;
    }

Next, the problem is loaded using its class name:

    problem = ProblemUtils.<DoubleSolution> loadProblem(problemName);

Then, the operators and the algorithm are configured:

    double crossoverProbability = 0.9 ;
    double crossoverDistributionIndex = 20.0 ;
    crossover = new SBXCrossover(crossoverProbability, crossoverDistributionIndex) ;

    double mutationProbability = 1.0 / problem.getNumberOfVariables() ;
    double mutationDistributionIndex = 20.0 ;
    mutation = new PolynomialMutation(mutationProbability, mutationDistributionIndex) ;

    selection = new BinaryTournamentSelection<DoubleSolution>(new RankingAndCrowdingDistanceComparator<DoubleSolution>());

    algorithm = new NSGAIIBuilder<DoubleSolution>(problem, crossover, mutation)
        .setSelectionOperator(selection)
        .setMaxEvaluations(25000)
        .setPopulationSize(100)
        .build() ;

The last step is to run the algorithm and to write the obtained solutions into two files: one for the variable values and one for the objective values; optionally, if a reference front has been provided it also prints the values of all the available quality indicators for the computed results:

    AlgorithmRunner algorithmRunner = new AlgorithmRunner.Executor(algorithm)
        .execute() ;

    List<DoubleSolution> population = algorithm.getResult() ;
    long computingTime = algorithmRunner.getComputingTime() ;

    JMetalLogger.logger.info("Total execution time: " + computingTime + "ms");

    printFinalSolutionSet(population);
    if (!referenceParetoFront.equals("")) {
      printQualityIndicators(population, referenceParetoFront) ;
    }
  }

Running an algorithm from an IDE

Once you have configured your algorithm, you can use your favorite IDE to execute them. For example, in the case of IntellJ Idea you can select the runner class name and select the option "Run 'NSGAIIRunner.main()'" by clicking with the left mouse button if you intend to run NSGA-II: Running with IntellJ Idea

As a result of the execution, the following messages are printed into the output console:

jul 27, 2015 4:21:59 PM org.uma.jmetal.runner.multiobjective.NSGAIIRunner main
INFORMACIÓN: Total execution time: 1147ms
jul 27, 2015 4:21:59 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Random seed: 1438006918503
jul 27, 2015 4:21:59 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Objectives values have been written to file FUN.tsv
jul 27, 2015 4:21:59 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Variables values have been written to file VAR.tsv
jul 27, 2015 4:22:00 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printQualityIndicators
INFORMACIÓN: 
Hypervolume (N) : 0.6594334269577787
Hypervolume     : 0.6594334269577787
Epsilon (N)     : 0.012122558511198256
Epsilon         : 0.012122558511198256
GD (N)          : 2.054388435747992E-4
GD              : 2.054388435747992E-4
IGD (N)         : 1.8304524180524584E-4
IGD             : 1.8304524180524584E-4
IGD+ (N)        : 0.003808931172199927
IGD+            : 0.003808931172199927
Spread (N)      : 0.34070732976112383
Spread          : 0.34070732976112383
R2 (N)          : 0.13179198315493879
R2              : 0.13179198315493879
Error ratio     : 1.0

The results tagged with (N) indicate that the fronts are normalized before computing the quality indicator.

Running an algorithm from the command line

If you plan to run a jMetal algorithm from the command line, you have to take into account the following requirements:

  1. Build the project with mvn package. This will create, for each subproject (i.e, jmetal-core, jmetal-problem, jmetal-algorithm, and jmetal-exec), a jar file with all the dependences.
  2. Indicate java the location of these jar files. You have at least two ways of doing it. One is to set the CLASSPATH environment variable:
export CLASSPATH=jmetal-core/target/jmetal-core-5.6-jar-with-dependencies.jar:jmetal-problem/target/jmetal-problem-5.6-jar-with-dependencies.jar:jmetal-exec/target/jmetal-exec-5.6-jar-with-dependencies.jar:jmetal-problem/target/jmetal-problem-5.6-jar-with-dependencies.jar

Then you can execute an algorithm this way (we are going to execute NSGA-II):

java org.uma.jmetal.runner.multiobjective.NSGAIIRunner 
  1. The other alternative is to indicate the location of these jar files using the -cp or -classpath options of the java command:
java -cp jmetal-exec/target/jmetal-exec-5.0-SNAPSHOT-jar-with-dependencies.jar:jmetal-core/target/jmetal-core-5.0-SNAPSHOT-jar-with-dependencies.jar:jmetal-problem/target/jmetal-problem-5.0-SNAPSHOT-jar-with-dependencies.jar:jmetal-algorithm/target/jmetal-algorithm-5.0-Beta-35-jar-with-dependencies.jar org.uma.jmetal.runner.multiobjective.NSGAIIRunner

This example executes NSGA-II with the default parameters. If you want to solve a given problem its class name must be provided as an argument. For example, to solve the benchmark problem ZDT4 the command would be:

java org.uma.jmetal.runner.multiobjective.NSGAIIRunner org.uma.jmetal.problem.multiobjective.zdt.ZDT4

and the output will be similar to this:

jul 27, 2015 6:48:27 PM org.uma.jmetal.runner.multiobjective.NSGAIIRunner main
INFORMACIÓN: Total execution time: 683ms
jul 27, 2015 6:48:27 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Random seed: 1438015706581
jul 27, 2015 6:48:27 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Objectives values have been written to file FUN.tsv
jul 27, 2015 6:48:27 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Variables values have been written to file VAR.tsv

In the case of problems having a known Pareto front (or a Pareto front approximation), adding the file containing it allows to apply the available quality indicators to the obtained front. This way, the command to solve ZDT4 would be:

java org.uma.jmetal.runner.multiobjective.NSGAIIRunner org.uma.jmetal.problem.multiobjective.zdt.ZDT4 jmetal-problem/src/test/resources/pareto_fronts/ZDT4.pf

and this would be output:

jul 27, 2015 6:49:21 PM org.uma.jmetal.runner.multiobjective.NSGAIIRunner main
INFORMACIÓN: Total execution time: 598ms
jul 27, 2015 6:49:21 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Random seed: 1438015760471
jul 27, 2015 6:49:21 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Objectives values have been written to file FUN.tsv
jul 27, 2015 6:49:21 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printFinalSolutionSet
INFORMACIÓN: Variables values have been written to file VAR.tsv
jul 27, 2015 6:49:21 PM org.uma.jmetal.runner.AbstractAlgorithmRunner printQualityIndicators
INFORMACIÓN: 
Hypervolume (N) : 0.6584874391103687
Hypervolume     : 0.658491021119803
Epsilon (N)     : 0.014508161683056214
Epsilon         : 0.014508161681605389
GD (N)          : 1.7281971372005978E-4
GD              : 1.7281858245371445E-4
IGD (N)         : 1.9833943989483466E-4
IGD             : 1.9833851420211548E-4
IGD+ (N)        : 0.00425088535021156
IGD+            : 0.004250860866635309
Spread (N)      : 0.4449171015114183
Spread          : 0.44491700055639544
R2 (N)          : 0.13208551920620412
R2              : 0.13208472309027727
Error ratio     : 1.0

The Solution interface

One of the first decisions that have to be taken when using metaheuristics is to define how to encode or represent the tentative solutions of the problem to solve. Representation strongly depends on the problem and determines the operations (e.g., recombination with other solutions, local search procedures, etc.) that can be applied. Thus, selecting a specific representation has a great impact on the behavior of metaheuristics and, hence, in the quality of the obtained results.

The following figure depicts the basic components that are used for representing solutions in jMetal 5: The Solution Interface where three representations are included: binary, real, and integer. By using this approach, many implementations can be provided for the same encoding, adding an extra degree of flexibility. The use of generics also allows that an attempt to incorrectly assign the value of a variable results in a compilation error, e.g., trying to assign to an int variable the variable value of a DoubleSolution.

The code of the Solution interface is shown next:

package org.uma.jmetal.solution;

public interface Solution<T> extends Serializable {
  public void setObjective(int index, double value) ;
  public double getObjective(int index) ;

  public T getVariableValue(int index) ;
  public void setVariableValue(int index, T value) ;
  public String getVariableValueString(int index) ;

  public int getNumberOfVariables() ;
  public int getNumberOfObjectives() ;

  public Solution<T> copy() ;

  public void setAttribute(Object id, Object value) ;
  public Object getAttribute(Object id) ;
}

The interface has methods for accessing both the variables and the objectives of a solution, a copy method, and to methods for accessing solution atributes.

Defining encodings

Defining a particular encoding implies implementing or extending the Solution interface. This way, the interfaces for solutions having a list of double and integer variables are defined as follows:

package org.uma.jmetal.solution;

public interface DoubleSolution extends Solution<Double> {
  public Double getLowerBound(int index) ;
  public Double getUpperBound(int index) ;
}
package org.uma.jmetal.solution;

public interface IntegerSolution extends Solution<Integer> {
  public Integer getLowerBound(int index) ;
  public Integer getUpperBound(int index) ;
}

These interfaces provide for getting the lower and upper bounds of the double and integer variables. The way of setting those values are left to the implementation classes.

In the case of a binary solution, the interface is:

import org.uma.jmetal.util.binarySet.BinarySet;

public interface BinarySolution extends Solution<BinarySet> {
  public int getNumberOfBits(int index) ;
  public int getTotalNumberOfBits() ;
}

assuming that we intend to represent a list of binary variables.

The adopted approach allows to define encodings having mixed variables. For example, this interface defines solutions composed of lists of double and integer values:

package org.uma.jmetal.solution;

public interface IntegerDoubleSolution extends Solution<Number> {
  public Number getLowerBound(int index) ;
  public Number getUpperBound(int index) ;
  public int getNumberOfIntegerVariables() ;
  public int getNumberOfDoubleVariables() ;
}

Implementing solutions

Once we have defined a set of interfaces for the different solutions, we provide default implementions to all of them. Our approach is to take as starting point an abstract class named AbstractGenericSolution:

package org.uma.jmetal.solution.impl;

public abstract class AbstractGenericSolution<T, P extends Problem<?>> implements Solution<T> {
  private double[] objectives;
  private List<T> variables;
  protected P problem ;
  protected double overallConstraintViolationDegree ;
  protected int numberOfViolatedConstraints ;
  protected Map<Object, Object> attributes ;
  protected final JMetalRandom randomGenerator ;

which contains an implementation to all the methods in Solution. This class is extended by all the solution implementations in jMetal 5: DefaultBinarySolution, DefaultIntegerSolution, DefaultDoubleSolution, DefaultIntegerDoubleSolution, DefaultIntegerPermutationSolution, and DefaultDoubleBinarySolution.

Where are the populations?

In jMetal 5 there is not any class to represent the concept of population. Instead, a Java List of Solution objects is used.

Some examples:

/* A population of double solutions */
List<DoubleSolution> doublePopulation ;

/* The same population using the generic interface */
List<Solution<Double>> doublePopulation ;

/* A population of binary solutions */
List<BinarySolucion> binaryPopulation ;

An utility class called SolutionListUtils offers a set of operations over solution lists, such as finding the best/worst solution, selecting solutions randomly, etc.

Solution attributes

The idea of incorporating attributes is to allow to add specific fields to solutions that are needed by some algorithms. For example, NSGA-II requires to rank the solutions and assign them the value of the crowding distance, while SPEA2 assigns a raw fitness to the solutions.

The attributes manipulated directly, but we include also this utility interface:

package org.uma.jmetal.util.solutionattribute;
/**
 * Attributes allows to extend the {@link Solution} classes to incorporate data required by
 * operators or algorithms manipulating them.
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 */
public interface SolutionAttribute <S extends Solution<?>, V> {
  public void setAttribute(S solution, V value) ;
  public V getAttribute(S solution) ;
  public Object getAttributeID() ;
}

and a default implementation:

package org.uma.jmetal.util.solutionattribute.impl;

public class GenericSolutionAttribute <S extends Solution<?>, V> implements SolutionAttribute<S, V>{

  @SuppressWarnings("unchecked")
  @Override
  public V getAttribute(S solution) {
    return (V)solution.getAttribute(getAttributeID());
  }

  @Override
  public void setAttribute(S solution, V value) {
     solution.setAttribute(getAttributeID(), value);
  }

  @Override
  public Object getAttributeID() {
    return this.getClass() ;
  }
}

Note that in the current implementation the getAttributedID() returns a class identifier. This means that we cannot have two different attributes of the same class.

Example of attribute: constraints

Optimization problems can have side constraints, and this implies that evaluating a solution requires to compute the objective functions and also the constraints to apply some kind of constraint handling mechanism. In jMetal 5 solution attributes are used to incorporate constraint information into the solutions.

The default constraint handling mechanism in jMetal is the overall constraing violation scheme defined in NSGA-II, so the following class is provided:

package org.uma.jmetal.util.solutionattribute.impl;
public class OverallConstraintViolation<S extends Solution<?>> extends GenericSolutionAttribute<S, Double> {
}

It is an empty class extending GenericSolutionAttribute specifying a double value for the attribute. Typically, the constraints are evaluted in the class defining the problem as is shown in this example:

package org.uma.jmetal.problem.multiobjective;

/** Class representing problem Binh2 */
public class Binh2 extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution> {
  public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree ;
  public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints ;
  /**
   * Constructor
   * Creates a default instance of the Binh2 problem
   */
  public Binh2() {
    ...
    overallConstraintViolationDegree = new OverallConstraintViolation<DoubleSolution>() ;
    numberOfViolatedConstraints = new NumberOfViolatedConstraints<DoubleSolution>() ;
  }

  /** Evaluate() method */
  @Override
  public void evaluate(DoubleSolution solution) {
     ...
  }

  /** EvaluateConstraints() method */
  @Override
  public void evaluateConstraints(DoubleSolution solution)  {
    double[] constraint = new double[this.getNumberOfConstraints()];

    double x0 = solution.getVariableValue(0) ;
    double x1 = solution.getVariableValue(1) ;

    constraint[0] = -1.0 * (x0 - 5) * (x0 - 5) - x1 * x1 + 25.0;
    constraint[1] = (x0 - 8) * (x0 - 8) + (x1 + 3) * (x1 + 3) - 7.7;

    double overallConstraintViolation = 0.0;
    int violatedConstraints = 0;
    for (int i = 0; i < this.getNumberOfConstraints(); i++) {
      if (constraint[i] < 0.0) {
        overallConstraintViolation += constraint[i];
        violatedConstraints++;
      }
    }

    overallConstraintViolationDegree.setAttribute(solution, overallConstraintViolation);
    numberOfViolatedConstraints.setAttribute(solution, violatedConstraints);
  }

This code includes also another attribute, called NumberOfViolatedConstraints that is used to set the number of violated constraints of a given solution.

Example of attribute: ranking

The use of solution attributes can be encapsulated. As an example, we have defined the following interface to assign a rank to a solution (i.e, NSGA-II’s ranking):

package org.uma.jmetal.util.solutionattribute;

import java.util.List;

/**
 * Ranks a list of solutions according to the dominance relationship
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 */
public interface Ranking<S extends Solution<?>> extends SolutionAttribute<S, Integer>{
  public Ranking<S> computeRanking(List<S> solutionList) ;
  public List<S> getSubfront(int rank) ;
  public int getNumberOfSubfronts() ;
}

so that a client class (e.g., the NSGAII class) can merely use:

Ranking ranking = computeRanking(jointPopulation);

This way, the solution attribute is managed internally by the class implementing the ranking and is hidden to the metaheuristic.

API documentation

org.uma.jmetal.algorithm

Algorithm

public interface Algorithm<Result> extends Runnable, Serializable, DescribedEntity

Interface representing an algorithm

Author:

Antonio J. Nebro

Parameters:
  • <Result> – Result
Methods
getResult
Result getResult()
run
void run()

InteractiveAlgorithm

public interface InteractiveAlgorithm<S, R> extends Algorithm<R>
Methods
updatePointOfInterest
public void updatePointOfInterest(List<Double> newReferencePoints)

org.uma.jmetal.algorithm.impl

AbstractCoralReefsOptimization

public abstract class AbstractCoralReefsOptimization<S, R> implements Algorithm<R>

Abstract class representing a Coral Reefs Optimization Algorithm Reference: S. Salcedo-Sanz, J. Del Ser, S. Gil-López, I. Landa-Torres and J. A. Portilla-Figueras, “The coral reefs optimization algorithm: an efficient meta-heuristic for solving hard optimization problems,” 15th Applied Stochastic Models and Data Analysis International Conference, Mataró, Spain, June, 2013.

Author:Inacio Medeiros
Fields
comparator
protected Comparator<S> comparator
coordinates
protected List<Coordinate> coordinates
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
mutationOperator
protected MutationOperator<S> mutationOperator
population
protected List<S> population
selectionOperator
protected SelectionOperator<List<S>, S> selectionOperator
Constructors
AbstractCoralReefsOptimization
public AbstractCoralReefsOptimization(Comparator<S> comparator, SelectionOperator<List<S>, S> selectionOperator, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, int n, int m, double rho, double fbs, double fa, double pd, int attemptsToSettle)

Constructor

Parameters:
  • comparator – Object for comparing two solutions
  • selectionOperator – Selection Operator
  • crossoverOperator – Crossover Operator
  • mutationOperator – Mutation Operator
  • n – width of Coral Reef Grid
  • m – height of Coral Reef Grid
  • rho – Percentage of occupied reef
  • fbs – Percentage of broadcast spawners
  • fa – Percentage of budders
  • pd – Probability of depredation
  • attemptsToSettle – number of attempts a larvae has to try to settle reef
Methods
asexualReproduction
protected abstract List<S> asexualReproduction(List<S> brooders)
createInitialPopulation
protected abstract List<S> createInitialPopulation()
depredation
protected abstract List<S> depredation(List<S> population, List<Coordinate> coordinates)
evaluatePopulation
protected abstract List<S> evaluatePopulation(List<S> population)
generateCoordinates
protected abstract List<Coordinate> generateCoordinates()
getAttemptsToSettle
public int getAttemptsToSettle()
getCoordinates
public List<Coordinate> getCoordinates()
getFa
public double getFa()
getFbr
public double getFbr()
getFbs
public double getFbs()
getFd
public double getFd()
getM
public int getM()
getN
public int getN()
getPd
public double getPd()
getPopulation
public List<S> getPopulation()
getPopulationSize
public int getPopulationSize()
getResult
public abstract R getResult()
getRho
public double getRho()
initProgress
protected abstract void initProgress()
isStoppingConditionReached
protected abstract boolean isStoppingConditionReached()
larvaeSettlementPhase
protected abstract List<S> larvaeSettlementPhase(List<S> larvae, List<S> population, List<Coordinate> coordinates)
run
public void run()
selectBroadcastSpawners
protected abstract List<S> selectBroadcastSpawners(List<S> population)
setCoordinates
public void setCoordinates(List<Coordinate> coordinates)
setPopulation
public void setPopulation(List<S> population)
sexualReproduction
protected abstract List<S> sexualReproduction(List<S> broadcastSpawners)
updateProgress
protected abstract void updateProgress()

AbstractCoralReefsOptimization.Coordinate

public static class Coordinate implements Comparable<Coordinate>

Represents a Coordinate in Coral Reef Grid

Author:inacio-medeiros
Constructors
Coordinate
public Coordinate(int x, int y)

Constructor

Parameters:
  • x – Coordinate’s x-position
  • y – Coordinate’s y-position
Methods
compareTo
public int compareTo(Coordinate arg0)
equals
public boolean equals(Object obj)
getX
public int getX()

Retrieves Coordinate’s x-position

Returns:Coordinate’s x-position
getY
public int getY()

Retrieves Coordinate’s y-position

Returns:Coordinate’s y-position
setX
public void setX(int x)

Sets Coordinate’s x-position to a new value

Parameters:
  • x – new value for Coordinate’s x-position
setY
public void setY(int y)

Sets Coordinate’s y-position to a new value

Parameters:
  • x – new value for Coordinate’s y-position

AbstractDifferentialEvolution

public abstract class AbstractDifferentialEvolution<Result> extends AbstractEvolutionaryAlgorithm<DoubleSolution, Result>

Abstract class representing differential evolution (DE) algorithms

Author:Antonio J. Nebro
Fields
crossoverOperator
protected DifferentialEvolutionCrossover crossoverOperator
selectionOperator
protected DifferentialEvolutionSelection selectionOperator

AbstractEvolutionStrategy

public abstract class AbstractEvolutionStrategy<S, Result> extends AbstractEvolutionaryAlgorithm<S, Result>

Abstract class representing an evolution strategy algorithm

Author:Antonio J. Nebro
Fields
mutationOperator
protected MutationOperator<S> mutationOperator
Constructors
AbstractEvolutionStrategy
public AbstractEvolutionStrategy(Problem<S> problem)

Constructor

Parameters:
  • problem – The problem to solve
Methods
getMutationOperator
public MutationOperator<S> getMutationOperator()

AbstractEvolutionaryAlgorithm

public abstract class AbstractEvolutionaryAlgorithm<S, R> implements Algorithm<R>

Abstract class representing an evolutionary algorithm

Author:

Antonio J. Nebro

Parameters:
  • <S> – Solution
  • <R> – Result
Fields
population
protected List<S> population
problem
protected Problem<S> problem
Methods
createInitialPopulation
protected abstract List<S> createInitialPopulation()
evaluatePopulation
protected abstract List<S> evaluatePopulation(List<S> population)
getPopulation
public List<S> getPopulation()
getProblem
public Problem<S> getProblem()
getResult
public abstract R getResult()
initProgress
protected abstract void initProgress()
isStoppingConditionReached
protected abstract boolean isStoppingConditionReached()
replacement
protected abstract List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected abstract List<S> reproduction(List<S> population)
run
public void run()
selection
protected abstract List<S> selection(List<S> population)
setPopulation
public void setPopulation(List<S> population)
setProblem
public void setProblem(Problem<S> problem)
updateProgress
protected abstract void updateProgress()

AbstractGeneticAlgorithm

public abstract class AbstractGeneticAlgorithm<S, Result> extends AbstractEvolutionaryAlgorithm<S, Result>

Abstract class representing a genetic algorithm

Author:Antonio J. Nebro
Fields
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
maxPopulationSize
protected int maxPopulationSize
mutationOperator
protected MutationOperator<S> mutationOperator
selectionOperator
protected SelectionOperator<List<S>, S> selectionOperator
Constructors
AbstractGeneticAlgorithm
public AbstractGeneticAlgorithm(Problem<S> problem)

Constructor

Parameters:
  • problem – The problem to solve
Methods
checkNumberOfParents
protected void checkNumberOfParents(List<S> population, int numberOfParentsForCrossover)

A crossover operator is applied to a number of parents, and it assumed that the population contains a valid number of solutions. This method checks that.

Parameters:
  • population
  • numberOfParentsForCrossover
createInitialPopulation
protected List<S> createInitialPopulation()

This method implements a default scheme create the initial population of genetic algorithm

getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getMaxPopulationSize
public int getMaxPopulationSize()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
reproduction
protected List<S> reproduction(List<S> population)

This methods iteratively applies a CrossoverOperator a MutationOperator to the population to create the offspring population. The population size must be divisible by the number of parents required by the CrossoverOperator; this way, the needed parents are taken sequentially from the population. No limits are imposed to the number of solutions returned by the CrossoverOperator.

Parameters:
  • population
Returns:

The new created offspring population

selection
protected List<S> selection(List<S> population)

This method iteratively applies a SelectionOperator to the population to fill the mating pool population.

Parameters:
  • population
Returns:

The mating pool population

setMaxPopulationSize
public void setMaxPopulationSize(int maxPopulationSize)

AbstractParticleSwarmOptimization

public abstract class AbstractParticleSwarmOptimization<S, Result> implements Algorithm<Result>

Abstract class representing a PSO algorithm

Author:Antonio J. Nebro
Methods
createInitialSwarm
protected abstract List<S> createInitialSwarm()
evaluateSwarm
protected abstract List<S> evaluateSwarm(List<S> swarm)
getResult
public abstract Result getResult()
getSwarm
public List<S> getSwarm()
initProgress
protected abstract void initProgress()
initializeLeader
protected abstract void initializeLeader(List<S> swarm)
initializeParticlesMemory
protected abstract void initializeParticlesMemory(List<S> swarm)
initializeVelocity
protected abstract void initializeVelocity(List<S> swarm)
isStoppingConditionReached
protected abstract boolean isStoppingConditionReached()
perturbation
protected abstract void perturbation(List<S> swarm)
run
public void run()
setSwarm
public void setSwarm(List<S> swarm)
updateLeaders
protected abstract void updateLeaders(List<S> swarm)
updateParticlesMemory
protected abstract void updateParticlesMemory(List<S> swarm)
updatePosition
protected abstract void updatePosition(List<S> swarm)
updateProgress
protected abstract void updateProgress()
updateVelocity
protected abstract void updateVelocity(List<S> swarm)

AbstractScatterSearch

public abstract class AbstractScatterSearch<S, R> implements Algorithm<R>

Abstract class representing a scatter search algorithm

Author:

Antonio J. Nebro

Parameters:
  • <S> – Solution
  • <R> – Result
Methods
diversificationGeneration
public abstract S diversificationGeneration()
getPopulation
public List<S> getPopulation()
getPopulationSize
public int getPopulationSize()
getResult
public abstract R getResult()
improvement
public abstract S improvement(S solution)
initializationPhase
public void initializationPhase()

Initialization phase of the scatter search: the population is filled with diverse solutions that have been improved.

Returns:The population
isStoppingConditionReached
public abstract boolean isStoppingConditionReached()
referenceSetUpdate
public abstract void referenceSetUpdate()
referenceSetUpdate
public abstract void referenceSetUpdate(S solution)
restart
public abstract void restart()
restartConditionIsFulfilled
public abstract boolean restartConditionIsFulfilled(List<S> solutionList)
run
public void run()
setPopulation
public void setPopulation(List<S> population)
setPopulationSize
public void setPopulationSize(int populationSize)
solutionCombination
public abstract List<S> solutionCombination(List<List<S>> population)
subsetGeneration
public abstract List<List<S>> subsetGeneration()

org.uma.jmetal.algorithm.multiobjective.abyss

ABYSS

public class ABYSS extends AbstractScatterSearch<DoubleSolution, List<DoubleSolution>>

This class implements the AbYSS algorithm, a multiobjective scatter search metaheuristics, which is described in: A.J. Nebro, F. Luna, E. Alba, B. Dorronsoro, J.J. Durillo, A. Beham “AbYSS: Adapting Scatter Search to Multiobjective Optimization.” IEEE Transactions on Evolutionary Computation. Vol. 12, No. 4 (August 2008), pp. 439-457

Author:Antonio J. Nebro , Cristobal Barba
Fields
archive
protected Archive<DoubleSolution> archive
archiveSize
protected final int archiveSize
crossover
protected CrossoverOperator<DoubleSolution> crossover
crowdingDistanceComparator
protected Comparator<DoubleSolution> crowdingDistanceComparator
distanceToSolutionListAttribute
protected DistanceToSolutionListAttribute distanceToSolutionListAttribute
dominanceComparator
protected Comparator<DoubleSolution> dominanceComparator
equalComparator
protected Comparator<DoubleSolution> equalComparator
evaluations
protected int evaluations
fitnessComparator
protected Comparator<DoubleSolution> fitnessComparator
frequency
protected int[][] frequency
localSearch
protected LocalSearchOperator<DoubleSolution> localSearch
marked
protected MarkAttribute marked
maxEvaluations
protected final int maxEvaluations
numberOfSubRanges
protected int numberOfSubRanges

These variables are used in the diversification method.

problem
protected final Problem<DoubleSolution> problem
randomGenerator
protected JMetalRandom randomGenerator
referenceSet1
protected List<DoubleSolution> referenceSet1
referenceSet1Size
protected final int referenceSet1Size
referenceSet2
protected List<DoubleSolution> referenceSet2
referenceSet2Size
protected final int referenceSet2Size
reverseFrequency
protected int[][] reverseFrequency
strengthRawFitness
protected StrengthRawFitness<DoubleSolution> strengthRawFitness
sumOfFrequencyValues
protected int[] sumOfFrequencyValues
sumOfReverseFrequencyValues
protected int[] sumOfReverseFrequencyValues
Constructors
ABYSS
public ABYSS(DoubleProblem problem, int maxEvaluations, int populationSize, int referenceSet1Size, int referenceSet2Size, int archiveSize, Archive<DoubleSolution> archive, LocalSearchOperator<DoubleSolution> localSearch, CrossoverOperator<DoubleSolution> crossoverOperator, int numberOfSubRanges)
Methods
buildNewReferenceSet1
public void buildNewReferenceSet1()

Build the referenceSet1 by moving the best referenceSet1Size individuals, according to a fitness comparator, from the population to the referenceSet1

buildNewReferenceSet2
public void buildNewReferenceSet2()

Build the referenceSet2 by moving to it the most diverse referenceSet2Size individuals from the population in respect to the referenceSet1. The size of the referenceSet2 can be lower than referenceSet2Size depending on the current size of the population

diversificationGeneration
public DoubleSolution diversificationGeneration()
generatePairsFromSolutionList
public List<List<DoubleSolution>> generatePairsFromSolutionList(List<DoubleSolution> solutionList)

Generate all pair combinations of the referenceSet1

getDescription
public String getDescription()
getName
public String getName()
getResult
public List<DoubleSolution> getResult()
improvement
public DoubleSolution improvement(DoubleSolution solution)
isStoppingConditionReached
public boolean isStoppingConditionReached()
refSet1Test
public boolean refSet1Test(DoubleSolution solution)

Tries to update the reference set one with a solution

Parameters:
  • solution – The Solution
Returns:

true if the Solution has been inserted, false otherwise.

refSet2Test
public boolean refSet2Test(DoubleSolution solution)

Try to update the reference set 2 with a Solution

Parameters:
  • solution – The Solution
Throws:
  • JMException
Returns:

true if the Solution has been inserted, false otherwise.

referenceSetUpdate
public void referenceSetUpdate()

Build the reference set after the initialization phase

referenceSetUpdate
public void referenceSetUpdate(DoubleSolution solution)

Update the reference set with a new solution

Parameters:
  • solution
restart
public void restart()
restartConditionIsFulfilled
public boolean restartConditionIsFulfilled(List<DoubleSolution> combinedSolutions)
solutionCombination
public List<DoubleSolution> solutionCombination(List<List<DoubleSolution>> solutionList)
subsetGeneration
public List<List<DoubleSolution>> subsetGeneration()

Subset generation method

ABYSSBuilder

public class ABYSSBuilder implements AlgorithmBuilder<ABYSS>
Author:Cristobal Barba
Fields
improvementOperator
protected LocalSearchOperator<DoubleSolution> improvementOperator
Constructors
ABYSSBuilder
public ABYSSBuilder(DoubleProblem problem, Archive<DoubleSolution> archive)
Methods
build
public ABYSS build()
getArchiveSize
public int getArchiveSize()
getCrossoverOperator
public CrossoverOperator<DoubleSolution> getCrossoverOperator()
getImprovementOperator
public LocalSearchOperator<DoubleSolution> getImprovementOperator()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<DoubleSolution> getMutationOperator()
getNumberOfSubranges
public int getNumberOfSubranges()
getPopulationSize
public int getPopulationSize()
getRefSet1Size
public int getRefSet1Size()
getRefSet2Size
public int getRefSet2Size()
setArchiveSize
public ABYSSBuilder setArchiveSize(int archiveSize)
setCrossoverOperator
public ABYSSBuilder setCrossoverOperator(CrossoverOperator<DoubleSolution> crossoverOperator)
setImprovementOperator
public ABYSSBuilder setImprovementOperator(ArchiveMutationLocalSearch<DoubleSolution> improvementOperator)
setMaxEvaluations
public ABYSSBuilder setMaxEvaluations(int maxEvaluations)
setMutationOperator
public ABYSSBuilder setMutationOperator(MutationOperator<DoubleSolution> mutationOperator)
setNumberOfSubranges
public ABYSSBuilder setNumberOfSubranges(int numberOfSubranges)
setPopulationSize
public ABYSSBuilder setPopulationSize(int populationSize)
setRefSet1Size
public ABYSSBuilder setRefSet1Size(int refSet1Size)
setRefSet2Size
public ABYSSBuilder setRefSet2Size(int refSet2Size)

ABYSSIT

public class ABYSSIT

Created by ajnebro on 11/6/15.

Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
archive
Archive<DoubleSolution> archive
crossover
CrossoverOperator<DoubleSolution> crossover
localSearchOperator
LocalSearchOperator<DoubleSolution> localSearchOperator
problem
DoubleProblem problem
Methods
setup
public void setup()
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

ABYSSTest

public class ABYSSTest

Created by ajnebro on 11/6/15.

Fields
archive
Archive<DoubleSolution> archive
localSearch
LocalSearchOperator<DoubleSolution> localSearch
problem
DoubleProblem problem
Methods
setup
public void setup()
shouldInitializationPhaseLeadToAPopulationFilledWithEvaluatedSolutions
public void shouldInitializationPhaseLeadToAPopulationFilledWithEvaluatedSolutions()
shouldIsStoppingConditionReachedReturnFalseIfTheConditionDoesNotFulfill
public void shouldIsStoppingConditionReachedReturnFalseIfTheConditionDoesNotFulfill()
shouldIsStoppingConditionReachedReturnTrueIfTheConditionFulfills
public void shouldIsStoppingConditionReachedReturnTrueIfTheConditionFulfills()
shouldReferenceSetUpdateCreateAReducedSizeReferenceSet2IfThePopulationIsNotBigEnough
public void shouldReferenceSetUpdateCreateAReducedSizeReferenceSet2IfThePopulationIsNotBigEnough()
shouldReferenceSetUpdateCreateTheTwoRefSetsAfterBeingInvokedTheFirstTime
public void shouldReferenceSetUpdateCreateTheTwoRefSetsAfterBeingInvokedTheFirstTime()
shouldRestartCreateANewPopulationWithTheRefSet1Solutions
public void shouldRestartCreateANewPopulationWithTheRefSet1Solutions()
shouldSolutionCombinationProduceTheRightNumberOfSolutions
public void shouldSolutionCombinationProduceTheRightNumberOfSolutions()
shouldSubsetGenerationProduceAnEmptyListIfAllTheSolutionsAreMarked
public void shouldSubsetGenerationProduceAnEmptyListIfAllTheSolutionsAreMarked()

org.uma.jmetal.algorithm.multiobjective.abyss.util

MarkAttribute

public class MarkAttribute extends GenericSolutionAttribute<Solution<?>, Boolean>

Created by cbarba on 24/3/15.

org.uma.jmetal.algorithm.multiobjective.artificialdecisionmaker

ArtificiallDecisionMakerIT

public class ArtificiallDecisionMakerIT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()

org.uma.jmetal.algorithm.multiobjective.cdg

AbstractCDG

public abstract class AbstractCDG<S extends Solution<?>> implements Algorithm<List<S>>

Abstract class for implementing versions of the CDG algorithm.

Author:Feng Zhang
Fields
badPopulation
protected List<S> badPopulation
badSolution
protected int[] badSolution
badSolutionNum
protected int badSolutionNum
border
protected List<List<S>> border
borderLength
protected int borderLength
childGridNum
protected int childGridNum_
childGrid
protected int childGrid_
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
d
protected double[] d_
evaluations
protected int evaluations
gridDetalSum
protected double[][] gridDetalSum_
gridDetal
protected int[] gridDetal_
idealPoint
protected double[] idealPoint

Z vector in Zhang & Li paper

k
protected int k_
maxEvaluations
protected int maxEvaluations
nadirPoint
protected double[] nadirPoint
neighborhood
protected int[][] neighborhood
neighborhoodNum
protected int[] neighborhoodNum
neighborhoodSelectionProbability
protected double neighborhoodSelectionProbability

Delta in Zhang & Li paper

population
protected List<S> population
populationSize
protected int populationSize
problem
protected Problem<S> problem
randomGenerator
protected JMetalRandom randomGenerator
resultPopulationSize
protected int resultPopulationSize
sigma
protected double sigma_
slimDetal
protected int slimDetal_
spPopulationOrder
protected List<Integer> spPopulationOrder
specialPopulation
protected List<S> specialPopulation
subP
protected int[][] subP
subPNum
protected int[] subPNum
subproblem
protected List<List<S>> subproblem
subproblemNum
protected int subproblemNum_
t
protected int t_
team
protected List<List<Integer>> team
tempBorder
protected List<List<S>> tempBorder
Constructors
AbstractCDG
public AbstractCDG(Problem<S> problem, int populationSize, int resultPopulationSize, int maxEvaluations, CrossoverOperator<S> crossoverOperator, double neighborhoodSelectionProbability, double sigma_, int k_, int t_, int subproblemNum_, int childGrid_, int childGridNum_)
Methods
allocateSolution
protected void allocateSolution()
chooseNeighborType
protected NeighborType chooseNeighborType(int i)
chooseSolution
protected void chooseSolution()
chooseSpecialPopulation
protected void chooseSpecialPopulation()
excludeBadSolution
protected void excludeBadSolution()
excludeBadSolution3
protected void excludeBadSolution3()
getBorder
protected void getBorder()
getG
protected int getG(S individual, int index)
getGridPos
protected int getGridPos(int j, double funValue)
getOrder
protected int getOrder(S individual)
getPos
protected int getPos(int i, int j, int k)
getRank
protected int getRank(S individual, int index)
getResult
public List<S> getResult()
gridSystemSetup
protected void gridSystemSetup()
gridSystemSetup3
protected void gridSystemSetup3()
group2
protected void group2()
group3
protected void group3()
individualObjRankSort
protected void individualObjRankSort()
initialCDGAttributes
protected void initialCDGAttributes(S individual)
initialGridDetal
protected void initialGridDetal()
initializeIdealPoint
protected void initializeIdealPoint()
initializeNadirPoint
protected void initializeNadirPoint()
initializeNeighborhood
protected void initializeNeighborhood()

Initialize cdg neighborhoods

initializeNeighborhoodGrid
protected void initializeNeighborhoodGrid()
initializeSubP2
protected void initializeSubP2()
initializeSubP3
protected void initializeSubP3()
isInner
protected boolean isInner(S individual)
lexicographicSort
protected void lexicographicSort()
matingSelection
protected List<Integer> matingSelection(int subproblemId, int numberOfSolutionsToSelect, NeighborType neighbourType)
Parameters:
  • subproblemId – the id of current subproblem
  • neighbourType – neighbour type
parentSelection
protected List<S> parentSelection(int subProblemId, NeighborType neighborType)
paretoDom
protected boolean paretoDom(S individual, int i)
paretoFilter
protected void paretoFilter()
rankBasedSelection
protected void rankBasedSelection()
setG
protected void setG(S individual, int index, int value)
setIndividualObjRank
protected void setIndividualObjRank()
setOrder
protected void setOrder(S individual, int value)
setRank
protected void setRank(S individual, int index, int value)
setSpIndividualRank
protected void setSpIndividualRank()
subproblemSortl
protected void subproblemSortl()
supplyBadSolution
protected void supplyBadSolution()
updateBorder
protected void updateBorder()
updateIdealPoint
protected void updateIdealPoint(S individual)
updateNadirPoint
void updateNadirPoint()
updateNeighborhood
protected void updateNeighborhood()

AbstractCDG.NeighborType

protected enum NeighborType
Enum Constants
NEIGHBOR
public static final AbstractCDG.NeighborType NEIGHBOR
POPULATION
public static final AbstractCDG.NeighborType POPULATION

CDG

public class CDG extends AbstractCDG<DoubleSolution>

Xinye Cai, Zhiwei Mei, Zhun Fan, Qingfu Zhang, A Constrained Decomposition Approach with Grids for Evolutionary Multiobjective Optimization, IEEE Transaction on Evolutionary Computation, press online, 2018, DOI: 10.1109/TEVC.2017.2744674 The paper and Matlab code can be download at http://xinyecai.github.io/

Author:Feng Zhang
Constructors
CDG
public CDG(Problem<DoubleSolution> problem, int populationSize, int resultPopulationSize, int maxEvaluations, CrossoverOperator<DoubleSolution> crossover, double neighborhoodSelectionProbability, double sigma_, int k_, int t_, int subproblemNum_, int childGrid_, int childGridNum_)
Methods
getDescription
public String getDescription()
getName
public String getName()
initializePopulation
protected void initializePopulation()
run
public void run()

CDGBuilder

public class CDGBuilder implements AlgorithmBuilder<AbstractCDG<DoubleSolution>>

Builder class for algorithm CDG

Author:Feng Zhang
Fields
childGridNum
protected int childGridNum_
childGrid
protected int childGrid_
crossover
protected CrossoverOperator<DoubleSolution> crossover
k
protected int k_
maxEvaluations
protected int maxEvaluations
neighborhoodSelectionProbability
protected double neighborhoodSelectionProbability

Delta in Zhang & Li paper

numberOfThreads
protected int numberOfThreads
populationSize
protected int populationSize
problem
protected Problem<DoubleSolution> problem
resultPopulationSize
protected int resultPopulationSize
sigma
protected double sigma_
subproblemNum
protected int subproblemNum_
t
protected int t_
Constructors
CDGBuilder
public CDGBuilder(Problem<DoubleSolution> problem)

Constructor

Methods
build
public AbstractCDG<DoubleSolution> build()
getChildGrid
public int getChildGrid()
getChildGridNum
public int getChildGridNum()
getCrossover
public CrossoverOperator<DoubleSolution> getCrossover()
getK
public int getK()
getMaxEvaluations
public int getMaxEvaluations()
getNeighborhoodSelectionProbability
public double getNeighborhoodSelectionProbability()
getNumberOfThreads
public int getNumberOfThreads()
getPopulationSize
public int getPopulationSize()
getResultPopulationSize
public int getResultPopulationSize()
getT
public double getT()
setChildGrid
public CDGBuilder setChildGrid(int childGrid)
setChildGridNum
public CDGBuilder setChildGridNum(int childGridNum)
setCrossover
public CDGBuilder setCrossover(CrossoverOperator<DoubleSolution> crossover)
setK
public CDGBuilder setK(int k)
setMaxEvaluations
public CDGBuilder setMaxEvaluations(int maxEvaluations)
setNeighborhoodSelectionProbability
public CDGBuilder setNeighborhoodSelectionProbability(double neighborhoodSelectionProbability)
setNumberOfThreads
public CDGBuilder setNumberOfThreads(int numberOfThreads)
setPopulationSize
public CDGBuilder setPopulationSize(int populationSize)
setResultPopulationSize
public CDGBuilder setResultPopulationSize(int resultPopulationSize)
setT
public CDGBuilder setT(int t)

org.uma.jmetal.algorithm.multiobjective.cellde

CellDE

public class CellDE
Author:Antonio J. Nebro

CellDE45

public class CellDE45 implements Algorithm<List<DoubleSolution>>
Author:Antonio J. Nebro
Fields
evaluations
protected int evaluations
maxEvaluations
protected int maxEvaluations
Constructors
CellDE45
public CellDE45(Problem<DoubleSolution> problem, int maxEvaluations, int populationSize, BoundedArchive<DoubleSolution> archive, Neighborhood<DoubleSolution> neighborhood, SelectionOperator<List<DoubleSolution>, DoubleSolution> selection, DifferentialEvolutionCrossover crossover, double feedback, SolutionListEvaluator<DoubleSolution> evaluator)
Methods
computeRanking
protected Ranking<DoubleSolution> computeRanking(List<DoubleSolution> solutionList)
createInitialPopulation
protected List<DoubleSolution> createInitialPopulation()
evaluatePopulation
protected List<DoubleSolution> evaluatePopulation(List<DoubleSolution> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<DoubleSolution> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
run
public void run()
updateProgress
protected void updateProgress()

org.uma.jmetal.algorithm.multiobjective.dmopso

DMOPSO

public class DMOPSO implements Algorithm<List<DoubleSolution>>
Fields
dataDirectory
String dataDirectory
functionType
FunctionType functionType
indArray
DoubleSolution[] indArray
iterations
protected int iterations
lambda
double[][] lambda
maxAge
protected int maxAge
maxIterations
protected int maxIterations
swarmSize
protected int swarmSize
z
double[] z
Constructors
DMOPSO
public DMOPSO(DoubleProblem problem, int swarmSize, int maxIterations, double r1Min, double r1Max, double r2Min, double r2Max, double c1Min, double c1Max, double c2Min, double c2Max, double weightMin, double weightMax, double changeVelocity1, double changeVelocity2, FunctionType functionType, String dataDirectory, int maxAge)
DMOPSO
public DMOPSO(DoubleProblem problem, int swarmSize, int maxIterations, double r1Min, double r1Max, double r2Min, double r2Max, double c1Min, double c1Max, double c2Min, double c2Max, double weightMin, double weightMax, double changeVelocity1, double changeVelocity2, FunctionType functionType, String dataDirectory, int maxAge, String name)
Methods
createInitialSwarm
protected List<DoubleSolution> createInitialSwarm()
evaluateSwarm
protected List<DoubleSolution> evaluateSwarm(List<DoubleSolution> swarm)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<DoubleSolution> getResult()
getSwarm
public List<DoubleSolution> getSwarm()
initProgress
protected void initProgress()
initializeLeaders
protected void initializeLeaders(List<DoubleSolution> swarm)
initializeParticlesMemory
protected void initializeParticlesMemory(List<DoubleSolution> swarm)
initializeVelocity
protected void initializeVelocity(List<DoubleSolution> swarm)
isStoppingConditionReached
protected boolean isStoppingConditionReached()
run
public void run()
updateProgress
protected void updateProgress()
updateVelocity
protected void updateVelocity(int i)

DMOPSO.FunctionType

public enum FunctionType
Enum Constants
AGG
public static final DMOPSO.FunctionType AGG
PBI
public static final DMOPSO.FunctionType PBI
TCHE
public static final DMOPSO.FunctionType TCHE

DMOPSOBuilder

public class DMOPSOBuilder implements AlgorithmBuilder<DMOPSO>
Author:Jorge Rodriguez
Constructors
DMOPSOBuilder
public DMOPSOBuilder(DoubleProblem problem)
Methods
build
public DMOPSO build()
getC1Max
public double getC1Max()
getC1Min
public double getC1Min()
getC2Max
public double getC2Max()
getC2Min
public double getC2Min()
getChangeVelocity1
public double getChangeVelocity1()
getChangeVelocity2
public double getChangeVelocity2()
getDataDirectory
public String getDataDirectory()
getEvaluator
public SolutionListEvaluator<DoubleSolution> getEvaluator()
getFunctionType
public DMOPSO.FunctionType getFunctionType()
getMaxAge
public int getMaxAge()
getMaxIterations
public int getMaxIterations()
getName
public String getName()
getProblem
public DoubleProblem getProblem()
getR1Max
public double getR1Max()
getR1Min
public double getR1Min()
getR2Max
public double getR2Max()
getR2Min
public double getR2Min()
getSwarmSize
public int getSwarmSize()
getWeightMax
public double getWeightMax()
getWeightMin
public double getWeightMin()
setC1Max
public DMOPSOBuilder setC1Max(double c1Max)
setC1Min
public DMOPSOBuilder setC1Min(double c1Min)
setC2Max
public DMOPSOBuilder setC2Max(double c2Max)
setC2Min
public DMOPSOBuilder setC2Min(double c2Min)
setChangeVelocity1
public DMOPSOBuilder setChangeVelocity1(double changeVelocity1)
setChangeVelocity2
public DMOPSOBuilder setChangeVelocity2(double changeVelocity2)
setDataDirectory
public DMOPSOBuilder setDataDirectory(String dataDirectory)
setFunctionType
public DMOPSOBuilder setFunctionType(DMOPSO.FunctionType functionType)
setMaxAge
public DMOPSOBuilder setMaxAge(int maxAge)
setMaxIterations
public DMOPSOBuilder setMaxIterations(int maxIterations)
setName
public DMOPSOBuilder setName(String name)
setR1Max
public DMOPSOBuilder setR1Max(double r1Max)
setR1Min
public DMOPSOBuilder setR1Min(double r1Min)
setR2Max
public DMOPSOBuilder setR2Max(double r2Max)
setR2Min
public DMOPSOBuilder setR2Min(double r2Min)
setRandomGenerator
public DMOPSOBuilder setRandomGenerator(PseudoRandomGenerator randomGenerator)
setSolutionListEvaluator
public DMOPSOBuilder setSolutionListEvaluator(SolutionListEvaluator<DoubleSolution> evaluator)
setSwarmSize
public DMOPSOBuilder setSwarmSize(int swarmSize)
setVariant
public DMOPSOBuilder setVariant(DMOPSOVariant variant)
setWeightMax
public DMOPSOBuilder setWeightMax(double weightMax)
setWeightMin
public DMOPSOBuilder setWeightMin(double weightMin)

DMOPSOBuilder.DMOPSOVariant

public enum DMOPSOVariant
Enum Constants
DMOPSO
public static final DMOPSOBuilder.DMOPSOVariant DMOPSO
Measures
public static final DMOPSOBuilder.DMOPSOVariant Measures

DMOPSOIT

public class DMOPSOIT

Integration tests for algorithm DMOPSO

Author:Antonio J. Nebro
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

DMOPSOMeasures

public class DMOPSOMeasures extends DMOPSO implements Measurable
Fields
durationMeasure
protected DurationMeasure durationMeasure
epsilonValue
protected BasicMeasure<Double> epsilonValue
hypervolumeValue
protected BasicMeasure<Double> hypervolumeValue
iterations
protected CountingMeasure iterations
measureManager
protected SimpleMeasureManager measureManager
referenceFront
protected Front referenceFront
solutionListMeasure
protected BasicMeasure<List<DoubleSolution>> solutionListMeasure
Constructors
DMOPSOMeasures
public DMOPSOMeasures(DoubleProblem problem, int swarmSize, int maxIterations, double r1Min, double r1Max, double r2Min, double r2Max, double c1Min, double c1Max, double c2Min, double c2Max, double weightMin, double weightMax, double changeVelocity1, double changeVelocity2, FunctionType functionType, String dataDirectory, int maxAge)
DMOPSOMeasures
public DMOPSOMeasures(DoubleProblem problem, int swarmSize, int maxIterations, double r1Min, double r1Max, double r2Min, double r2Max, double c1Min, double c1Max, double c2Min, double c2Max, double weightMin, double weightMax, double changeVelocity1, double changeVelocity2, FunctionType functionType, String dataDirectory, int maxAge, String name)
Methods
getDescription
public String getDescription()
getMeasureManager
public MeasureManager getMeasureManager()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
run
public void run()
setReferenceFront
public void setReferenceFront(Front referenceFront)
updateProgress
protected void updateProgress()

org.uma.jmetal.algorithm.multiobjective.espea

ESPEA

public class ESPEA<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>

Implementation of the Electrostatic Potential Energy Evolutionary Algorithm (ESPEA) from the paper “Obtaining Optimal Pareto Front Approximations using Scalarized Preference Information” by M. Braun et al.

The algorithm generates preference-biased Pareto front approximations that cover the entire front but focus more solutions in those regions that are interesting to the decision maker. Preferences are presented to the algorithm in the form of a scalarization function (value function) that maps the vector of objective to a real value. Smaller values are deemed to indicate higher desirability to comply with minimization.

If no scalarized preference is specified, uniform preferences are assumed and ESPEA generates a uniform approximation of the Pareto front.

Author:Marlon Braun
Fields
archive
protected final EnergyArchive<S> archive

An archive of nondominated solutions that approximates the energy minimum state based on the chosen scalarization function.

evaluations
protected int evaluations

The number of function evaluations that have been executed so far.

evaluator
protected final SolutionListEvaluator<S> evaluator

Evaluates the solutions

fullArchiveCrossoverOperator
protected CrossoverOperator<S> fullArchiveCrossoverOperator

ESPEA uses two different crossover operators depending on the current archive size. If the archive is not full, it uses the crossover operator provided by getCrossoverOperator(). If the archive is full, fullArchiveCrossoverOperator is used.

maxEvaluations
protected int maxEvaluations

Maximum number of functions evaluations that are executed.

Constructors
ESPEA
public ESPEA(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, CrossoverOperator<S> fullArchiveCrossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, ScalarizationWrapper scalarizationWrapper, SolutionListEvaluator<S> evaluator, boolean normalizeObjectives, ReplacementStrategy replacementStrategy)

Constructor for setting all parameters of ESPEA.

Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

ESPEABuilder

public class ESPEABuilder<S extends Solution<?>> implements AlgorithmBuilder<ESPEA<S>>
Constructors
ESPEABuilder
public ESPEABuilder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)
Methods
build
public ESPEA<S> build()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
Returns:the crossoverOperator
getEvaluator
public SolutionListEvaluator<S> getEvaluator()
Returns:the evaluator
getFullArchiveCrossoverOperator
public CrossoverOperator<S> getFullArchiveCrossoverOperator()
Returns:the fullArchiveCrossoverOperator
getMaxEvaluations
public int getMaxEvaluations()
Returns:the maxEvaluations
getMutationOperator
public MutationOperator<S> getMutationOperator()
Returns:the mutationOperator
getOperationType
public ReplacementStrategy getOperationType()
Returns:the replacement strategy
getPopulationSize
public int getPopulationSize()
Returns:the populationSize
getScalarization
public ScalarizationWrapper getScalarization()
Returns:the scalarization
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
Returns:the selectionOperator
isNormalizeObjectives
public boolean isNormalizeObjectives()
Returns:the normalizeObjectives
setCrossoverOperator
public void setCrossoverOperator(CrossoverOperator<S> crossoverOperator)
Parameters:
  • crossoverOperator – the crossoverOperator to set
setEvaluator
public void setEvaluator(SolutionListEvaluator<S> evaluator)
Parameters:
  • evaluator – the evaluator to set
setFullArchiveCrossoverOperator
public void setFullArchiveCrossoverOperator(CrossoverOperator<S> fullArchiveCrossoverOperator)
Parameters:
  • fullArchiveCrossoverOperator – the fullArchiveCrossoverOperator to set
setMaxEvaluations
public void setMaxEvaluations(int maxEvaluations)
Parameters:
  • maxEvaluations – the maxEvaluations to set
setMutationOperator
public void setMutationOperator(MutationOperator<S> mutationOperator)
Parameters:
  • mutationOperator – the mutationOperator to set
setNormalizeObjectives
public void setNormalizeObjectives(boolean normalizeObjectives)
Parameters:
  • normalizeObjectives – the normalizeObjectives to set
setPopulationSize
public void setPopulationSize(int populationSize)
Parameters:
  • populationSize – the populationSize to set
setReplacementStrategy
public void setReplacementStrategy(ReplacementStrategy replacementStrategy)
Parameters:
  • replacementStrategy – the replacement strategy to set
setScalarization
public void setScalarization(ScalarizationWrapper scalarization)
Parameters:
  • scalarization – the scalarization to set
setSelectionOperator
public void setSelectionOperator(SelectionOperator<List<S>, S> selectionOperator)
Parameters:
  • selectionOperator – the selectionOperator to set

org.uma.jmetal.algorithm.multiobjective.espea.util

AchievementScalarizationComparator

public class AchievementScalarizationComparator<S extends Solution<?>> implements Comparator<S>

Compares solutions based on their achievement scalarization value (ASV). The ASV is always defined for a specific objective k. A solution x dominates solution y w.r.t. to their ASV, if the maximum of all objectives without k is smaller for x compared to y. If both maxima are the same, solutions are compared w.r.t. to objective k. Achievement scalarization values can be used for identifying extreme points.

Author:

marlon.braun

Parameters:
  • <S> – The solution type.
Constructors
AchievementScalarizationComparator
public AchievementScalarizationComparator(int objective)

The achievement scalarization comparator requires an objective for which it is defined.

Parameters:
  • objective – The objective for which achievement scalarizationv alues are computed.
Methods
compare
public int compare(S s1, S s2)

EnergyArchive

public class EnergyArchive<S extends Solution<?>> extends AbstractBoundedArchive<S>

The archive that is used within the ESPEA algorithm. The archive is of variable size and bounded by the population size. A new solution can only replace an existing archive member if it leads to a reduction of the total energy of the archive.

Author:marlon.braun
Constructors
EnergyArchive
public EnergyArchive(int maxSize)

Standard constructor that uses uniform preferences - all Pareto optimal solutions are equally desirable.

Parameters:
  • maxSize – Size of the final distribution of points generated by the archive.
EnergyArchive
public EnergyArchive(int maxSize, ScalarizationWrapper scalWrapper)

Constructor that requires archive size and scalarization method

Parameters:
  • maxSize – Size of the final distribution of points generated by the archive.
  • scalWrapper – The scalarization method that is used for computing energy contributions.
EnergyArchive
public EnergyArchive(int maxSize, ScalarizationWrapper scalWrapper, boolean normalizeObjectives)

Constructor that requires archive size, scalarization method and whether objectives are normliazed.

Parameters:
  • maxSize – Size of the final distribution of points generated by the archive.
  • scalWrapper – The scalarization method that is used for computing energy contributions.
  • normalizeObjectives – Whether or not objective values are normlalized between distance computation.
EnergyArchive
public EnergyArchive(int maxSize, ScalarizationWrapper scalWrapper, boolean normalizeObjectives, ReplacementStrategy replacementStrategy)

Constructor that requires archive size, scalarization method, whether objectives are normalized and the replacement strategy.

Parameters:
  • maxSize – Size of the final distribution of points generated by the archive.
  • scalWrapper – The scalarization method that is used for computing energy contributions.
  • normalizeObjectives – Whether or not objective values are normlalized between distance computation.
  • replacementStrategy – Replacement strategy for archive update.
Methods
computeDensityEstimator
public void computeDensityEstimator()
getComparator
public Comparator<S> getComparator()
isFull
public boolean isFull()

A check for testing whether the archive is full.

Returns:true if the archive possesses the maximum number of elements. False otherwise.
prune
public void prune()
sortByDensityEstimator
public void sortByDensityEstimator()

EnergyArchive.ReplacementStrategy

public static enum ReplacementStrategy

The replacement strategy defines the rule by which an existing archive member is replaced by a new solution. Computational studies have revealed that BEST_FEASIBLE_POSITION is inferior to LARGEST_DIFFERENCE and WORST_IN_ARCHIVE. No significant performance difference could be founnd between LARGEST_DIFFERENCE and WORST_IN_ARCHIVE. See “Obtaining Optimal Pareto Front Appxoimations” by Braun et al. and “Scalarized Preferences in Multi-objective Optimizaiton” by Braun for details.

Author:marlon.braun
Enum Constants
BEST_FEASIBLE_POSITION
public static final EnergyArchive.ReplacementStrategy BEST_FEASIBLE_POSITION

Inserts the new solution such that the energy it introduces into the archive is minimized.

LARGEST_DIFFERENCE
public static final EnergyArchive.ReplacementStrategy LARGEST_DIFFERENCE

Maximizes the energy differences before and after replacement.

WORST_IN_ARCHIVE
public static final EnergyArchive.ReplacementStrategy WORST_IN_ARCHIVE

Among all eligible archive members that can be replaced the one exhibiting the largest energy contribution is replaced.

ScalarizationUtils

public class ScalarizationUtils

A class that contains methods for computing the scalarization values of solutions. A scalarization value is an aggregation of the objective values that maps to the real numbers, e.g. the weighted sum.

Scalarization values are stored as ScalarizationValue in the solutions.

Author:Marlon Braun
Methods
angleUtility
public static <S extends Solution<?>> void angleUtility(List<S> solutionsList)

Scalarization values based on angle utility (see Angle-based Preference Models in Multi-objective Optimization by Braun et al.). Extreme points are computed from the list of solutions.

Parameters:
  • solutionsList – A list of solutions.
angleUtility
public static <S extends Solution<?>> void angleUtility(List<S> solutionsList, double[][] extremePoints)

Scalarization values based on angle utility (see Angle-based Preference Models in Multi-objective Optimization by Braun et al.).

Parameters:
  • solutionsList – A list of solutions.
  • extremePoints – used for angle computation.
chebyshev
public static <S extends Solution<?>> void chebyshev(List<S> solutionsList)

Scalarization values based on the Chebyshev function. The ideal point is computed from the list of solutions.

Parameters:
  • solutionsList – A list of solutions.
chebyshev
public static <S extends Solution<?>> void chebyshev(List<S> solutionsList, double[] idealValues)

Scalarization values based on the Chebyshev function.

Parameters:
  • solutionsList – A list of solutions.
  • idealValues – The ideal point
nash
public static <S extends Solution<?>> void nash(List<S> solutionsList)

Scalarization values based on the Nash bargaining solution. The disagreement point is computed based on the list of solutions.

Parameters:
  • solutionsList – A list of solutions.
nash
public static <S extends Solution<?>> void nash(List<S> solutionsList, double[] nadirValues)

Scalarization values based on the Nash bargaining solution.

Parameters:
  • solutionsList – A list of solutions.
  • nadirValues – The disagreement point.
productOfObjectives
public static <S extends Solution<?>> void productOfObjectives(List<S> solutionsList)

Objective values are multiplied.

Parameters:
  • solutionsList – A list of solutions.
sumOfObjectives
public static <S extends Solution<?>> void sumOfObjectives(List<S> solutionsList)

Scalarization values is computed by summing objective values.

Parameters:
  • solutionsList – A list of solutions.
tradeoffUtility
public static <S extends Solution<?>> void tradeoffUtility(List<S> solutionsList)

Scalarization values based on tradeoff utility, also known as proper utility (see “Theory and Algorithm for Finding Knees” by Shukla et al.)

Parameters:
  • solutionsList – A list of solutions.
uniform
public static <S extends Solution<?>> void uniform(List<S> solutionsList)

Uniform preferences. Each solution is assigned a scalarization value of 1.0.

Parameters:
  • solutionsList – A list of solutions.
weightedChebyshev
public static <S extends Solution<?>> void weightedChebyshev(List<S> solutionsList, double[] weights)

Chebyhsev function with weighted objectives.

Parameters:
  • solutionsList – A list of solutions.
  • weights – Constants by which ideal values and objective values are multiplied.
weightedChebyshev
public static <S extends Solution<?>> void weightedChebyshev(List<S> solutionsList, double[] idealValues, double[] weights)

Scalarization values based on the weighted Chebyshev function.

Parameters:
  • solutionsList – A list of solutions.
  • idealValues – The ideal point.
  • weights – Constants by which ideal values and objective values are multiplied.
weightedProduct
public static <S extends Solution<?>> void weightedProduct(List<S> solutionsList, double[] weights)

Objectives are exponentiated by a positive weight and afterwards multiplied.

Parameters:
  • solutionsList – A list of solutions.
  • weights – Weights by objectives are exponentiated
weightedSum
public static <S extends Solution<?>> void weightedSum(List<S> solutionsList, double[] weights)

Objective values are multiplied by weights and summed. Weights should always be positive.

Parameters:
  • solutionsList – A list of solutions.
  • weights – Positive constants by which objectives are summed.

ScalarizationValue

public class ScalarizationValue<S extends Solution<?>> extends GenericSolutionAttribute<S, Double>

Scalarization attribute. A scalarization value is an aggregation of the objective values.

Author:

Marlon Braun

Parameters:
  • <S> – The solution type

ScalarizationWrapper

public class ScalarizationWrapper

A class for simplifying the access to ScalarizationUtils.

Author:Marlon Braun
Constructors
ScalarizationWrapper
public ScalarizationWrapper(ScalarizationType scalarizationType)

Initialize from scalarization type

Parameters:
  • scalarizationType – Chosen scalarization function
ScalarizationWrapper
public ScalarizationWrapper(Config config)

Initialize from Config.

Parameters:
  • config – Configuration of the scalarization Wrapper.
Methods
execute
public <S extends Solution<?>> void execute(List<S> solutionsList)

Computes scalarization values and assigns them as ScalarizationValue attribute to the solutions.

Parameters:
  • solutionsList – Solutions for which scalarization values computed.

ScalarizationWrapper.Config

public static class Config

Configuration of the scalarization wrapper.

Author:Marlon Braun

ScalarizationWrapper.ScalarizationType

public static enum ScalarizationType

The scalarization function that is used for computing values.

Author:Marlon Braun
Enum Constants
ANGLE_UTILITY
public static final ScalarizationWrapper.ScalarizationType ANGLE_UTILITY

Scalarization values are based on maximum angles to extreme points (see “Angle based Preferences Models in Multi-objective Optimization” by Braun et al.)

CHEBYSHEV
public static final ScalarizationWrapper.ScalarizationType CHEBYSHEV

Chebyhsev scalarization function.

NASH
public static final ScalarizationWrapper.ScalarizationType NASH

The Nash bargaining solution

PRODUCT_OF_OBJECTIVES
public static final ScalarizationWrapper.ScalarizationType PRODUCT_OF_OBJECTIVES

Multiplication of all objectives.

SUM_OF_OBJECTIVES
public static final ScalarizationWrapper.ScalarizationType SUM_OF_OBJECTIVES

Summing up all objectives.

TRADEOFF_UTILITY
public static final ScalarizationWrapper.ScalarizationType TRADEOFF_UTILITY

Tradeoff utility also known as proper utility (see “Theory and Algorithms for Finding Knees” by Shukla et al.).

UNIFORM
public static final ScalarizationWrapper.ScalarizationType UNIFORM

All solutions are assigned a scalarization value of 1.

WEIGHTED_CHEBYSHEV
public static final ScalarizationWrapper.ScalarizationType WEIGHTED_CHEBYSHEV

Chebyhsev function with weights.

WEIGHTED_PRODUCT
public static final ScalarizationWrapper.ScalarizationType WEIGHTED_PRODUCT

Objectives are exponentiated by weights before being multiplied.

WEIGHTED_SUM
public static final ScalarizationWrapper.ScalarizationType WEIGHTED_SUM

Weighted sum.

org.uma.jmetal.algorithm.multiobjective.gde3

GDE3

public class GDE3 extends AbstractDifferentialEvolution<List<DoubleSolution>>

This class implements the GDE3 algorithm

Fields
crowdingDistance
protected DensityEstimator<DoubleSolution> crowdingDistance
dominanceComparator
protected Comparator<DoubleSolution> dominanceComparator
evaluations
protected int evaluations
evaluator
protected SolutionListEvaluator<DoubleSolution> evaluator
maxEvaluations
protected int maxEvaluations
ranking
protected Ranking<DoubleSolution> ranking
Constructors
GDE3
public GDE3(DoubleProblem problem, int populationSize, int maxEvaluations, DifferentialEvolutionSelection selection, DifferentialEvolutionCrossover crossover, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Methods
addLastRankedSolutionsToPopulation
protected void addLastRankedSolutionsToPopulation(Ranking<DoubleSolution> ranking, int rank, List<DoubleSolution> population)
addRankedSolutionsToPopulation
protected void addRankedSolutionsToPopulation(Ranking<DoubleSolution> ranking, int rank, List<DoubleSolution> population)
computeRanking
protected Ranking<DoubleSolution> computeRanking(List<DoubleSolution> solutionList)
createInitialPopulation
protected List<DoubleSolution> createInitialPopulation()
crowdingDistanceSelection
protected List<DoubleSolution> crowdingDistanceSelection(Ranking<DoubleSolution> ranking)
evaluatePopulation
protected List<DoubleSolution> evaluatePopulation(List<DoubleSolution> population)

Evaluate population method

Parameters:
  • population – The list of solutions to be evaluated
Returns:

A list of evaluated solutions

getDescription
public String getDescription()
getMaxPopulationSize
public int getMaxPopulationSize()
getName
public String getName()
getNonDominatedSolutions
protected List<DoubleSolution> getNonDominatedSolutions(List<DoubleSolution> solutionList)
getResult
public List<DoubleSolution> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
populationIsNotFull
protected boolean populationIsNotFull(List<DoubleSolution> population)
replacement
protected List<DoubleSolution> replacement(List<DoubleSolution> population, List<DoubleSolution> offspringPopulation)
reproduction
protected List<DoubleSolution> reproduction(List<DoubleSolution> matingPopulation)
selection
protected List<DoubleSolution> selection(List<DoubleSolution> population)
setMaxPopulationSize
public void setMaxPopulationSize(int maxPopulationSize)
subfrontFillsIntoThePopulation
protected boolean subfrontFillsIntoThePopulation(Ranking<DoubleSolution> ranking, int rank, List<DoubleSolution> population)
updateProgress
protected void updateProgress()

GDE3Builder

public class GDE3Builder implements AlgorithmBuilder<GDE3>

This class implements the GDE3 algorithm

Fields
crossoverOperator
protected DifferentialEvolutionCrossover crossoverOperator
evaluator
protected SolutionListEvaluator<DoubleSolution> evaluator
maxEvaluations
protected int maxEvaluations
populationSize
protected int populationSize
selectionOperator
protected DifferentialEvolutionSelection selectionOperator
Constructors
GDE3Builder
public GDE3Builder(DoubleProblem problem)

Constructor

Methods
build
public GDE3 build()
getCrossoverOperator
public CrossoverOperator<DoubleSolution> getCrossoverOperator()
getMaxEvaluations
public int getMaxEvaluations()
getPopulationSize
public int getPopulationSize()
getSelectionOperator
public SelectionOperator<List<DoubleSolution>, List<DoubleSolution>> getSelectionOperator()
setCrossover
public GDE3Builder setCrossover(DifferentialEvolutionCrossover crossover)
setMaxEvaluations
public GDE3Builder setMaxEvaluations(int maxEvaluations)
setPopulationSize
public GDE3Builder setPopulationSize(int populationSize)
setSelection
public GDE3Builder setSelection(DifferentialEvolutionSelection selection)
setSolutionSetEvaluator
public GDE3Builder setSolutionSetEvaluator(SolutionListEvaluator<DoubleSolution> evaluator)

GDE3TestIT

public class GDE3TestIT

Created by ajnebro on 3/11/15.

Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

org.uma.jmetal.algorithm.multiobjective.gwasfga

GWASFGA

public class GWASFGA<S extends Solution<?>> extends WASFGA<S>

This class executes the GWASFGA algorithm described in: Saborido, R., Ruiz, A. B. and Luque, M. (2015). Global WASF-GA: An Evolutionary Algorithm in Multiobjective Optimization to Approximate the whole Pareto Optimal Front. Evolutionary Computation Accepted for publication.

Author:Juanjo Durillo
Constructors
GWASFGA
public GWASFGA(Problem<S> problem, int populationSize, int maxIterations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator, double epsilon, String weightVectorsFileName)
GWASFGA
public GWASFGA(Problem<S> problem, int populationSize, int maxIterations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator, double epsilon)
Methods
computeRanking
protected Ranking<S> computeRanking(List<S> solutionList)
getDescription
public String getDescription()
getName
public String getName()

org.uma.jmetal.algorithm.multiobjective.gwasfga.util

GWASFGARanking

public class GWASFGARanking<S extends Solution<?>> extends GenericSolutionAttribute<S, Integer> implements Ranking<S>
Author:Rubén Saborido Implementation of the ranking procedure for the algorithm GWASF-GA on jMetal5.0 It classifies solutions into different fronts. If the problem contains constraints, after feasible solutions it classifies the unfeasible solutions into fronts: - Each unfeasible solution goes into a different front. - Unfeasible solutions with lower number of violated constraints are preferred. - If two solutions have equal number of violated constraints it compares the overall constraint values. - If two solutions have equal overall constraint values it compares de values of the utility function.
Constructors
GWASFGARanking
public GWASFGARanking(AbstractUtilityFunctionsSet<S> utilityFunctionsUtopia, AbstractUtilityFunctionsSet<S> utilityFunctionsNadir)
Methods
computeRanking
public Ranking<S> computeRanking(List<S> population)
getNumberOfSubfronts
public int getNumberOfSubfronts()
getSubfront
public List<S> getSubfront(int rank)
rankUnfeasibleSolutions
protected int[] rankUnfeasibleSolutions(List<S> population)

Obtain the rank of each solution in a list of unfeasible solutions

Parameters:
  • population – List of unfeasible solutions
Returns:

The rank of each unfeasible solutions

org.uma.jmetal.algorithm.multiobjective.ibea

IBEA

public class IBEA<S extends Solution<?>> implements Algorithm<List<S>>

This class implements the IBEA algorithm

Fields
TOURNAMENTS_ROUNDS
public static final int TOURNAMENTS_ROUNDS
archive
protected List<S> archive
archiveSize
protected int archiveSize
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
indicatorValues
protected List<List<Double>> indicatorValues
maxEvaluations
protected int maxEvaluations
maxIndicatorValue
protected double maxIndicatorValue
mutationOperator
protected MutationOperator<S> mutationOperator
populationSize
protected int populationSize
problem
protected Problem<S> problem
selectionOperator
protected SelectionOperator<List<S>, S> selectionOperator
solutionFitness
protected Fitness<S> solutionFitness
Constructors
IBEA
public IBEA(Problem<S> problem, int populationSize, int archiveSize, int maxEvaluations, SelectionOperator<List<S>, S> selectionOperator, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)

Constructor

Methods
calculateFitness
public void calculateFitness(List<S> solutionSet)

Calculate the fitness for the entire population.

calculateHypervolumeIndicator
double calculateHypervolumeIndicator(Solution<?> solutionA, Solution<?> solutionB, int d, double[] maximumValues, double[] minimumValues)

Calculates the hypervolume of that portion of the objective space that is dominated by individual a but not by individual b

computeIndicatorValuesHD
public void computeIndicatorValuesHD(List<S> solutionSet, double[] maximumValues, double[] minimumValues)

This structure stores the indicator values of each pair of elements

fitness
public void fitness(List<S> solutionSet, int pos)

Calculate the fitness for the individual at position pos

getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
removeWorst
public void removeWorst(List<S> solutionSet)

Update the fitness before removing an individual

run
public void run()

Execute() method

IBEABuilder

public class IBEABuilder implements AlgorithmBuilder<IBEA<DoubleSolution>>

This class implements the IBEA algorithm

Constructors
IBEABuilder
public IBEABuilder(Problem<DoubleSolution> problem)

Constructor

Parameters:
  • problem
Methods
build
public IBEA<DoubleSolution> build()
getArchiveSize
public int getArchiveSize()
getCrossover
public CrossoverOperator<DoubleSolution> getCrossover()
getMaxEvaluations
public int getMaxEvaluations()
getMutation
public MutationOperator<DoubleSolution> getMutation()
getPopulationSize
public int getPopulationSize()
getSelection
public SelectionOperator<List<DoubleSolution>, DoubleSolution> getSelection()
setArchiveSize
public IBEABuilder setArchiveSize(int archiveSize)
setCrossover
public IBEABuilder setCrossover(CrossoverOperator<DoubleSolution> crossover)
setMaxEvaluations
public IBEABuilder setMaxEvaluations(int maxEvaluations)
setMutation
public IBEABuilder setMutation(MutationOperator<DoubleSolution> mutation)
setPopulationSize
public IBEABuilder setPopulationSize(int populationSize)
setSelection
public IBEABuilder setSelection(SelectionOperator<List<DoubleSolution>, DoubleSolution> selection)

org.uma.jmetal.algorithm.multiobjective.mocell

MOCell

public class MOCell<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>
Author:

JuanJo Durillo

Parameters:
  • <S>
Fields
archive
protected BoundedArchive<S> archive
currentIndividual
protected int currentIndividual
currentNeighbors
protected List<S> currentNeighbors
dominanceComparator
protected Comparator<S> dominanceComparator
evaluations
protected int evaluations
evaluator
protected final SolutionListEvaluator<S> evaluator
location
protected LocationAttribute<S> location
maxEvaluations
protected int maxEvaluations
neighborhood
protected Neighborhood<S> neighborhood
Constructors
MOCell
public MOCell(Problem<S> problem, int maxEvaluations, int populationSize, BoundedArchive<S> archive, Neighborhood<S> neighborhood, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator)

Constructor

Parameters:
  • problem
  • maxEvaluations
  • populationSize
  • neighborhood
  • crossoverOperator
  • mutationOperator
  • selectionOperator
  • evaluator
Methods
createInitialPopulation
protected List<S> createInitialPopulation()
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

MOCellBuilder

public class MOCellBuilder<S extends Solution<?>> implements AlgorithmBuilder<MOCell<S>>

Created by juanjo

Fields
archive
protected BoundedArchive<S> archive
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
evaluator
protected SolutionListEvaluator<S> evaluator
maxEvaluations
protected int maxEvaluations
mutationOperator
protected MutationOperator<S> mutationOperator
neighborhood
protected Neighborhood<S> neighborhood
populationSize
protected int populationSize
problem
protected final Problem<S> problem

MOCellBuilder class

selectionOperator
protected SelectionOperator<List<S>, S> selectionOperator
Constructors
MOCellBuilder
public MOCellBuilder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)

MOCellBuilder constructor

Methods
build
public MOCell<S> build()
getArchive
public BoundedArchive<S> getArchive()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
getSolutionListEvaluator
public SolutionListEvaluator<S> getSolutionListEvaluator()
setArchive
public MOCellBuilder<S> setArchive(BoundedArchive<S> archive)
setMaxEvaluations
public MOCellBuilder<S> setMaxEvaluations(int maxEvaluations)
setNeighborhood
public MOCellBuilder<S> setNeighborhood(Neighborhood<S> neighborhood)
setPopulationSize
public MOCellBuilder<S> setPopulationSize(int populationSize)
setSelectionOperator
public MOCellBuilder<S> setSelectionOperator(SelectionOperator<List<S>, S> selectionOperator)
setSolutionListEvaluator
public MOCellBuilder<S> setSolutionListEvaluator(SolutionListEvaluator<S> evaluator)

MOCellBuilder.MOCellVariant

public enum MOCellVariant
Enum Constants
MOCell
public static final MOCellBuilder.MOCellVariant MOCell
Measures
public static final MOCellBuilder.MOCellVariant Measures
SteadyStateMOCell
public static final MOCellBuilder.MOCellVariant SteadyStateMOCell

MOCellIT

public class MOCellIT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
crossover
CrossoverOperator<DoubleSolution> crossover
problem
DoubleProblem problem
Methods
setup
public void setup()
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

org.uma.jmetal.algorithm.multiobjective.mochc

MOCHC

public class MOCHC extends AbstractEvolutionaryAlgorithm<BinarySolution, List<BinarySolution>>

This class executes the MOCHC algorithm described in: A.J. Nebro, E. Alba, G. Molina, F. Chicano, F. Luna, J.J. Durillo “Optimal antenna placement using a new multi-objective chc algorithm”. GECCO ‘07: Proceedings of the 9th annual conference on Genetic and evolutionary computation. London, England. July 2007.

Constructors
MOCHC
public MOCHC(BinaryProblem problem, int populationSize, int maxEvaluations, int convergenceValue, double preservedPopulation, double initialConvergenceCount, CrossoverOperator<BinarySolution> crossoverOperator, MutationOperator<BinarySolution> cataclysmicMutation, SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection, SelectionOperator<List<BinarySolution>, BinarySolution> parentSelection, SolutionListEvaluator<BinarySolution> evaluator)

Constructor

Methods
createInitialPopulation
protected List<BinarySolution> createInitialPopulation()
evaluatePopulation
protected List<BinarySolution> evaluatePopulation(List<BinarySolution> population)
getDescription
public String getDescription()
getMaxPopulationSize
public int getMaxPopulationSize()
getName
public String getName()
getResult
public List<BinarySolution> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<BinarySolution> replacement(List<BinarySolution> population, List<BinarySolution> offspringPopulation)
reproduction
protected List<BinarySolution> reproduction(List<BinarySolution> matingPopulation)
selection
protected List<BinarySolution> selection(List<BinarySolution> population)
setMaxPopulationSize
public void setMaxPopulationSize(int maxPopulationSize)
updateProgress
protected void updateProgress()

MOCHC45

public class MOCHC45 implements Algorithm<List<BinarySolution>>

This class executes the MOCHC algorithm described in: A.J. Nebro, E. Alba, G. Molina, F. Chicano, F. Luna, J.J. Durillo “Optimal antenna placement using a new multi-objective chc algorithm”. GECCO ‘07: Proceedings of the 9th annual conference on Genetic and evolutionary computation. London, England. July 2007. Implementation of MOCHC following the scheme used in jMetal4.5 and former versions, i.e, without implementing the AbstractGeneticAlgorithm interface.

Constructors
MOCHC45
public MOCHC45(BinaryProblem problem, int populationSize, int maxEvaluations, int convergenceValue, double preservedPopulation, double initialConvergenceCount, CrossoverOperator<BinarySolution> crossoverOperator, MutationOperator<BinarySolution> cataclysmicMutation, SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection, SelectionOperator<List<BinarySolution>, BinarySolution> parentSelection, SolutionListEvaluator<BinarySolution> evaluator)

Constructor

Methods
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<BinarySolution> getResult()
run
public void run()

MOCHCBuilder

public class MOCHCBuilder implements AlgorithmBuilder<MOCHC>

Builder class

Fields
cataclysmicMutation
MutationOperator<BinarySolution> cataclysmicMutation
convergenceValue
int convergenceValue
crossoverOperator
CrossoverOperator<BinarySolution> crossoverOperator
initialConvergenceCount
double initialConvergenceCount
maxEvaluations
int maxEvaluations
newGenerationSelection
SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection
parentSelection
SelectionOperator<List<BinarySolution>, BinarySolution> parentSelection
populationSize
int populationSize
preservedPopulation
double preservedPopulation
problem
BinaryProblem problem
Constructors
MOCHCBuilder
public MOCHCBuilder(BinaryProblem problem)
Methods
build
public MOCHC build()
getCataclysmicMutation
public MutationOperator<BinarySolution> getCataclysmicMutation()
getConvergenceValue
public int getConvergenceValue()
getCrossover
public CrossoverOperator<BinarySolution> getCrossover()
getInitialConvergenceCount
public double getInitialConvergenceCount()
getMaxEvaluation
public int getMaxEvaluation()
getNewGenerationSelection
public SelectionOperator<List<BinarySolution>, List<BinarySolution>> getNewGenerationSelection()
getParentSelection
public SelectionOperator<List<BinarySolution>, BinarySolution> getParentSelection()
getPopulationSize
public int getPopulationSize()
getPreservedPopulation
public double getPreservedPopulation()
getProblem
public BinaryProblem getProblem()
setCataclysmicMutation
public MOCHCBuilder setCataclysmicMutation(MutationOperator<BinarySolution> cataclysmicMutation)
setConvergenceValue
public MOCHCBuilder setConvergenceValue(int convergenceValue)
setCrossover
public MOCHCBuilder setCrossover(CrossoverOperator<BinarySolution> crossover)
setEvaluator
public MOCHCBuilder setEvaluator(SolutionListEvaluator<BinarySolution> evaluator)
setInitialConvergenceCount
public MOCHCBuilder setInitialConvergenceCount(double initialConvergenceCount)
setMaxEvaluations
public MOCHCBuilder setMaxEvaluations(int maxEvaluations)
setNewGenerationSelection
public MOCHCBuilder setNewGenerationSelection(SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection)
setParentSelection
public MOCHCBuilder setParentSelection(SelectionOperator<List<BinarySolution>, BinarySolution> parentSelection)
setPopulationSize
public MOCHCBuilder setPopulationSize(int populationSize)
setPreservedPopulation
public MOCHCBuilder setPreservedPopulation(double preservedPopulation)

org.uma.jmetal.algorithm.multiobjective.moead

AbstractMOEAD

public abstract class AbstractMOEAD<S extends Solution<?>> implements Algorithm<List<S>>

Abstract class for implementing versions of the MOEA/D algorithm.

Author:Antonio J. Nebro
Fields
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
dataDirectory
protected String dataDirectory
evaluations
protected int evaluations
functionType
protected FunctionType functionType
idealPoint
protected IdealPoint idealPoint

Z vector in Zhang & Li paper

indArray
protected Solution<?>[] indArray
jointPopulation
protected List<S> jointPopulation
lambda
protected double[][] lambda

Lambda vectors

maxEvaluations
protected int maxEvaluations
maximumNumberOfReplacedSolutions
protected int maximumNumberOfReplacedSolutions

nr in Zhang & Li paper

mutationOperator
protected MutationOperator<S> mutationOperator
nadirPoint
protected NadirPoint nadirPoint
neighborSize
protected int neighborSize

T in Zhang & Li paper

neighborhood
protected int[][] neighborhood
neighborhoodSelectionProbability
protected double neighborhoodSelectionProbability

Delta in Zhang & Li paper

offspringPopulation
protected List<S> offspringPopulation
population
protected List<S> population
populationSize
protected int populationSize
problem
protected Problem<S> problem
randomGenerator
protected JMetalRandom randomGenerator
resultPopulationSize
protected int resultPopulationSize
Constructors
AbstractMOEAD
public AbstractMOEAD(Problem<S> problem, int populationSize, int resultPopulationSize, int maxEvaluations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutation, FunctionType functionType, String dataDirectory, double neighborhoodSelectionProbability, int maximumNumberOfReplacedSolutions, int neighborSize)
Methods
chooseNeighborType
protected NeighborType chooseNeighborType()
fitnessFunction
double fitnessFunction(S individual, double[] lambda)
getResult
public List<S> getResult()
initializeNeighborhood
protected void initializeNeighborhood()

Initialize neighborhoods

initializeUniformWeight
protected void initializeUniformWeight()

Initialize weight vectors

matingSelection
protected List<Integer> matingSelection(int subproblemId, int numberOfSolutionsToSelect, NeighborType neighbourType)
Parameters:
  • subproblemId – the id of current subproblem
  • neighbourType – neighbour type
parentSelection
protected List<S> parentSelection(int subProblemId, NeighborType neighborType)
updateNeighborhood
protected void updateNeighborhood(S individual, int subProblemId, NeighborType neighborType)

Update neighborhood method

Parameters:
  • individual
  • subProblemId
  • neighborType
Throws:

AbstractMOEAD.FunctionType

public enum FunctionType
Enum Constants
AGG
public static final AbstractMOEAD.FunctionType AGG
PBI
public static final AbstractMOEAD.FunctionType PBI
TCHE
public static final AbstractMOEAD.FunctionType TCHE

AbstractMOEAD.NeighborType

protected enum NeighborType
Enum Constants
NEIGHBOR
public static final AbstractMOEAD.NeighborType NEIGHBOR
POPULATION
public static final AbstractMOEAD.NeighborType POPULATION

ConstraintMOEAD

public class ConstraintMOEAD extends AbstractMOEAD<DoubleSolution>

This class implements a constrained version of the MOEAD algorithm based on the one presented in the paper: “An adaptive constraint handling approach embedded MOEA/D”. DOI: 10.1109/CEC.2012.6252868

Author:Antonio J. Nebro, Juan J. Durillo
Constructors
ConstraintMOEAD
public ConstraintMOEAD(Problem<DoubleSolution> problem, int populationSize, int resultPopulationSize, int maxEvaluations, MutationOperator<DoubleSolution> mutation, CrossoverOperator<DoubleSolution> crossover, FunctionType functionType, String dataDirectory, double neighborhoodSelectionProbability, int maximumNumberOfReplacedSolutions, int neighborSize)
Methods
getDescription
public String getDescription()
getName
public String getName()
initializePopulation
public void initializePopulation()
run
public void run()
updateNeighborhood
protected void updateNeighborhood(DoubleSolution individual, int subproblemId, NeighborType neighborType)

MOEAD

public class MOEAD extends AbstractMOEAD<DoubleSolution>

Class implementing the MOEA/D-DE algorithm described in : Hui Li; Qingfu Zhang, “Multiobjective Optimization Problems With Complicated Pareto Sets, MOEA/D and NSGA-II,” Evolutionary Computation, IEEE Transactions on , vol.13, no.2, pp.284,302, April 2009. doi: 10.1109/TEVC.2008.925798

Author:Antonio J. Nebro
Fields
differentialEvolutionCrossover
protected DifferentialEvolutionCrossover differentialEvolutionCrossover
Constructors
MOEAD
public MOEAD(Problem<DoubleSolution> problem, int populationSize, int resultPopulationSize, int maxEvaluations, MutationOperator<DoubleSolution> mutation, CrossoverOperator<DoubleSolution> crossover, FunctionType functionType, String dataDirectory, double neighborhoodSelectionProbability, int maximumNumberOfReplacedSolutions, int neighborSize)
Methods
getDescription
public String getDescription()
getName
public String getName()
initializePopulation
protected void initializePopulation()
run
public void run()

MOEADBuilder

public class MOEADBuilder implements AlgorithmBuilder<AbstractMOEAD<DoubleSolution>>

Builder class for algorithm MOEA/D and variants

Author:Antonio J. Nebro
Fields
crossover
protected CrossoverOperator<DoubleSolution> crossover
dataDirectory
protected String dataDirectory
functionType
protected MOEAD.FunctionType functionType
maxEvaluations
protected int maxEvaluations
maximumNumberOfReplacedSolutions
protected int maximumNumberOfReplacedSolutions

nr in Zhang & Li paper

moeadVariant
protected Variant moeadVariant
mutation
protected MutationOperator<DoubleSolution> mutation
neighborSize
protected int neighborSize

T in Zhang & Li paper

neighborhoodSelectionProbability
protected double neighborhoodSelectionProbability

Delta in Zhang & Li paper

numberOfThreads
protected int numberOfThreads
populationSize
protected int populationSize
problem
protected Problem<DoubleSolution> problem
resultPopulationSize
protected int resultPopulationSize
Constructors
MOEADBuilder
public MOEADBuilder(Problem<DoubleSolution> problem, Variant variant)

Constructor

Methods
build
public AbstractMOEAD<DoubleSolution> build()
getCrossover
public CrossoverOperator<DoubleSolution> getCrossover()
getDataDirectory
public String getDataDirectory()
getFunctionType
public MOEAD.FunctionType getFunctionType()
getMaxEvaluations
public int getMaxEvaluations()
getMaximumNumberOfReplacedSolutions
public int getMaximumNumberOfReplacedSolutions()
getMutation
public MutationOperator<DoubleSolution> getMutation()
getNeighborSize
public int getNeighborSize()
getNeighborhoodSelectionProbability
public double getNeighborhoodSelectionProbability()
getNumberOfThreads
public int getNumberOfThreads()
getPopulationSize
public int getPopulationSize()
getResultPopulationSize
public int getResultPopulationSize()
setCrossover
public MOEADBuilder setCrossover(CrossoverOperator<DoubleSolution> crossover)
setDataDirectory
public MOEADBuilder setDataDirectory(String dataDirectory)
setFunctionType
public MOEADBuilder setFunctionType(MOEAD.FunctionType functionType)
setMaxEvaluations
public MOEADBuilder setMaxEvaluations(int maxEvaluations)
setMaximumNumberOfReplacedSolutions
public MOEADBuilder setMaximumNumberOfReplacedSolutions(int maximumNumberOfReplacedSolutions)
setMutation
public MOEADBuilder setMutation(MutationOperator<DoubleSolution> mutation)
setNeighborSize
public MOEADBuilder setNeighborSize(int neighborSize)
setNeighborhoodSelectionProbability
public MOEADBuilder setNeighborhoodSelectionProbability(double neighborhoodSelectionProbability)
setNumberOfThreads
public MOEADBuilder setNumberOfThreads(int numberOfThreads)
setPopulationSize
public MOEADBuilder setPopulationSize(int populationSize)
setResultPopulationSize
public MOEADBuilder setResultPopulationSize(int resultPopulationSize)

MOEADBuilder.Variant

public enum Variant
Enum Constants
ConstraintMOEAD
public static final MOEADBuilder.Variant ConstraintMOEAD
MOEAD
public static final MOEADBuilder.Variant MOEAD
MOEADD
public static final MOEADBuilder.Variant MOEADD
MOEADDRA
public static final MOEADBuilder.Variant MOEADDRA
MOEADSTM
public static final MOEADBuilder.Variant MOEADSTM

MOEADD

public class MOEADD<S extends DoubleSolution> extends AbstractMOEAD<S>
Fields
numRanks
protected int numRanks
rankIdx
protected int[][] rankIdx
ranking
protected Ranking ranking
subregionDist
protected double[][] subregionDist
subregionIdx
protected int[][] subregionIdx
Constructors
MOEADD
public MOEADD(Problem<S> problem, int populationSize, int resultPopulationSize, int maxEvaluations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutation, AbstractMOEAD.FunctionType functionType, String dataDirectory, double neighborhoodSelectionProbability, int maximumNumberOfReplacedSolutions, int neighborSize)
Methods
calculateDistance
public double calculateDistance(S individual, double[] lambda, double[] z_, double[] nz_)

Calculate the perpendicular distance between the solution and reference line

calculateDistance2
public double calculateDistance2(S indiv, double[] lambda, double[] z_, double[] nz_)
checkDominance
public int checkDominance(S a, S b)

check the dominance relationship between a and b: 1 -> a dominates b, -1 -> b dominates a 0 -> non-dominated with each other

computeRanking
protected Ranking<S> computeRanking(List<S> solutionList)
countOnes
public int countOnes(int location)

Count the number of 1s in the ‘location’th subregion

countRankOnes
public int countRankOnes(int location)

count the number of 1s in a row of rank matrix

countTest
public int countTest()
deleteCrowdIndiv_diff
public void deleteCrowdIndiv_diff(int crowdIdx, int curLocation, int nicheCount, S indiv)

delete one solution from the most crowded subregion, which is different from indiv’s subregion. just use indiv to replace the worst solution in that subregion

deleteCrowdIndiv_same
public void deleteCrowdIndiv_same(int crowdIdx, int nicheCount, double indivFitness, S indiv)

delete one solution from the most crowded subregion, which is indiv’s subregion. Compare indiv’s fitness value and the worst one in this subregion

deleteCrowdRegion1
public void deleteCrowdRegion1(S indiv, int location)

Delete a solution from the most crowded subregion (this function only happens when: it should delete ‘indiv’ based on traditional method. However, the subregion of ‘indiv’ only has one solution, so it should be kept)

deleteCrowdRegion2
public void deleteCrowdRegion2(S indiv, int location)

delete a solution from the most crowded subregion (this function happens when: it should delete the solution in the ‘parentLocation’ subregion, but since this subregion only has one solution, it should be kept)

deleteRankOne
public void deleteRankOne(S indiv, int location)

if there is only one non-domination level (i.e., all solutions are non-dominated with each other), we should delete a solution from the most crowded subregion

findPosition
public int findPosition(S indiv)

find the index of the solution ‘indiv’ in the population

findRegion
public int findRegion(int idx)

find the subregion of the ‘idx’th solution in the population

getDescription
public String getDescription()
getName
public String getName()
initPopulation
public void initPopulation()

Initialize the population

innerproduct
public double innerproduct(double[] vec1, double[] vec2)

Calculate the dot product of two vectors

matingSelection
public List<S> matingSelection(int cid, int type)

Select two parents for reproduction

nondominated_sorting_add
public int nondominated_sorting_add(S indiv)

update the non-domination level when adding a solution

nondominated_sorting_delete
public void nondominated_sorting_delete(S indiv)

update the non-domination level structure after deleting a solution

norm_vector
public double norm_vector(double[] z)

Calculate the norm of the vector

replace
public void replace(int position, S solution)
run
public void run()
setLocation
public void setLocation(S indiv, double[] z_, double[] nz_)

Set the location of a solution based on the orthogonal distance

sumFitness
public double sumFitness(int location)

calculate the sum of fitnesses of solutions in the location subregion

updateArchive
public void updateArchive(S indiv)

update the parent population by using the ENLU method, instead of fast non-dominated sorting

MOEADDRA

public class MOEADDRA extends AbstractMOEAD<DoubleSolution>

Class implementing the MOEA/D-DRA algorithm described in : Q. Zhang, W. Liu, and H Li, The Performance of a New Version of MOEA/D on CEC09 Unconstrained MOP Test Instances, Working Report CES-491, School of CS & EE, University of Essex, 02/2009

Author:Juan J. Durillo, Antonio J. Nebro
Fields
differentialEvolutionCrossover
protected DifferentialEvolutionCrossover differentialEvolutionCrossover
frequency
protected int[] frequency
randomGenerator
JMetalRandom randomGenerator
savedValues
protected DoubleSolution[] savedValues
utility
protected double[] utility
Constructors
MOEADDRA
public MOEADDRA(Problem<DoubleSolution> problem, int populationSize, int resultPopulationSize, int maxEvaluations, MutationOperator<DoubleSolution> mutation, CrossoverOperator<DoubleSolution> crossover, FunctionType functionType, String dataDirectory, double neighborhoodSelectionProbability, int maximumNumberOfReplacedSolutions, int neighborSize)
Methods
getDescription
public String getDescription()
getName
public String getName()
initializePopulation
protected void initializePopulation()
run
public void run()
tourSelection
public List<Integer> tourSelection(int depth)
utilityFunction
public void utilityFunction()

MOEADDRAIT

public class MOEADDRAIT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

MOEADIT

public class MOEADIT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

MOEADSTM

public class MOEADSTM extends AbstractMOEAD<DoubleSolution>

Class implementing the MOEA/D-STM algorithm described in : K. Li, Q. Zhang, S. Kwong, M. Li and R. Wang, “Stable Matching-Based Selection in Evolutionary Multiobjective Optimization”, IEEE Transactions on Evolutionary Computation, 18(6): 909-923, 2014. DOI: 10.1109/TEVC.2013.2293776

Author:Ke Li
Fields
differentialEvolutionCrossover
protected DifferentialEvolutionCrossover differentialEvolutionCrossover
frequency
protected int[] frequency
randomGenerator
JMetalRandom randomGenerator
savedValues
protected DoubleSolution[] savedValues
utility
protected double[] utility
Constructors
MOEADSTM
public MOEADSTM(Problem<DoubleSolution> problem, int populationSize, int resultPopulationSize, int maxEvaluations, MutationOperator<DoubleSolution> mutation, CrossoverOperator<DoubleSolution> crossover, FunctionType functionType, String dataDirectory, double neighborhoodSelectionProbability, int maximumNumberOfReplacedSolutions, int neighborSize)
Methods
calculateDistance
public double calculateDistance(DoubleSolution individual, double[] lambda)

Calculate the perpendicular distance between the solution and reference line

calculateDistance2
public double calculateDistance2(DoubleSolution individual, double[] lambda)

Calculate the perpendicular distance between the solution and reference line

getDescription
public String getDescription()
getName
public String getName()
getResult
public List<DoubleSolution> getResult()
initializePopulation
protected void initializePopulation()
innerproduct
public double innerproduct(double[] vec1, double[] vec2)

Calculate the dot product of two vectors

norm_vector
public double norm_vector(double[] z)

Calculate the norm of the vector

prefers
public boolean prefers(int x, int y, int[] womanPref, int size)

Returns true in case that a given woman prefers x to y.

run
public void run()
stableMatching
public int[] stableMatching(int[][] manPref, int[][] womanPref, int menSize, int womenSize)

Return the stable matching between ‘subproblems’ and ‘solutions’ (‘subproblems’ propose first). It is worth noting that the number of solutions is larger than that of the subproblems.

stmSelection
public void stmSelection()

Select the next parent population, based on the stable matching criteria

tourSelection
public List<Integer> tourSelection(int depth)
utilityFunction
public void utilityFunction()

org.uma.jmetal.algorithm.multiobjective.moead.util

MOEADUtils

public class MOEADUtils

Utilities methods to used by MOEA/D

Methods
distVector
public static double distVector(double[] vector1, double[] vector2)
getSubsetOfEvenlyDistributedSolutions
public static <S extends Solution<?>> List<S> getSubsetOfEvenlyDistributedSolutions(List<S> solutionList, int newSolutionListSize)

This methods select a subset of evenly spread solutions from a solution list. The implementation is based on the method described in the MOEA/D-DRA paper.

Parameters:
  • solutionList
  • newSolutionListSize
  • <S>
minFastSort
public static void minFastSort(double[] x, int[] idx, int n, int m)
quickSort
public static void quickSort(double[] array, int[] idx, int from, int to)

Quick sort procedure (ascending order)

Parameters:
  • array
  • idx
  • from
  • to
randomPermutation
public static void randomPermutation(int[] perm, int size)

org.uma.jmetal.algorithm.multiobjective.mombi

AbstractMOMBI

public abstract class AbstractMOMBI<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>

Abstract class representing variants of the MOMBI algorithm

Author:

Juan J. Durillo Modified by Antonio J. Nebro

Parameters:
  • <S>
Fields
evaluator
protected final SolutionListEvaluator<S> evaluator
iterations
protected int iterations
maxIterations
protected final int maxIterations
nadirPoint
protected final List<Double> nadirPoint
referencePoint
protected final List<Double> referencePoint
Constructors
AbstractMOMBI
public AbstractMOMBI(Problem<S> problem, int maxIterations, CrossoverOperator<S> crossover, MutationOperator<S> mutation, SelectionOperator<List<S>, S> selection, SolutionListEvaluator<S> evaluator)

Constructor

Parameters:
  • problem – Problem to be solved
  • maxIterations – Maximum number of iterations the algorithm will perform
  • crossover – Crossover operator
  • mutation – Mutation operator
  • selection – Selection operator
  • evaluator – Evaluator object for evaluating solution lists
Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getNadirPoint
public List<Double> getNadirPoint()
getReferencePoint
public List<Double> getReferencePoint()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
populationIsNotFull
protected boolean populationIsNotFull(List<S> population)
reproduction
protected List<S> reproduction(List<S> population)
run
public void run()
selection
protected List<S> selection(List<S> population)
setReferencePointValue
protected void setReferencePointValue(Double value, int index)
specificMOEAComputations
public abstract void specificMOEAComputations()
updateNadirPoint
protected void updateNadirPoint(S s)
updateNadirPoint
public void updateNadirPoint(List<S> population)
updateProgress
protected void updateProgress()
updateReferencePoint
protected void updateReferencePoint(S s)
updateReferencePoint
public void updateReferencePoint(List<S> population)

MOMBI

public class MOMBI<S extends Solution<?>> extends AbstractMOMBI<S>
Fields
utilityFunctions
protected final AbstractUtilityFunctionsSet<S> utilityFunctions
Constructors
MOMBI
public MOMBI(Problem<S> problem, int maxIterations, CrossoverOperator<S> crossover, MutationOperator<S> mutation, SelectionOperator<List<S>, S> selection, SolutionListEvaluator<S> evaluator, String pathWeights)
Methods
addLastRankedSolutionsToPopulation
protected void addLastRankedSolutionsToPopulation(R2Ranking<S> ranking, int index, List<S> population)
addRankedSolutionsToPopulation
protected void addRankedSolutionsToPopulation(R2Ranking<S> ranking, int index, List<S> population)
computeRanking
protected R2Ranking<S> computeRanking(List<S> solutionList)
createUtilityFunction
public AbstractUtilityFunctionsSet<S> createUtilityFunction(String pathWeights)
getDescription
public String getDescription()
getMaxPopulationSize
public int getMaxPopulationSize()
getName
public String getName()
getUtilityFunctions
protected AbstractUtilityFunctionsSet<S> getUtilityFunctions()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
selectBest
protected List<S> selectBest(R2Ranking<S> ranking)
specificMOEAComputations
public void specificMOEAComputations()

MOMBI2

public class MOMBI2<S extends Solution<?>> extends MOMBI<S>
Author:Juan J. Durillo
Fields
alpha
protected final Double alpha
epsilon
protected final Double epsilon
history
protected final MOMBI2History<S> history
maxs
protected List<Double> maxs
normalizer
protected Normalizer normalizer
Constructors
MOMBI2
public MOMBI2(Problem<S> problem, int maxIterations, CrossoverOperator<S> crossover, MutationOperator<S> mutation, SelectionOperator<List<S>, S> selection, SolutionListEvaluator<S> evaluator, String pathWeights)

Creates a new instance of the MOMBI algorithm

Parameters:
  • problem
  • maxIterations
  • crossover
  • mutation
  • selection
  • evaluator
  • pathWeights
Methods
computeRanking
protected R2Ranking<S> computeRanking(List<S> solutionList)
createUtilityFunction
public AbstractUtilityFunctionsSet<S> createUtilityFunction(String pathWeights)
getDescription
public String getDescription()
getMax
public Double getMax(List<Double> list)
getName
public String getName()
initProgress
protected void initProgress()
updateMax
protected void updateMax(List<S> population)
updateReferencePoint
public void updateReferencePoint(List<S> population)

org.uma.jmetal.algorithm.multiobjective.mombi.util

ASFUtilityFunctionSet

public class ASFUtilityFunctionSet<S extends Solution<?>> extends AbstractUtilityFunctionsSet<S>
Author:

Juan J. Durillo Modified by Antonio J. Nebro

Parameters:
  • <S>
Constructors
ASFUtilityFunctionSet
public ASFUtilityFunctionSet(double[][] weights, List<Double> referencePoint)
ASFUtilityFunctionSet
public ASFUtilityFunctionSet(double[][] weights)
ASFUtilityFunctionSet
public ASFUtilityFunctionSet(String file_path, List<Double> referencePoint)
ASFUtilityFunctionSet
public ASFUtilityFunctionSet(String file_path)
Methods
evaluate
public Double evaluate(S solution, int vector)
setNormalizer
public void setNormalizer(Normalizer normalizer)

ASFWASFGA

public class ASFWASFGA<S extends Solution<?>> extends AbstractUtilityFunctionsSet<S>
Author:

Juan J. Durillo Modified by Antonio J. Nebro

Parameters:
  • <S>
Constructors
ASFWASFGA
public ASFWASFGA(double[][] weights, List<Double> interestPoint)
ASFWASFGA
public ASFWASFGA(double[][] weights)
ASFWASFGA
public ASFWASFGA(String file_path, List<Double> interestPoint)
ASFWASFGA
public ASFWASFGA(String file_path)
Methods
evaluate
public Double evaluate(S solution, int vector)
setNadir
public void setNadir(List<Double> nadir)
setUtopia
public void setUtopia(List<Double> utopia)
updatePointOfInterest
public void updatePointOfInterest(List<Double> newInterestPoint)

AbstractUtilityFunctionsSet

public abstract class AbstractUtilityFunctionsSet<S extends Solution<?>> implements Serializable
Author:

Juan J. Durillo Modified by Antonio J. Nebro

Parameters:
  • <S>
Constructors
AbstractUtilityFunctionsSet
public AbstractUtilityFunctionsSet(double[][] weights)
AbstractUtilityFunctionsSet
public AbstractUtilityFunctionsSet(String file_path)
Methods
evaluate
public List<Double> evaluate(S solution)

Evaluates a solution using all the utility functions stored in this set

Parameters:
  • solution
evaluate
public abstract Double evaluate(S solution, int vector)

Evaluates a solution using the i-th utility function stored in this set

Parameters:
  • solution
  • vector
getSize
public int getSize()

Returns the number of utility functions stored in this set

Returns:The number of vectors
getVectorSize
public int getVectorSize()

Returns the number of components for all weight vectors

getWeightVector
public List<Double> getWeightVector(int index)

Returns a given weight vector

loadWeightsFromFile
public void loadWeightsFromFile(String filePath)

Reads a set of weight vectors from a file. The expected format for the file is as follows. The first line should start with at least the following three tokens # Any other token on this line will be ignored. indicates how many weight vectors are included in this file indicates how many component has each included vector Each of the following lines of the file represents a weight vector of at least components If more components are provided, they will be ignored by the program

Parameters:
  • filePath – The path in the file system of the file containing the weight vectors

MOMBI2History

public class MOMBI2History<T extends Solution<?>> implements Serializable

Created by ajnebro on 10/9/15.

Fields
MAX_LENGHT
public static final int MAX_LENGHT
Constructors
MOMBI2History
public MOMBI2History(int numberOfObjectives)
Methods
add
public void add(List<Double> maxs)

Adds a new vector of maxs values to the history. The method ensures that only the newest MAX_LENGTH vectors will be kept in the history

Parameters:
  • maxs
decreaseMark
public void decreaseMark(int index)
getMaxObjective
public Double getMaxObjective(int index)
isUnMarked
public boolean isUnMarked(int index)
mark
public void mark(int index)
mean
public List<Double> mean()

Returns the mean of the values contained in the history

std
public List<Double> std(List<Double> mean)

Return the std of the values contained in the history

variance
public List<Double> variance(List<Double> mean)

Returns the variance of the values contained in the history

Normalizer

public class Normalizer
Constructors
Normalizer
public Normalizer(List<Double> min, List<Double> max)
Methods
normalize
public Double normalize(Double input, int index)

R2Ranking

public class R2Ranking<S extends Solution<?>> extends GenericSolutionAttribute<S, R2SolutionData>
Constructors
R2Ranking
public R2Ranking(AbstractUtilityFunctionsSet<S> utilityFunctions)
Methods
computeRanking
public R2Ranking<S> computeRanking(List<S> population)
getAttribute
public R2SolutionData getAttribute(S solution)
getAttributeIdentifier
public Object getAttributeIdentifier()
getNumberOfSubfronts
public int getNumberOfSubfronts()
getSubfront
public List<S> getSubfront(int rank)
getUtilityFunctions
public AbstractUtilityFunctionsSet<S> getUtilityFunctions()
setAttribute
public void setAttribute(S solution, R2SolutionData value)

R2RankingAttribute

public class R2RankingAttribute<T extends Solution<?>> extends GenericSolutionAttribute<T, R2SolutionData>

Created by ajnebro on 10/9/15.

R2RankingNormalized

public class R2RankingNormalized<S extends Solution<?>> extends R2Ranking<S>
Constructors
R2RankingNormalized
public R2RankingNormalized(AbstractUtilityFunctionsSet<S> utilityFunctions, Normalizer normalizer)
Methods
computeRanking
public R2RankingNormalized<S> computeRanking(List<S> population)
getNumberOfSubfronts
public int getNumberOfSubfronts()
getSubfront
public List<S> getSubfront(int rank)

R2SolutionData

public class R2SolutionData
Fields
alpha
public double alpha
rank
public int rank
utility
public double utility

TchebycheffUtilityFunctionsSet

public class TchebycheffUtilityFunctionsSet<S extends Solution<?>> extends AbstractUtilityFunctionsSet<S>

This class implements a set of utility functions based on the Tchebycheff aggregation approach

Author:

Juan J. Durillo ToDo List: + check the size of nadir and reference points are the correct ones + check that the function that needs to be evaluated is the correct one

Parameters:
  • <S>
Constructors
TchebycheffUtilityFunctionsSet
public TchebycheffUtilityFunctionsSet(String file_path, List<Double> referencePoint)
TchebycheffUtilityFunctionsSet
public TchebycheffUtilityFunctionsSet(String file_path)
Methods
evaluate
public Double evaluate(S solution, int vector)

org.uma.jmetal.algorithm.multiobjective.mombi2

MOMBI2IT

public class MOMBI2IT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

org.uma.jmetal.algorithm.multiobjective.nsgaii

NSGAII

public class NSGAII<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>
Author:Antonio J. Nebro
Fields
dominanceComparator
protected Comparator<S> dominanceComparator
evaluations
protected int evaluations
evaluator
protected final SolutionListEvaluator<S> evaluator
maxEvaluations
protected final int maxEvaluations
Constructors
NSGAII
public NSGAII(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator)

Constructor

NSGAII
public NSGAII(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, Comparator<S> dominanceComparator, SolutionListEvaluator<S> evaluator)

Constructor

Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getNonDominatedSolutions
protected List<S> getNonDominatedSolutions(List<S> solutionList)
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
updateProgress
protected void updateProgress()

NSGAII45

public class NSGAII45<S extends Solution<?>> implements Algorithm<List<S>>

Implementation of NSGA-II following the scheme used in jMetal4.5 and former versions, i.e, without implementing the AbstractGeneticAlgorithm interface.

Author:Antonio J. Nebro
Fields
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
evaluations
protected int evaluations
evaluator
protected final SolutionListEvaluator<S> evaluator
maxEvaluations
protected final int maxEvaluations
mutationOperator
protected MutationOperator<S> mutationOperator
population
protected List<S> population
populationSize
protected final int populationSize
problem
protected final Problem<S> problem
selectionOperator
protected SelectionOperator<List<S>, S> selectionOperator
Constructors
NSGAII45
public NSGAII45(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator)

Constructor

Methods
addLastRankedSolutionsToPopulation
protected void addLastRankedSolutionsToPopulation(Ranking<S> ranking, int rank, List<S> population)
addRankedSolutionsToPopulation
protected void addRankedSolutionsToPopulation(Ranking<S> ranking, int rank, List<S> population)
computeRanking
protected Ranking<S> computeRanking(List<S> solutionList)
createInitialPopulation
protected List<S> createInitialPopulation()
crowdingDistanceSelection
protected List<S> crowdingDistanceSelection(Ranking<S> ranking)
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getNonDominatedSolutions
protected List<S> getNonDominatedSolutions(List<S> solutionList)
getResult
public List<S> getResult()
populationIsNotFull
protected boolean populationIsNotFull(List<S> population)
run
public void run()

Run method

subfrontFillsIntoThePopulation
protected boolean subfrontFillsIntoThePopulation(Ranking<S> ranking, int rank, List<S> population)

NSGAIIBuilder

public class NSGAIIBuilder<S extends Solution<?>> implements AlgorithmBuilder<NSGAII<S>>
Author:Antonio J. Nebro
Constructors
NSGAIIBuilder
public NSGAIIBuilder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)

NSGAIIBuilder constructor

Methods
build
public NSGAII<S> build()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getMaxIterations
public int getMaxIterations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
getSolutionListEvaluator
public SolutionListEvaluator<S> getSolutionListEvaluator()
setDominanceComparator
public NSGAIIBuilder<S> setDominanceComparator(Comparator<S> dominanceComparator)
setMaxEvaluations
public NSGAIIBuilder<S> setMaxEvaluations(int maxEvaluations)
setPopulationSize
public NSGAIIBuilder<S> setPopulationSize(int populationSize)
setSelectionOperator
public NSGAIIBuilder<S> setSelectionOperator(SelectionOperator<List<S>, S> selectionOperator)
setSolutionListEvaluator
public NSGAIIBuilder<S> setSolutionListEvaluator(SolutionListEvaluator<S> evaluator)
setVariant
public NSGAIIBuilder<S> setVariant(NSGAIIVariant variant)

NSGAIIBuilder.NSGAIIVariant

public enum NSGAIIVariant
Enum Constants
Measures
public static final NSGAIIBuilder.NSGAIIVariant Measures
NSGAII
public static final NSGAIIBuilder.NSGAIIVariant NSGAII
NSGAII45
public static final NSGAIIBuilder.NSGAIIVariant NSGAII45
SteadyStateNSGAII
public static final NSGAIIBuilder.NSGAIIVariant SteadyStateNSGAII

NSGAIIBuilderTest

public class NSGAIIBuilderTest

Created by Antonio J. Nebro on 25/11/14.

Methods
buildAlgorithm
public void buildAlgorithm()
cleanup
public void cleanup()
getProblem
public void getProblem()
setNegativeMaxNumberOfIterations
public void setNegativeMaxNumberOfIterations()
setNegativePopulationSize
public void setNegativePopulationSize()
setNewEvaluator
public void setNewEvaluator()
setNewSelectionOperator
public void setNewSelectionOperator()
setNullEvaluator
public void setNullEvaluator()
setNullSelectionOperator
public void setNullSelectionOperator()
setPositiveMaxNumberOfIterations
public void setPositiveMaxNumberOfIterations()
setValidPopulationSize
public void setValidPopulationSize()
startup
public void startup()
testDefaultConfiguration
public void testDefaultConfiguration()

NSGAIIIT

public class NSGAIIIT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnAGoodQualityFrontWhenSolvingAConstrainedProblem
public void shouldTheAlgorithmReturnAGoodQualityFrontWhenSolvingAConstrainedProblem()
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()

NSGAIIMeasures

public class NSGAIIMeasures<S extends Solution<?>> extends NSGAII<S> implements Measurable
Author:Antonio J. Nebro
Fields
durationMeasure
protected DurationMeasure durationMeasure
evaluations
protected CountingMeasure evaluations
hypervolumeValue
protected BasicMeasure<Double> hypervolumeValue
measureManager
protected SimpleMeasureManager measureManager
numberOfNonDominatedSolutionsInPopulation
protected BasicMeasure<Integer> numberOfNonDominatedSolutionsInPopulation
referenceFront
protected Front referenceFront
solutionListMeasure
protected BasicMeasure<List<S>> solutionListMeasure
Constructors
NSGAIIMeasures
public NSGAIIMeasures(Problem<S> problem, int maxIterations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, Comparator<S> dominanceComparator, SolutionListEvaluator<S> evaluator)

Constructor

Methods
getDescription
public String getDescription()
getEvaluations
public CountingMeasure getEvaluations()
getMeasureManager
public MeasureManager getMeasureManager()
getName
public String getName()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
run
public void run()
setReferenceFront
public void setReferenceFront(Front referenceFront)
updateProgress
protected void updateProgress()

NSGAIIStoppingByTime

public class NSGAIIStoppingByTime<S extends Solution<?>> extends NSGAII<S>

This class shows a version of NSGA-II having a stopping condition depending on run-time

Author:Antonio J. Nebro
Constructors
NSGAIIStoppingByTime
public NSGAIIStoppingByTime(Problem<S> problem, int populationSize, long maxComputingTime, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, Comparator<S> dominanceComparator)

Constructor

Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
updateProgress
protected void updateProgress()

SteadyStateNSGAII

public class SteadyStateNSGAII<S extends Solution<?>> extends NSGAII<S>
Author:Antonio J. Nebro
Constructors
SteadyStateNSGAII
public SteadyStateNSGAII(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, Comparator<S> dominanceComparator, SolutionListEvaluator<S> evaluator)

Constructor

Methods
getDescription
public String getDescription()
getName
public String getName()
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

org.uma.jmetal.algorithm.multiobjective.nsgaiii

NSGAIII

public class NSGAIII<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>

Created by ajnebro on 30/10/14. Modified by Juanjo on 13/11/14 This implementation is based on the code of Tsung-Che Chiang http://web.ntnu.edu.tw/~tcchiang/publications/nsga3cpp/nsga3cpp.htm

Fields
evaluator
protected SolutionListEvaluator<S> evaluator
iterations
protected int iterations
maxIterations
protected int maxIterations
numberOfDivisions
protected Vector<Integer> numberOfDivisions
referencePoints
protected List<ReferencePoint<S>> referencePoints
Constructors
NSGAIII
public NSGAIII(NSGAIIIBuilder<S> builder)

Constructor

Methods
addRankedSolutionsToPopulation
protected void addRankedSolutionsToPopulation(Ranking<S> ranking, int rank, List<S> population)
computeRanking
protected Ranking<S> computeRanking(List<S> solutionList)
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getNonDominatedSolutions
protected List<S> getNonDominatedSolutions(List<S> solutionList)
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

NSGAIIIBuilder

public class NSGAIIIBuilder<S extends Solution<?>> implements AlgorithmBuilder<NSGAIII<S>>

Builder class

Constructors
NSGAIIIBuilder
public NSGAIIIBuilder(Problem<S> problem)

Builder constructor

Methods
build
public NSGAIII<S> build()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getEvaluator
public SolutionListEvaluator<S> getEvaluator()
getMaxIterations
public int getMaxIterations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
setCrossoverOperator
public NSGAIIIBuilder<S> setCrossoverOperator(CrossoverOperator<S> crossoverOperator)
setMaxIterations
public NSGAIIIBuilder<S> setMaxIterations(int maxIterations)
setMutationOperator
public NSGAIIIBuilder<S> setMutationOperator(MutationOperator<S> mutationOperator)
setPopulationSize
public NSGAIIIBuilder<S> setPopulationSize(int populationSize)
setSelectionOperator
public NSGAIIIBuilder<S> setSelectionOperator(SelectionOperator<List<S>, S> selectionOperator)
setSolutionListEvaluator
public NSGAIIIBuilder<S> setSolutionListEvaluator(SolutionListEvaluator<S> evaluator)

org.uma.jmetal.algorithm.multiobjective.nsgaiii.util

EnvironmentalSelection

public class EnvironmentalSelection<S extends Solution<?>> implements SelectionOperator<List<S>, List<S>>, SolutionAttribute<S, List<Double>>
Constructors
EnvironmentalSelection
public EnvironmentalSelection(Builder<S> builder)
EnvironmentalSelection
public EnvironmentalSelection(List<List<S>> fronts, int solutionsToSelect, List<ReferencePoint<S>> referencePoints, int numberOfObjectives)
Methods
FindNicheReferencePoint
int FindNicheReferencePoint()
SelectClusterMember
S SelectClusterMember(ReferencePoint<S> rp)
associate
public void associate(List<S> population)
constructHyperplane
public List<Double> constructHyperplane(List<S> population, List<S> extreme_points)
execute
public List<S> execute(List<S> source)
getAttribute
public List<Double> getAttribute(S solution)
getAttributeIdentifier
public Object getAttributeIdentifier()
guassianElimination
public List<Double> guassianElimination(List<List<Double>> A, List<Double> b)
normalizeObjectives
public void normalizeObjectives(List<S> population, List<Double> intercepts, List<Double> ideal_point)
perpendicularDistance
public double perpendicularDistance(List<Double> direction, List<Double> point)
setAttribute
public void setAttribute(S solution, List<Double> value)
translateObjectives
public List<Double> translateObjectives(List<S> population)

EnvironmentalSelection.Builder

public static class Builder<S extends Solution<?>>
Methods
build
public EnvironmentalSelection<S> build()
getFronts
public List<List<S>> getFronts()
getNumberOfObjectives
public int getNumberOfObjectives()
getReferencePoints
public List<ReferencePoint<S>> getReferencePoints()
getSolutionsToSelet
public int getSolutionsToSelet()
setFronts
public Builder<S> setFronts(List<List<S>> f)
setNumberOfObjectives
public Builder<S> setNumberOfObjectives(int n)
setReferencePoints
public Builder<S> setReferencePoints(List<ReferencePoint<S>> referencePoints)
setSolutionsToSelect
public Builder<S> setSolutionsToSelect(int solutions)

ReferencePoint

public class ReferencePoint<S extends Solution<?>>

Created by ajnebro on 5/11/14. Modified by Juanjo on 13/11/14 This implementation is based on the code of Tsung-Che Chiang http://web.ntnu.edu.tw/~tcchiang/publications/nsga3cpp/nsga3cpp.htm

Fields
position
public List<Double> position
Constructors
ReferencePoint
public ReferencePoint()
ReferencePoint
public ReferencePoint(int size)

Constructor

ReferencePoint
public ReferencePoint(ReferencePoint<S> point)
Methods
AddMember
public void AddMember()
AddPotentialMember
public void AddPotentialMember(S member_ind, double distance)
FindClosestMember
public S FindClosestMember()
HasPotentialMember
public boolean HasPotentialMember()
MemberSize
public int MemberSize()
RandomMember
public S RandomMember()
RemovePotentialMember
public void RemovePotentialMember(S solution)
clear
public void clear()
generateReferencePoints
public void generateReferencePoints(List<ReferencePoint<S>> referencePoints, int numberOfObjectives, List<Integer> numberOfDivisions)
pos
public List<Double> pos()

org.uma.jmetal.algorithm.multiobjective.omopso

OMOPSO

public class OMOPSO extends AbstractParticleSwarmOptimization<DoubleSolution, List<DoubleSolution>>

Class implementing the OMOPSO algorithm

Fields
Constructors
OMOPSO
public OMOPSO(DoubleProblem problem, SolutionListEvaluator<DoubleSolution> evaluator, int swarmSize, int maxIterations, int archiveSize, UniformMutation uniformMutation, NonUniformMutation nonUniformMutation)

Constructor

Methods
createInitialSwarm
protected List<DoubleSolution> createInitialSwarm()
evaluateSwarm
protected List<DoubleSolution> evaluateSwarm(List<DoubleSolution> swarm)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<DoubleSolution> getResult()
initProgress
protected void initProgress()
initializeLeader
protected void initializeLeader(List<DoubleSolution> swarm)
initializeParticlesMemory
protected void initializeParticlesMemory(List<DoubleSolution> swarm)
initializeVelocity
protected void initializeVelocity(List<DoubleSolution> swarm)
isStoppingConditionReached
protected boolean isStoppingConditionReached()
perturbation
protected void perturbation(List<DoubleSolution> swarm)

Apply a mutation operator to all particles in the swarm (perturbation)

tearDown
protected void tearDown()
updateLeaders
protected void updateLeaders(List<DoubleSolution> swarm)

Update leaders method

Parameters:
  • swarm – List of solutions (swarm)
updateParticlesMemory
protected void updateParticlesMemory(List<DoubleSolution> swarm)
updatePosition
protected void updatePosition(List<DoubleSolution> swarm)

Update the position of each particle

updateProgress
protected void updateProgress()
updateVelocity
protected void updateVelocity(List<DoubleSolution> swarm)

OMOPSOBuilder

public class OMOPSOBuilder implements AlgorithmBuilder<OMOPSO>

Class implementing the OMOPSO algorithm

Fields
evaluator
protected SolutionListEvaluator<DoubleSolution> evaluator
problem
protected DoubleProblem problem
Constructors
OMOPSOBuilder
public OMOPSOBuilder(DoubleProblem problem, SolutionListEvaluator<DoubleSolution> evaluator)
Methods
build
public OMOPSO build()
getArchiveSize
public int getArchiveSize()
getMaxIterations
public int getMaxIterations()
getNonUniformMutation
public NonUniformMutation getNonUniformMutation()
getSwarmSize
public int getSwarmSize()
getUniformMutation
public UniformMutation getUniformMutation()
setArchiveSize
public OMOPSOBuilder setArchiveSize(int archiveSize)
setMaxIterations
public OMOPSOBuilder setMaxIterations(int maxIterations)
setNonUniformMutation
public OMOPSOBuilder setNonUniformMutation(MutationOperator<DoubleSolution> nonUniformMutation)
setSwarmSize
public OMOPSOBuilder setSwarmSize(int swarmSize)
setUniformMutation
public OMOPSOBuilder setUniformMutation(MutationOperator<DoubleSolution> uniformMutation)

OMOPSOIT

public class OMOPSOIT

Integration tests for algorithm OMOPSO

Author:Antonio J. Nebro
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

org.uma.jmetal.algorithm.multiobjective.paes

PAES

public class PAES<S extends Solution<?>> extends AbstractEvolutionStrategy<S, List<S>>
Author:Antonio J. Nebro, Juan J. Durillo
Fields
archive
protected AdaptiveGridArchive<S> archive
archiveSize
protected int archiveSize
biSections
protected int biSections
comparator
protected Comparator<S> comparator
evaluations
protected int evaluations
maxEvaluations
protected int maxEvaluations
Constructors
PAES
public PAES(Problem<S> problem, int archiveSize, int maxEvaluations, int biSections, MutationOperator<S> mutationOperator)

Constructor

Methods
createInitialPopulation
protected List<S> createInitialPopulation()
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getArchiveSize
public int getArchiveSize()
getBiSections
public int getBiSections()
getDescription
public String getDescription()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
test
public S test(S solution, S mutatedSolution, AdaptiveGridArchive<S> archive)

Tests two solutions to determine which one becomes be the guide of PAES algorithm

Parameters:
  • solution – The actual guide of PAES
  • mutatedSolution – A candidate guide
updateProgress
protected void updateProgress()

PAESBuilder

public class PAESBuilder<S extends Solution<?>> implements AlgorithmBuilder<PAES<S>>
Author:Antonio J. Nebro
Constructors
PAESBuilder
public PAESBuilder(Problem<S> problem)
Methods
build
public PAES<S> build()
getArchiveSize
public int getArchiveSize()
getBiSections
public int getBiSections()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getProblem
public Problem<S> getProblem()
setArchiveSize
public PAESBuilder<S> setArchiveSize(int archiveSize)
setBiSections
public PAESBuilder<S> setBiSections(int biSections)
setMaxEvaluations
public PAESBuilder<S> setMaxEvaluations(int maxEvaluations)
setMutationOperator
public PAESBuilder<S> setMutationOperator(MutationOperator<S> mutation)

org.uma.jmetal.algorithm.multiobjective.pesa2

PESA2

public class PESA2<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>
Author:Antonio J. Nebro
Fields
evaluator
protected final SolutionListEvaluator<S> evaluator
selectionOperator
protected SelectionOperator<AdaptiveGridArchive<S>, S> selectionOperator
Constructors
PESA2
public PESA2(Problem<S> problem, int maxEvaluations, int populationSize, int archiveSize, int biSections, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SolutionListEvaluator<S> evaluator)
Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

PESA2Builder

public class PESA2Builder<S extends Solution<?>> implements AlgorithmBuilder<PESA2<S>>

Created by Antonio J. Nebro

Constructors
PESA2Builder
public PESA2Builder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)

Constructor

Methods
build
public PESA2<S> build()
getArchiveSize
public int getArchiveSize()
getBiSections
public int getBiSections()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSolutionListEvaluator
public SolutionListEvaluator<S> getSolutionListEvaluator()
setArchiveSize
public PESA2Builder<S> setArchiveSize(int archiveSize)
setBisections
public PESA2Builder<S> setBisections(int biSections)
setMaxEvaluations
public PESA2Builder<S> setMaxEvaluations(int maxEvaluations)
setPopulationSize
public PESA2Builder<S> setPopulationSize(int populationSize)
setSolutionListEvaluator
public PESA2Builder<S> setSolutionListEvaluator(SolutionListEvaluator<S> evaluator)

org.uma.jmetal.algorithm.multiobjective.pesa2.util

PESA2Selection

public class PESA2Selection<S extends Solution<?>> implements SelectionOperator<AdaptiveGridArchive<S>, S>

This class implements a selection operator as the used in the PESA-II algorithm

Constructors
PESA2Selection
public PESA2Selection()
Methods
execute
public S execute(AdaptiveGridArchive<S> archive)

org.uma.jmetal.algorithm.multiobjective.randomsearch

RandomSearch

public class RandomSearch<S extends Solution<?>> implements Algorithm<List<S>>

This class implements a simple random search algorithm.

Author:Antonio J. Nebro
Fields
nonDominatedArchive
NonDominatedSolutionListArchive<S> nonDominatedArchive
Constructors
RandomSearch
public RandomSearch(Problem<S> problem, int maxEvaluations)

Constructor

Methods
getDescription
public String getDescription()
getMaxEvaluations
public int getMaxEvaluations()
getName
public String getName()
getResult
public List<S> getResult()
run
public void run()

RandomSearchBuilder

public class RandomSearchBuilder<S extends Solution<?>> implements AlgorithmBuilder<RandomSearch<S>>

This class implements a simple random search algorithm.

Author:Antonio J. Nebro
Constructors
RandomSearchBuilder
public RandomSearchBuilder(Problem<S> problem)
Methods
build
public RandomSearch<S> build()
getMaxEvaluations
public int getMaxEvaluations()
setMaxEvaluations
public RandomSearchBuilder<S> setMaxEvaluations(int maxEvaluations)

org.uma.jmetal.algorithm.multiobjective.rnsgaii

RNSGAII

public class RNSGAII<S extends Solution<?>> extends NSGAII<S> implements InteractiveAlgorithm<S, List<S>>
Author:Antonio J. Nebro
Constructors
RNSGAII
public RNSGAII(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator, List<Double> interestPoint, double epsilon)

Constructor

Methods
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
updatePointOfInterest
public void updatePointOfInterest(List<Double> newReferencePoints)
updateProgress
protected void updateProgress()

RNSGAIIBuilder

public class RNSGAIIBuilder<S extends Solution<?>> implements AlgorithmBuilder<RNSGAII<S>>
Author:Antonio J. Nebro
Constructors
RNSGAIIBuilder
public RNSGAIIBuilder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, List<Double> interestPoint, double epsilon)

NSGAIIBuilder constructor

Methods
build
public RNSGAII<S> build()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getMaxIterations
public int getMaxIterations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
getSolutionListEvaluator
public SolutionListEvaluator<S> getSolutionListEvaluator()
setMaxEvaluations
public RNSGAIIBuilder<S> setMaxEvaluations(int maxEvaluations)
setPopulationSize
public RNSGAIIBuilder<S> setPopulationSize(int populationSize)
setSelectionOperator
public RNSGAIIBuilder<S> setSelectionOperator(SelectionOperator<List<S>, S> selectionOperator)
setSolutionListEvaluator
public RNSGAIIBuilder<S> setSolutionListEvaluator(SolutionListEvaluator<S> evaluator)
setVariant
public RNSGAIIBuilder<S> setVariant(NSGAIIVariant variant)

RNSGAIIBuilder.NSGAIIVariant

public enum NSGAIIVariant
Enum Constants
Measures
public static final RNSGAIIBuilder.NSGAIIVariant Measures
NSGAII
public static final RNSGAIIBuilder.NSGAIIVariant NSGAII
NSGAII45
public static final RNSGAIIBuilder.NSGAIIVariant NSGAII45
SteadyStateNSGAII
public static final RNSGAIIBuilder.NSGAIIVariant SteadyStateNSGAII

org.uma.jmetal.algorithm.multiobjective.rnsgaii.util

PreferenceNSGAII

public class PreferenceNSGAII<S extends Solution<?>>
Constructors
PreferenceNSGAII
public PreferenceNSGAII(List<Double> weights)
Methods
evaluate
public Double evaluate(S solution)
getSize
public int getSize()
setLowerBounds
public void setLowerBounds(List<Double> lowerBounds)
setUpperBounds
public void setUpperBounds(List<Double> upperBounds)
updatePointOfInterest
public void updatePointOfInterest(List<Double> newInterestPoint)

RNSGAIIRanking

public class RNSGAIIRanking<S extends Solution<?>> extends GenericSolutionAttribute<S, Integer> implements Ranking<S>
Constructors
RNSGAIIRanking
public RNSGAIIRanking(PreferenceNSGAII<S> utilityFunctions, double epsilon, List<Double> interestPoint)
Methods
computeRanking
public Ranking<S> computeRanking(List<S> population)
getNumberOfSubfronts
public int getNumberOfSubfronts()
getSubfront
public List<S> getSubfront(int rank)

org.uma.jmetal.algorithm.multiobjective.smpso

SMPSO

public class SMPSO extends AbstractParticleSwarmOptimization<DoubleSolution, List<DoubleSolution>>

This class implements the SMPSO algorithm described in: SMPSO: A new PSO-based metaheuristic for multi-objective optimization MCDM 2009. DOI: http://dx.doi.org/10.1109/MCDM.2009.4938830

Author:Antonio J. Nebro
Constructors
SMPSO
public SMPSO(DoubleProblem problem, int swarmSize, BoundedArchive<DoubleSolution> leaders, MutationOperator<DoubleSolution> mutationOperator, int maxIterations, double r1Min, double r1Max, double r2Min, double r2Max, double c1Min, double c1Max, double c2Min, double c2Max, double weightMin, double weightMax, double changeVelocity1, double changeVelocity2, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Methods
constrictionCoefficient
protected double constrictionCoefficient(double c1, double c2)
createInitialSwarm
protected List<DoubleSolution> createInitialSwarm()
evaluateSwarm
protected List<DoubleSolution> evaluateSwarm(List<DoubleSolution> swarm)
getDescription
public String getDescription()
getIterations
public int getIterations()
getMaxIterations
public int getMaxIterations()
getName
public String getName()
getResult
public List<DoubleSolution> getResult()
getSwarmSize
public int getSwarmSize()
initProgress
protected void initProgress()
initializeLeader
protected void initializeLeader(List<DoubleSolution> swarm)
initializeParticlesMemory
protected void initializeParticlesMemory(List<DoubleSolution> swarm)
initializeVelocity
protected void initializeVelocity(List<DoubleSolution> swarm)
isStoppingConditionReached
protected boolean isStoppingConditionReached()
perturbation
protected void perturbation(List<DoubleSolution> swarm)
selectGlobalBest
protected DoubleSolution selectGlobalBest()
setIterations
public void setIterations(int iterations)
updateLeaders
protected void updateLeaders(List<DoubleSolution> swarm)
updateLeadersDensityEstimator
protected void updateLeadersDensityEstimator()
updateParticlesMemory
protected void updateParticlesMemory(List<DoubleSolution> swarm)
updatePosition
protected void updatePosition(List<DoubleSolution> swarm)
updateProgress
protected void updateProgress()
updateVelocity
protected void updateVelocity(List<DoubleSolution> swarm)

SMPSOBuilder

public class SMPSOBuilder implements AlgorithmBuilder<SMPSO>
Author:Antonio J. Nebro
Fields
archiveSize
protected int archiveSize
evaluator
protected SolutionListEvaluator<DoubleSolution> evaluator
leaders
protected BoundedArchive<DoubleSolution> leaders
mutationOperator
protected MutationOperator<DoubleSolution> mutationOperator
variant
protected SMPSOVariant variant
Constructors
SMPSOBuilder
public SMPSOBuilder(DoubleProblem problem, BoundedArchive<DoubleSolution> leaders)
Methods
build
public SMPSO build()
getArchiveSize
public int getArchiveSize()
getC1Max
public double getC1Max()
getC1Min
public double getC1Min()
getC2Max
public double getC2Max()
getC2Min
public double getC2Min()
getChangeVelocity1
public double getChangeVelocity1()
getChangeVelocity2
public double getChangeVelocity2()
getEvaluator
public SolutionListEvaluator<DoubleSolution> getEvaluator()
getLeaders
public BoundedArchive<DoubleSolution> getLeaders()
getMaxIterations
public int getMaxIterations()
getMutation
public MutationOperator<DoubleSolution> getMutation()
getMutationOperator
public MutationOperator<DoubleSolution> getMutationOperator()
getProblem
public DoubleProblem getProblem()
getR1Max
public double getR1Max()
getR1Min
public double getR1Min()
getR2Max
public double getR2Max()
getR2Min
public double getR2Min()
getSwarmSize
public int getSwarmSize()
getWeightMax
public double getWeightMax()
getWeightMin
public double getWeightMin()
setC1Max
public SMPSOBuilder setC1Max(double c1Max)
setC1Min
public SMPSOBuilder setC1Min(double c1Min)
setC2Max
public SMPSOBuilder setC2Max(double c2Max)
setC2Min
public SMPSOBuilder setC2Min(double c2Min)
setChangeVelocity1
public SMPSOBuilder setChangeVelocity1(double changeVelocity1)
setChangeVelocity2
public SMPSOBuilder setChangeVelocity2(double changeVelocity2)
setMaxIterations
public SMPSOBuilder setMaxIterations(int maxIterations)
setMutation
public SMPSOBuilder setMutation(MutationOperator<DoubleSolution> mutation)
setR1Max
public SMPSOBuilder setR1Max(double r1Max)
setR1Min
public SMPSOBuilder setR1Min(double r1Min)
setR2Max
public SMPSOBuilder setR2Max(double r2Max)
setR2Min
public SMPSOBuilder setR2Min(double r2Min)
setRandomGenerator
public SMPSOBuilder setRandomGenerator(PseudoRandomGenerator randomGenerator)
setSolutionListEvaluator
public SMPSOBuilder setSolutionListEvaluator(SolutionListEvaluator<DoubleSolution> evaluator)
setSwarmSize
public SMPSOBuilder setSwarmSize(int swarmSize)
setVariant
public SMPSOBuilder setVariant(SMPSOVariant variant)
setWeightMax
public SMPSOBuilder setWeightMax(double weightMax)
setWeightMin
public SMPSOBuilder setWeightMin(double weightMin)

SMPSOBuilder.SMPSOVariant

public enum SMPSOVariant
Enum Constants
Measures
public static final SMPSOBuilder.SMPSOVariant Measures
SMPSO
public static final SMPSOBuilder.SMPSOVariant SMPSO

SMPSOIT

public class SMPSOIT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnAGoodQualityFrontWhenSolvingAConstrainedProblem
public void shouldTheAlgorithmReturnAGoodQualityFrontWhenSolvingAConstrainedProblem()
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

SMPSOMeasures

public class SMPSOMeasures extends SMPSO implements Measurable

This class implements a version of SMPSO using measures

Author:Antonio J. Nebro
Fields
durationMeasure
protected DurationMeasure durationMeasure
iterations
protected CountingMeasure iterations
measureManager
protected SimpleMeasureManager measureManager
solutionListMeasure
protected BasicMeasure<List<DoubleSolution>> solutionListMeasure
Constructors
SMPSOMeasures
public SMPSOMeasures(DoubleProblem problem, int swarmSize, BoundedArchive<DoubleSolution> leaders, MutationOperator<DoubleSolution> mutationOperator, int maxIterations, double r1Min, double r1Max, double r2Min, double r2Max, double c1Min, double c1Max, double c2Min, double c2Max, double weightMin, double weightMax, double changeVelocity1, double changeVelocity2, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Parameters:
  • problem
  • swarmSize
  • leaders
  • mutationOperator
  • maxIterations
  • r1Min
  • r1Max
  • r2Min
  • r2Max
  • c1Min
  • c1Max
  • c2Min
  • c2Max
  • weightMin
  • weightMax
  • changeVelocity1
  • changeVelocity2
  • evaluator
Methods
getDescription
public String getDescription()
getMeasureManager
public MeasureManager getMeasureManager()
getName
public String getName()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
run
public void run()
updateProgress
protected void updateProgress()

SMPSORP

public class SMPSORP extends AbstractParticleSwarmOptimization<DoubleSolution, List<DoubleSolution>> implements Measurable

This class implements the SMPSORP algorithm described in: “Extending the Speed-constrained Multi-Objective PSO (SMPSO) With Reference Point Based Preference Articulation. Antonio J. Nebro, Juan J. Durillo, José García-Nieto, Cristóbal Barba-González, Javier Del Ser, Carlos A. Coello Coello, Antonio Benítez-Hidalgo, José F. Aldana-Montes. Parallel Problem Solving from Nature – PPSN XV. Lecture Notes In Computer Science, Vol. 11101, pp. 298-310. 2018”.

Author:Antonio J. Nebro
Fields
currentIteration
protected CountingMeasure currentIteration
deltaMax
protected double deltaMax
deltaMin
protected double deltaMin
durationMeasure
protected DurationMeasure durationMeasure
evaluator
protected SolutionListEvaluator<DoubleSolution> evaluator
iterations
protected int iterations
maxIterations
protected int maxIterations
measureManager
protected SimpleMeasureManager measureManager
referencePoints
protected List<List<Double>> referencePoints
solutionListMeasure
protected BasicMeasure<List<DoubleSolution>> solutionListMeasure
swarmSize
protected int swarmSize
Constructors
SMPSORP
public SMPSORP(DoubleProblem problem, int swarmSize, List<ArchiveWithReferencePoint<DoubleSolution>> leaders, List<List<Double>> referencePoints, MutationOperator<DoubleSolution> mutationOperator, int maxIterations, double r1Min, double r1Max, double r2Min, double r2Max, double c1Min, double c1Max, double c2Min, double c2Max, double weightMin, double weightMax, double changeVelocity1, double changeVelocity2, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Methods
changeReferencePoints
public synchronized void changeReferencePoints(List<List<Double>> referencePoints)
createInitialSwarm
protected List<DoubleSolution> createInitialSwarm()
evaluateSwarm
protected List<DoubleSolution> evaluateSwarm(List<DoubleSolution> swarm)
getDescription
public String getDescription()
getMeasureManager
public MeasureManager getMeasureManager()
getName
public String getName()
getResult
public List<DoubleSolution> getResult()
initProgress
protected void initProgress()
initializeLeader
protected void initializeLeader(List<DoubleSolution> swarm)
initializeParticlesMemory
protected void initializeParticlesMemory(List<DoubleSolution> swarm)
initializeVelocity
protected void initializeVelocity(List<DoubleSolution> swarm)
isStoppingConditionReached
protected boolean isStoppingConditionReached()
perturbation
protected void perturbation(List<DoubleSolution> swarm)
removeDominatedSolutionsInArchives
public void removeDominatedSolutionsInArchives()
selectGlobalBest
protected DoubleSolution selectGlobalBest()
updateLeaders
protected void updateLeaders(List<DoubleSolution> swarm)
updateLeadersDensityEstimator
protected void updateLeadersDensityEstimator()
updateParticlesMemory
protected void updateParticlesMemory(List<DoubleSolution> swarm)
updatePosition
protected void updatePosition(List<DoubleSolution> swarm)
updateProgress
protected void updateProgress()
updateVelocity
protected void updateVelocity(List<DoubleSolution> swarm)

SMPSOhv2IT

public class SMPSOhv2IT
Methods
setup
public void setup()
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

SMPSOhvIT

public class SMPSOhvIT
Methods
setup
public void setup()
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

org.uma.jmetal.algorithm.multiobjective.smsemoa

SMSEMOA

public class SMSEMOA<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>
Author:Antonio J. Nebro
Fields
dominanceComparator
protected Comparator<S> dominanceComparator
evaluations
protected int evaluations
maxEvaluations
protected final int maxEvaluations
offset
protected final double offset
Constructors
SMSEMOA
public SMSEMOA(Problem<S> problem, int maxEvaluations, int populationSize, double offset, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, Comparator<S> dominanceComparator, Hypervolume<S> hypervolumeImplementation)

Constructor

Methods
computeRanking
protected Ranking<S> computeRanking(List<S> solutionList)
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

SMSEMOABuilder

public class SMSEMOABuilder<S extends Solution<?>> implements AlgorithmBuilder<SMSEMOA<S>>
Author:Antonio J. Nebro
Fields
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
dominanceComparator
protected Comparator<S> dominanceComparator
hypervolumeImplementation
protected Hypervolume<S> hypervolumeImplementation
maxEvaluations
protected int maxEvaluations
mutationOperator
protected MutationOperator<S> mutationOperator
offset
protected double offset
populationSize
protected int populationSize
problem
protected Problem<S> problem
selectionOperator
protected SelectionOperator<List<S>, S> selectionOperator
Constructors
SMSEMOABuilder
public SMSEMOABuilder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)
Methods
build
public SMSEMOA<S> build()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getOffset
public double getOffset()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
setCrossoverOperator
public SMSEMOABuilder<S> setCrossoverOperator(CrossoverOperator<S> crossover)
setDominanceComparator
public SMSEMOABuilder<S> setDominanceComparator(Comparator<S> dominanceComparator)
setHypervolumeImplementation
public SMSEMOABuilder<S> setHypervolumeImplementation(Hypervolume<S> hypervolumeImplementation)
setMaxEvaluations
public SMSEMOABuilder<S> setMaxEvaluations(int maxEvaluations)
setMutationOperator
public SMSEMOABuilder<S> setMutationOperator(MutationOperator<S> mutation)
setOffset
public SMSEMOABuilder<S> setOffset(double offset)
setPopulationSize
public SMSEMOABuilder<S> setPopulationSize(int populationSize)
setSelectionOperator
public SMSEMOABuilder<S> setSelectionOperator(SelectionOperator<List<S>, S> selection)

SMSEMOAIT

public class SMSEMOAIT
Fields
algorithm
Algorithm<List<DoubleSolution>> algorithm
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheHypervolumeHaveAMinimumValue
public void shouldTheHypervolumeHaveAMinimumValue()

org.uma.jmetal.algorithm.multiobjective.spea2

SPEA2

public class SPEA2<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, List<S>>
Author:Juan J. Durillo
Fields
archive
protected List<S> archive
environmentalSelection
protected final EnvironmentalSelection<S> environmentalSelection
evaluator
protected final SolutionListEvaluator<S> evaluator
iterations
protected int iterations
maxIterations
protected final int maxIterations
strenghtRawFitness
protected final StrengthRawFitness<S> strenghtRawFitness
Constructors
SPEA2
public SPEA2(Problem<S> problem, int maxIterations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator)
Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

SPEA2Builder

public class SPEA2Builder<S extends Solution<?>> implements AlgorithmBuilder<SPEA2<S>>
Author:Juan J. Durillo
Fields
crossoverOperator
protected CrossoverOperator<S> crossoverOperator
evaluator
protected SolutionListEvaluator<S> evaluator
maxIterations
protected int maxIterations
mutationOperator
protected MutationOperator<S> mutationOperator
populationSize
protected int populationSize
problem
protected final Problem<S> problem

SPEA2Builder class

selectionOperator
protected SelectionOperator<List<S>, S> selectionOperator
Constructors
SPEA2Builder
public SPEA2Builder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)

SPEA2Builder constructor

Methods
build
public SPEA2<S> build()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getMaxIterations
public int getMaxIterations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
getSolutionListEvaluator
public SolutionListEvaluator<S> getSolutionListEvaluator()
setMaxIterations
public SPEA2Builder<S> setMaxIterations(int maxIterations)
setPopulationSize
public SPEA2Builder<S> setPopulationSize(int populationSize)
setSelectionOperator
public SPEA2Builder<S> setSelectionOperator(SelectionOperator<List<S>, S> selectionOperator)
setSolutionListEvaluator
public SPEA2Builder<S> setSolutionListEvaluator(SolutionListEvaluator<S> evaluator)

org.uma.jmetal.algorithm.multiobjective.spea2.util

EnvironmentalSelection

public class EnvironmentalSelection<S extends Solution<?>> implements SelectionOperator<List<S>, List<S>>
Author:

Juanjo Durillo

Parameters:
  • <S>
Constructors
EnvironmentalSelection
public EnvironmentalSelection(int solutionsToSelect)
Methods
execute
public List<S> execute(List<S> source2)

org.uma.jmetal.algorithm.multiobjective.wasfga

WASFGA

public class WASFGA<S extends Solution<?>> extends AbstractMOMBI<S> implements InteractiveAlgorithm<S, List<S>>

Implementation of the preference based algorithm named WASF-GA on jMetal5.0

Author:Juanjo Durillo This algorithm is described in the paper: A.B. Ruiz, R. Saborido, M. Luque “A Preference-based Evolutionary Algorithm for Multiobjective Optimization: The Weighting Achievement Scalarizing Function Genetic Algorithm”. Journal of Global Optimization. May 2015, Volume 62, Issue 1, pp 101-129 DOI = {10.1007/s10898-014-0214-y}
Fields
epsilon
protected double epsilon
evaluations
protected int evaluations
maxEvaluations
protected int maxEvaluations
weights
protected double[][] weights
Constructors
WASFGA
public WASFGA(Problem<S> problem, int populationSize, int maxIterations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator, double epsilon, List<Double> referencePoint, String weightVectorsFileName)

Constructor

Parameters:
  • problem – Problem to solve
WASFGA
public WASFGA(Problem<S> problem, int populationSize, int maxIterations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator, double epsilon, List<Double> referencePoint)

Constructor

Parameters:
  • problem – Problem to solve
Methods
addLastRankedSolutionsToPopulation
protected void addLastRankedSolutionsToPopulation(Ranking<S> ranking, int index, List<S> population)
addRankedSolutionsToPopulation
protected void addRankedSolutionsToPopulation(Ranking<S> ranking, int index, List<S> population)
computeRanking
protected Ranking<S> computeRanking(List<S> solutionList)
createUtilityFunction
public AbstractUtilityFunctionsSet<S> createUtilityFunction()
getDescription
public String getDescription()
getName
public String getName()
getNonDominatedSolutions
protected List<S> getNonDominatedSolutions(List<S> solutionList)
getPopulationSize
public int getPopulationSize()
getResult
public List<S> getResult()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
selectBest
protected List<S> selectBest(Ranking<S> ranking)
specificMOEAComputations
public void specificMOEAComputations()
updatePointOfInterest
public void updatePointOfInterest(List<Double> newPointOfInterest)

WASFGAIT

public class WASFGAIT
Methods
shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem
public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem()
shouldTheAlgorithmReturnAnExceptionIfIndicatingANonExistingWeightVectorFile
public void shouldTheAlgorithmReturnAnExceptionIfIndicatingANonExistingWeightVectorFile()
shouldTheHypervolumeHaveAMininumValue
public void shouldTheHypervolumeHaveAMininumValue()

WASFGAMeasures

public class WASFGAMeasures<S extends Solution<?>> extends WASFGA<S> implements Measurable

Implementation of the preference based algorithm named WASF-GA on jMetal5.0

Author:Jorge Rodriguez
Fields
durationMeasure
protected DurationMeasure durationMeasure
iterations
protected CountingMeasure iterations
measureManager
protected SimpleMeasureManager measureManager
solutionListMeasure
protected BasicMeasure<List<S>> solutionListMeasure
Constructors
WASFGAMeasures
public WASFGAMeasures(Problem<S> problem, int populationSize, int maxIterations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator, double epsilon, List<Double> referencePoint, String weightVectorsFileName)

Constructor

Parameters:
  • problem – Problem to solve
WASFGAMeasures
public WASFGAMeasures(Problem<S> problem, int populationSize, int maxIterations, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator, double epsilon, List<Double> referencePoint)

Constructor

Parameters:
  • problem – Problem to solve
Methods
getDescription
public String getDescription()
getMeasureManager
public MeasureManager getMeasureManager()
getName
public String getName()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
run
public void run()
updateProgress
protected void updateProgress()

org.uma.jmetal.algorithm.multiobjective.wasfga.util

WASFGARanking

public class WASFGARanking<S extends Solution<?>> extends GenericSolutionAttribute<S, Integer> implements Ranking<S>
Author:Rubén Saborido Implementation of the ranking procedure for the preference based algorithm named WASF-GA on jMetal5.0 It classifies solutions into different fronts. If the problem contains constraints, after feasible solutions it classifies the unfeasible solutions into fronts: - Each unfeasible solutions goes into a different front. - Unfeasible solutions with lower number of violated constraints are preferred. - If two solutions have equal number of violated constraints it compares the overall constraint values. - If two solutions have equal overall constraint values it compares de values of the utility function.
Constructors
WASFGARanking
public WASFGARanking(AbstractUtilityFunctionsSet<S> utilityFunctions)
Methods
computeRanking
public Ranking<S> computeRanking(List<S> population)
getNumberOfSubfronts
public int getNumberOfSubfronts()
getSubfront
public List<S> getSubfront(int rank)
getUtilityFunctions
public AbstractUtilityFunctionsSet<S> getUtilityFunctions()
rankUnfeasibleSolutions
protected int[] rankUnfeasibleSolutions(List<S> population)

Obtain the rank of each solution in a list of unfeasible solutions

Parameters:
  • population – List of unfeasible solutions
Returns:

The rank of each unfeasible solutions

WeightVectors

public class WeightVectors
Author:Rubén Saborido Infantes This class offers different methods to manipulate weight vectors.
Methods
initializeUniformlyInTwoDimensions
public static double[][] initializeUniformlyInTwoDimensions(double epsilon, int numberOfWeights)

Generate uniform weight vectors in two dimension

Parameters:
  • epsilon – Distance between each component of the weight vector
  • numberOfWeights – Number of weight vectors to generate
Returns:

A set of weight vectors

invert
public static double[][] invert(double[][] weights, boolean normalize)

Calculate the inverse of a set of weight vectors

Parameters:
  • weights – A set of weight vectors
  • normalize – True if the weights should be normalize by the sum of the components
Returns:

A set of weight vectors

readFromFile
public static double[][] readFromFile(String filePath)

Read a set of weight vector from a file

Parameters:
  • filePath – A file containing the weight vectors
Returns:

A set of weight vectors

readFromResourcesInJMetal
public static double[][] readFromResourcesInJMetal(String filePath)

Read a set of weight vector from a file in the resources folder in jMetal

Parameters:
  • filePath – The name of file in the resources folder of jMetal
Returns:

A set of weight vectors

validate
public static boolean validate(double[][] weights, int numberOfComponents)

Validate if the number of components of all weight vectors has the expected dimensionality.

Parameters:
  • weights – Weight vectors to validate
  • numberOfComponents – Number of components each weight vector must have
Returns:

True if the weight vectors are correct, False if the weight vectors are incorrect

org.uma.jmetal.algorithm.singleobjective.coralreefsoptimization

CoralReefsOptimization

public class CoralReefsOptimization<S> extends AbstractCoralReefsOptimization<S, List<S>>
Author:Inacio Medeiros
Constructors
CoralReefsOptimization
public CoralReefsOptimization(Problem<S> problem, int maxEvaluations, Comparator<S> comparator, SelectionOperator<List<S>, S> selectionOperator, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, int n, int m, double rho, double fbs, double fa, double pd, int attemptsToSettle)
Methods
asexualReproduction
protected List<S> asexualReproduction(List<S> brooders)
createInitialPopulation
protected List<S> createInitialPopulation()
depredation
protected List<S> depredation(List<S> population, List<Coordinate> coordinates)
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
generateCoordinates
protected List<Coordinate> generateCoordinates()
getDescription
public String getDescription()
getName
public String getName()
getResult
public List<S> getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
larvaeSettlementPhase
protected List<S> larvaeSettlementPhase(List<S> larvae, List<S> population, List<Coordinate> coordinates)
selectBroadcastSpawners
protected List<S> selectBroadcastSpawners(List<S> population)
sexualReproduction
protected List<S> sexualReproduction(List<S> broadcastSpawners)
updateProgress
protected void updateProgress()

CoralReefsOptimizationBuilder

public class CoralReefsOptimizationBuilder<S extends Solution<?>> implements AlgorithmBuilder<CoralReefsOptimization<S>>
Author:Inacio Medeiros
Constructors
CoralReefsOptimizationBuilder
public CoralReefsOptimizationBuilder(Problem<S> problem, SelectionOperator<List<S>, S> selectionOperator, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)

CoralReefsOptimizationBuilder constructor

Methods
build
public CoralReefsOptimization<S> build()
getAttemptsToSettle
public int getAttemptsToSettle()
getComparator
public Comparator<S> getComparator()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getFa
public double getFa()
getFbr
public double getFbr()
getFbs
public double getFbs()
getFd
public double getFd()
getM
public int getM()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getN
public int getN()
getPd
public double getPd()
getProblem
public Problem<S> getProblem()
getRho
public double getRho()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
setAttemptsToSettle
public CoralReefsOptimizationBuilder<S> setAttemptsToSettle(int attemptsToSettle)
setComparator
public CoralReefsOptimizationBuilder<S> setComparator(Comparator<S> comparator)
setFa
public CoralReefsOptimizationBuilder<S> setFa(double fa)
setFbr
public CoralReefsOptimizationBuilder<S> setFbr(double fbr)
setFbs
public CoralReefsOptimizationBuilder<S> setFbs(double fbs)
setFd
public CoralReefsOptimizationBuilder<S> setFd(double fd)
setM
public CoralReefsOptimizationBuilder<S> setM(int m)
setMaxEvaluations
public CoralReefsOptimizationBuilder<S> setMaxEvaluations(int maxEvaluations)
setN
public CoralReefsOptimizationBuilder<S> setN(int n)
setPd
public CoralReefsOptimizationBuilder<S> setPd(double pd)
setRho
public CoralReefsOptimizationBuilder<S> setRho(double rho)

org.uma.jmetal.algorithm.singleobjective.differentialevolution

DifferentialEvolution

public class DifferentialEvolution extends AbstractDifferentialEvolution<DoubleSolution>

This class implements a differential evolution algorithm.

Author:Antonio J. Nebro
Constructors
DifferentialEvolution
public DifferentialEvolution(DoubleProblem problem, int maxEvaluations, int populationSize, DifferentialEvolutionCrossover crossoverOperator, DifferentialEvolutionSelection selectionOperator, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Parameters:
  • problem – Problem to solve
  • maxEvaluations – Maximum number of evaluations to perform
  • populationSize
  • crossoverOperator
  • selectionOperator
  • evaluator
Methods
createInitialPopulation
protected List<DoubleSolution> createInitialPopulation()
evaluatePopulation
protected List<DoubleSolution> evaluatePopulation(List<DoubleSolution> population)
getDescription
public String getDescription()
getEvaluations
public int getEvaluations()
getName
public String getName()
getResult
public DoubleSolution getResult()

Returns the best individual

initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<DoubleSolution> replacement(List<DoubleSolution> population, List<DoubleSolution> offspringPopulation)
reproduction
protected List<DoubleSolution> reproduction(List<DoubleSolution> matingPopulation)
selection
protected List<DoubleSolution> selection(List<DoubleSolution> population)
setEvaluations
public void setEvaluations(int evaluations)
updateProgress
protected void updateProgress()

DifferentialEvolutionBuilder

public class DifferentialEvolutionBuilder

DifferentialEvolutionBuilder class

Author:Antonio J. Nebro
Constructors
DifferentialEvolutionBuilder
public DifferentialEvolutionBuilder(DoubleProblem problem)
Methods
build
public DifferentialEvolution build()
getCrossoverOperator
public DifferentialEvolutionCrossover getCrossoverOperator()
getMaxEvaluations
public int getMaxEvaluations()
getPopulationSize
public int getPopulationSize()
getProblem
public DoubleProblem getProblem()
getSelectionOperator
public DifferentialEvolutionSelection getSelectionOperator()
getSolutionListEvaluator
public SolutionListEvaluator<DoubleSolution> getSolutionListEvaluator()
setCrossover
public DifferentialEvolutionBuilder setCrossover(DifferentialEvolutionCrossover crossover)
setMaxEvaluations
public DifferentialEvolutionBuilder setMaxEvaluations(int maxEvaluations)
setPopulationSize
public DifferentialEvolutionBuilder setPopulationSize(int populationSize)
setSelection
public DifferentialEvolutionBuilder setSelection(DifferentialEvolutionSelection selection)
setSolutionListEvaluator
public DifferentialEvolutionBuilder setSolutionListEvaluator(SolutionListEvaluator<DoubleSolution> evaluator)

DifferentialEvolutionBuilderTest

public class DifferentialEvolutionBuilderTest

Created by ajnebro on 25/11/14.

Methods
buildAlgorithm
public void buildAlgorithm()
cleanup
public void cleanup()
getProblem
public void getProblem()
setNegativeMaxNumberOfEvaluations
public void setNegativeMaxNumberOfEvaluations()
setNegativePopulationSize
public void setNegativePopulationSize()
setNewCrossoverOperator
public void setNewCrossoverOperator()
setNewEvaluator
public void setNewEvaluator()
setNewSelectionOperator
public void setNewSelectionOperator()
setPositiveMaxNumberOfEvaluations
public void setPositiveMaxNumberOfEvaluations()
setValidPopulationSize
public void setValidPopulationSize()
startup
public void startup()
testDefaultConfiguration
public void testDefaultConfiguration()

DifferentialEvolutionTestIT

public class DifferentialEvolutionTestIT

Created by Antonio J. Nebro on 25/11/14.

Methods
shouldCreateInitialPopulationWhenPopulationSizeIsBiggerThanZero
public void shouldCreateInitialPopulationWhenPopulationSizeIsBiggerThanZero()
shouldCreateInitialPopulationWhenPopulationSizeIsZero
public void shouldCreateInitialPopulationWhenPopulationSizeIsZero()
shouldEvaluatePopulation
public void shouldEvaluatePopulation()
shouldGetEvaluations
public void shouldGetEvaluations()
shouldGetResultReturnsThenReturnTheBestIndividual
public void shouldGetResultReturnsThenReturnTheBestIndividual()
shouldInitProgress
public void shouldInitProgress()
shouldIsStoppingConditionReachedWhenEvaluationsBiggerThenMaxEvaluations
public void shouldIsStoppingConditionReachedWhenEvaluationsBiggerThenMaxEvaluations()
shouldIsStoppingConditionReachedWhenEvaluationsEqualToMaxEvaluations
public void shouldIsStoppingConditionReachedWhenEvaluationsEqualToMaxEvaluations()
shouldIsStoppingConditionReachedWhenEvaluationsLesserThanMaxEvaluations
public void shouldIsStoppingConditionReachedWhenEvaluationsLesserThanMaxEvaluations()
shouldReplacemen2t
public void shouldReplacemen2t()
shouldReproduction
public void shouldReproduction()
shouldSelection
public void shouldSelection()
shouldSetEvaluations
public void shouldSetEvaluations()
shouldUpdateProgressWhenAnyIteration
public void shouldUpdateProgressWhenAnyIteration()
shouldUpdateProgressWhenFirstIteration
public void shouldUpdateProgressWhenFirstIteration()
startup
public void startup()

org.uma.jmetal.algorithm.singleobjective.evolutionstrategy

CovarianceMatrixAdaptationEvolutionStrategy

public class CovarianceMatrixAdaptationEvolutionStrategy extends AbstractEvolutionStrategy<DoubleSolution, DoubleSolution>

Class implementing the CMA-ES algorithm

Methods
createInitialPopulation
protected List<DoubleSolution> createInitialPopulation()
evaluatePopulation
protected List<DoubleSolution> evaluatePopulation(List<DoubleSolution> population)
getDescription
public String getDescription()
getLambda
public int getLambda()
getMaxEvaluations
public int getMaxEvaluations()
getName
public String getName()
getResult
public DoubleSolution getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<DoubleSolution> replacement(List<DoubleSolution> population, List<DoubleSolution> offspringPopulation)
reproduction
protected List<DoubleSolution> reproduction(List<DoubleSolution> population)
selection
protected List<DoubleSolution> selection(List<DoubleSolution> population)
updateProgress
protected void updateProgress()

CovarianceMatrixAdaptationEvolutionStrategy.Builder

public static class Builder

Buider class

Constructors
Builder
public Builder(DoubleProblem problem)
Methods
setLambda
public Builder setLambda(int lambda)
setMaxEvaluations
public Builder setMaxEvaluations(int maxEvaluations)
setSigma
public Builder setSigma(double sigma)
setTypicalX
public Builder setTypicalX(double[] typicalX)

ElitistEvolutionStrategy

public class ElitistEvolutionStrategy<S extends Solution<?>> extends AbstractEvolutionStrategy<S, S>

Class implementing a (mu + lambda) Evolution Strategy (lambda must be divisible by mu)

Author:Antonio J. Nebro
Constructors
ElitistEvolutionStrategy
public ElitistEvolutionStrategy(Problem<S> problem, int mu, int lambda, int maxEvaluations, MutationOperator<S> mutation)

Constructor

Methods
createInitialPopulation
protected List<S> createInitialPopulation()
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public S getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

EvolutionStrategyBuilder

public class EvolutionStrategyBuilder<S extends Solution<?>> implements AlgorithmBuilder<Algorithm<S>>

Class implementing a (mu , lambda) Evolution Strategy (lambda must be divisible by mu)

Author:Antonio J. Nebro
Constructors
EvolutionStrategyBuilder
public EvolutionStrategyBuilder(Problem<S> problem, MutationOperator<S> mutationOperator, EvolutionStrategyVariant variant)
Methods
build
public Algorithm<S> build()
getLambda
public int getLambda()
getMaxEvaluations
public int getMaxEvaluations()
getMu
public int getMu()
getMutation
public MutationOperator<S> getMutation()
setLambda
public EvolutionStrategyBuilder<S> setLambda(int lambda)
setMaxEvaluations
public EvolutionStrategyBuilder<S> setMaxEvaluations(int maxEvaluations)
setMu
public EvolutionStrategyBuilder<S> setMu(int mu)

EvolutionStrategyBuilder.EvolutionStrategyVariant

public enum EvolutionStrategyVariant
Enum Constants
ELITIST
public static final EvolutionStrategyBuilder.EvolutionStrategyVariant ELITIST
NON_ELITIST
public static final EvolutionStrategyBuilder.EvolutionStrategyVariant NON_ELITIST

NonElitistEvolutionStrategy

public class NonElitistEvolutionStrategy<S extends Solution<?>> extends AbstractEvolutionStrategy<S, S>

Class implementing a (mu + lambda) Evolution Strategy (lambda must be divisible by mu)

Author:Antonio J. Nebro
Constructors
NonElitistEvolutionStrategy
public NonElitistEvolutionStrategy(Problem<S> problem, int mu, int lambda, int maxEvaluations, MutationOperator<S> mutation)

Constructor

Methods
createInitialPopulation
protected List<S> createInitialPopulation()
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public S getResult()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> population)
selection
protected List<S> selection(List<S> population)
updateProgress
protected void updateProgress()

org.uma.jmetal.algorithm.singleobjective.evolutionstrategy.util

CMAESUtils

public class CMAESUtils
Methods
checkEigenSystem
public static int checkEigenSystem(int n, double[][] c, double[] diag, double[][] q)
norm
public static double norm(double[] vector)
tql2
public static void tql2(int n, double[] d, double[] e, double[][] v)
tred2
public static void tred2(int n, double[][] v, double[] d, double[] e)

org.uma.jmetal.algorithm.singleobjective.geneticalgorithm

GenerationalGeneticAlgorithm

public class GenerationalGeneticAlgorithm<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, S>
Author:Antonio J. Nebro
Constructors
GenerationalGeneticAlgorithm
public GenerationalGeneticAlgorithm(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator, SolutionListEvaluator<S> evaluator)

Constructor

Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public S getResult()
initProgress
public void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
updateProgress
public void updateProgress()

GenerationalGeneticAlgorithmTestIT

public class GenerationalGeneticAlgorithmTestIT

Created by ajnebro on 27/10/15.

Methods
shouldTheAlgorithmReturnTheCorrectSolutionWhenSolvingProblemOneMax
public void shouldTheAlgorithmReturnTheCorrectSolutionWhenSolvingProblemOneMax()

GeneticAlgorithmBuilder

public class GeneticAlgorithmBuilder<S extends Solution<?>>

Created by ajnebro on 10/12/14.

Constructors
GeneticAlgorithmBuilder
public GeneticAlgorithmBuilder(Problem<S> problem, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator)

Builder constructor

Methods
build
public Algorithm<S> build()
getCrossoverOperator
public CrossoverOperator<S> getCrossoverOperator()
getEvaluator
public SolutionListEvaluator<S> getEvaluator()
getMaxEvaluations
public int getMaxEvaluations()
getMutationOperator
public MutationOperator<S> getMutationOperator()
getPopulationSize
public int getPopulationSize()
getProblem
public Problem<S> getProblem()
getSelectionOperator
public SelectionOperator<List<S>, S> getSelectionOperator()
getVariant
public GeneticAlgorithmVariant getVariant()
setMaxEvaluations
public GeneticAlgorithmBuilder<S> setMaxEvaluations(int maxEvaluations)
setPopulationSize
public GeneticAlgorithmBuilder<S> setPopulationSize(int populationSize)
setSelectionOperator
public GeneticAlgorithmBuilder<S> setSelectionOperator(SelectionOperator<List<S>, S> selectionOperator)
setSolutionListEvaluator
public GeneticAlgorithmBuilder<S> setSolutionListEvaluator(SolutionListEvaluator<S> evaluator)
setVariant
public GeneticAlgorithmBuilder<S> setVariant(GeneticAlgorithmVariant variant)

GeneticAlgorithmBuilder.GeneticAlgorithmVariant

public enum GeneticAlgorithmVariant
Enum Constants
GENERATIONAL
public static final GeneticAlgorithmBuilder.GeneticAlgorithmVariant GENERATIONAL
STEADY_STATE
public static final GeneticAlgorithmBuilder.GeneticAlgorithmVariant STEADY_STATE

SteadyStateGeneticAlgorithm

public class SteadyStateGeneticAlgorithm<S extends Solution<?>> extends AbstractGeneticAlgorithm<S, S>
Author:Antonio J. Nebro
Constructors
SteadyStateGeneticAlgorithm
public SteadyStateGeneticAlgorithm(Problem<S> problem, int maxEvaluations, int populationSize, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, SelectionOperator<List<S>, S> selectionOperator)

Constructor

Methods
evaluatePopulation
protected List<S> evaluatePopulation(List<S> population)
getDescription
public String getDescription()
getName
public String getName()
getResult
public S getResult()
initProgress
public void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
replacement
protected List<S> replacement(List<S> population, List<S> offspringPopulation)
reproduction
protected List<S> reproduction(List<S> matingPopulation)
selection
protected List<S> selection(List<S> population)
updateProgress
public void updateProgress()

SteadyStateGeneticAlgorithmTestIT

public class SteadyStateGeneticAlgorithmTestIT

Created by ajnebro on 27/10/15.

Methods
shouldTheAlgorithmReturnTheCorrectSolutionWhenSolvingProblemOneMax
public void shouldTheAlgorithmReturnTheCorrectSolutionWhenSolvingProblemOneMax()

org.uma.jmetal.algorithm.singleobjective.particleswarmoptimization

StandardPSO2007

public class StandardPSO2007 extends AbstractParticleSwarmOptimization<DoubleSolution, DoubleSolution>

Class implementing a Standard PSO 2007 algorithm.

Author:Antonio J. Nebro
Constructors
StandardPSO2007
public StandardPSO2007(DoubleProblem problem, int objectiveId, int swarmSize, int maxIterations, int numberOfParticlesToInform, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Parameters:
  • problem
  • objectiveId – This field indicates which objective, in the case of a multi-objective problem, is selected to be optimized.
  • swarmSize
  • maxIterations
  • numberOfParticlesToInform
  • evaluator
StandardPSO2007
public StandardPSO2007(DoubleProblem problem, int swarmSize, int maxIterations, int numberOfParticlesToInform, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Parameters:
  • problem
  • swarmSize
  • maxIterations
  • numberOfParticlesToInform
  • evaluator
Methods
createInitialSwarm
public List<DoubleSolution> createInitialSwarm()
evaluateSwarm
public List<DoubleSolution> evaluateSwarm(List<DoubleSolution> swarm)
getDescription
public String getDescription()
getLocalBest
public DoubleSolution[] getLocalBest()
getName
public String getName()
getResult
public DoubleSolution getResult()
getSwarmSpeedMatrix
public double[][] getSwarmSpeedMatrix()
initProgress
public void initProgress()
initializeLeader
public void initializeLeader(List<DoubleSolution> swarm)
initializeParticlesMemory
public void initializeParticlesMemory(List<DoubleSolution> swarm)
initializeVelocity
public void initializeVelocity(List<DoubleSolution> swarm)
isStoppingConditionReached
public boolean isStoppingConditionReached()
perturbation
public void perturbation(List<DoubleSolution> swarm)
updateLeaders
public void updateLeaders(List<DoubleSolution> swarm)
updateParticlesMemory
public void updateParticlesMemory(List<DoubleSolution> swarm)
updatePosition
public void updatePosition(List<DoubleSolution> swarm)
updateProgress
public void updateProgress()
updateVelocity
public void updateVelocity(List<DoubleSolution> swarm)

StandardPSO2011

public class StandardPSO2011 extends AbstractParticleSwarmOptimization<DoubleSolution, DoubleSolution>

Class implementing a Standard PSO 2011 algorithm.

Author:Antonio J. Nebro
Constructors
StandardPSO2011
public StandardPSO2011(DoubleProblem problem, int objectiveId, int swarmSize, int maxIterations, int numberOfParticlesToInform, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Parameters:
  • problem
  • objectiveId – This field indicates which objective, in the case of a multi-objective problem, is selected to be optimized.
  • swarmSize
  • maxIterations
  • numberOfParticlesToInform
  • evaluator
StandardPSO2011
public StandardPSO2011(DoubleProblem problem, int swarmSize, int maxIterations, int numberOfParticlesToInform, SolutionListEvaluator<DoubleSolution> evaluator)

Constructor

Parameters:
  • problem
  • swarmSize
  • maxIterations
  • numberOfParticlesToInform
  • evaluator
Methods
createInitialSwarm
public List<DoubleSolution> createInitialSwarm()
evaluateSwarm
public List<DoubleSolution> evaluateSwarm(List<DoubleSolution> swarm)
getDescription
public String getDescription()
getLocalBest
public DoubleSolution[] getLocalBest()
getName
public String getName()
getResult
public DoubleSolution getResult()
getSwarmSpeedMatrix
public double[][] getSwarmSpeedMatrix()
initProgress
public void initProgress()
initializeLeader
public void initializeLeader(List<DoubleSolution> swarm)
initializeParticlesMemory
public void initializeParticlesMemory(List<DoubleSolution> swarm)
initializeVelocity
public void initializeVelocity(List<DoubleSolution> swarm)
isStoppingConditionReached
public boolean isStoppingConditionReached()
perturbation
public void perturbation(List<DoubleSolution> swarm)
updateLeaders
public void updateLeaders(List<DoubleSolution> swarm)
updateParticlesMemory
public void updateParticlesMemory(List<DoubleSolution> swarm)
updatePosition
public void updatePosition(List<DoubleSolution> swarm)
updateProgress
public void updateProgress()
updateVelocity
public void updateVelocity(List<DoubleSolution> swarm)

org.uma.jmetal.experiment

BinaryProblemsStudy

public class BinaryProblemsStudy

Example of experimental study based on solving two binary problems with four algorithms: NSGAII, SPEA2, MOCell, and MOCHC This experiment assumes that the reference Pareto front are not known, so the must be produced. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Generate the reference Pareto fronts 4. Compute que quality indicators 5. Generate Latex tables reporting means and medians 6. Generate Latex tables with the result of applying the Wilcoxon Rank Sum Test 7. Generate Latex tables with the ranking obtained by applying the Friedman test 8. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<BinarySolution, List<BinarySolution>>> configureAlgorithmList(List<ExperimentProblem<BinarySolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm.

main
public static void main(String[] args)

ConstraintProblemsStudy

public class ConstraintProblemsStudy

Example of experimental study based on solving the unconstrained problems included in jMetal. This experiment assumes that the reference Pareto front are known and that, given a problem named P, there is a corresponding file called P.pf containing its corresponding Pareto front. If this is not the case, please refer to class DTLZStudy to see an example of how to explicitly indicate the name of those files. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Generate the reference Pareto fronts 4. Compute the quality indicators 5. Generate Latex tables reporting means and medians 6. Generate Latex tables with the result of applying the Wilcoxon Rank Sum Test 7. Generate Latex tables with the ranking obtained by applying the Friedman test 8. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm. The ExperimentAlgorithm has an optional tag component, that can be set as it is shown in this example, where four variants of a same algorithm are defined.

main
public static void main(String[] args)

DTLZStudy

public class DTLZStudy

Example of experimental study based on solving the problems (configured with 3 objectives) with the algorithms NSGAII, SPEA2, and SMPSO This experiment assumes that the reference Pareto front are known and stored in files whose names are different from the default name expected for every problem. While the default would be “problem_name.pf” (e.g. DTLZ1.pf), the references are stored in files following the nomenclature “problem_name.3D.pf” (e.g. DTLZ1.3D.pf). This is indicated when creating the ExperimentProblem instance of each of the evaluated poblems by using the method changeReferenceFrontTo() Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Compute que quality indicators 4. Generate Latex tables reporting means and medians 5. Generate R scripts to produce latex tables with the result of applying the Wilcoxon Rank Sum Test 6. Generate Latex tables with the ranking obtained by applying the Friedman test 7. Generate R scripts to obtain boxplots

Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm.

main
public static void main(String[] args)

NSGAIIStudy

public class NSGAIIStudy

Example of experimental study based on solving the ZDT problems with four versions of NSGA-II, each of them applying a different crossover probability (from 0.7 to 1.0). This experiment assumes that the reference Pareto front are known and that, given a problem named P, there is a corresponding file called P.pf containing its corresponding Pareto front. If this is not the case, please refer to class DTLZStudy to see an example of how to explicitly indicate the name of those files. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Compute the quality indicators 4. Generate Latex tables reporting means and medians 5. Generate Latex tables with the result of applying the Wilcoxon Rank Sum Test 6. Generate Latex tables with the ranking obtained by applying the Friedman test 7. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm. The ExperimentAlgorithm has an optional tag component, that can be set as it is shown in this example, where four variants of a same algorithm are defined.

main
public static void main(String[] args)

NSGAIIStudy2

public class NSGAIIStudy2

Example of experimental study based on solving the ZDT problems with four versions of NSGA-II, each of them applying a different crossover probability (from 0.7 to 1.0). This experiment assumes that the reference Pareto front are not known, so the names of files containing them and the directory where they are located must be specified. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Generate the reference Pareto fronts 4. Compute the quality indicators 5. Generate Latex tables reporting means and medians 6. Generate Latex tables with the result of applying the Wilcoxon Rank Sum Test 7. Generate Latex tables with the ranking obtained by applying the Friedman test 8. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm. The ExperimentAlgorithm has an optional tag component, that can be set as it is shown in this example, where four variants of a same algorithm are defined.

main
public static void main(String[] args)

ZDTScalabilityIStudy

public class ZDTScalabilityIStudy

Example of experimental study based on solving the ZDT1 problem but using five different number of variables. This can be interesting to study the behaviour of the algorithms when solving an scalable problem (in the number of variables). The used algorithms are NSGA-II, SPEA2 and SMPSO. This experiment assumes that the reference Pareto front is of problem ZDT1 is known and that there is a file called ZDT1.pf containing it. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Generate the reference Pareto fronts 4. Compute the quality indicators 5. Generate Latex tables reporting means and medians 6. Generate Latex tables with the result of applying the Wilcoxon Rank Sum Test 7. Generate Latex tables with the ranking obtained by applying the Friedman test 8. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm. The ExperimentAlgorithm has an optional tag component, that can be set as it is shown in this example, where four variants of a same algorithm are defined.

main
public static void main(String[] args)

ZDTScalabilityIStudy2

public class ZDTScalabilityIStudy2

Example of experimental study based on solving the ZDT1 problem but using five different number of variables. This can be interesting to study the behaviour of the algorithms when solving an scalable problem (in the number of variables). The used algorithms are NSGA-II, SPEA2 and SMPSO. This experiment assumes that the reference Pareto front is of problem ZDT1 is not known, so a reference front must be obtained. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Generate the reference Pareto sets and Pareto fronts 4. Compute the quality indicators 5. Generate Latex tables reporting means and medians 6. Generate Latex tables with the result of applying the Wilcoxon Rank Sum Test 7. Generate Latex tables with the ranking obtained by applying the Friedman test 8. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm. The ExperimentAlgorithm has an optional tag component, that can be set as it is shown in this example, where four variants of a same algorithm are defined.

main
public static void main(String[] args)

ZDTStudy

public class ZDTStudy

Example of experimental study based on solving the ZDT problems with the algorithms NSGAII, MOEA/D, and SMPSO This experiment assumes that the reference Pareto front are known and that, given a problem named P, there is a corresponding file called P.pf containing its corresponding Pareto front. If this is not the case, please refer to class DTLZStudy to see an example of how to explicitly indicate the name of those files. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Compute que quality indicators 4. Generate Latex tables reporting means and medians 5. Generate R scripts to produce latex tables with the result of applying the Wilcoxon Rank Sum Test 6. Generate Latex tables with the ranking obtained by applying the Friedman test 7. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm.

main
public static void main(String[] args)

ZDTStudy2

public class ZDTStudy2

Example of experimental study based on solving the ZDT problems with algorithms NSGAII, MOEA/D, and SMPSO This experiment assumes that the reference Pareto front are not known, so the names of files containing them and the directory where they are located must be specified. Six quality indicators are used for performance assessment. The steps to carry out the experiment are: 1. Configure the experiment 2. Execute the algorithms 3. Generate the reference Pareto fronts 4. Compute que quality indicators 5. Generate Latex tables reporting means and medians 6. Generate Latex tables with the result of applying the Wilcoxon Rank Sum Test 7. Generate R scripts to obtain boxplots

Author:Antonio J. Nebro
Methods
configureAlgorithmList
static List<ExperimentAlgorithm<DoubleSolution, List<DoubleSolution>>> configureAlgorithmList(List<ExperimentProblem<DoubleSolution>> problemList)

The algorithm list is composed of pairs Algorithm + Problem which form part of a ExperimentAlgorithm, which is a decorator for class Algorithm.

main
public static void main(String[] args)

org.uma.jmetal.measure

Measurable

public interface Measurable

A Measurable entity is an entity which provides one or several Measures. To keep it simple, these Measures are provided through a MeasureManager.

Author:Created by Antonio J. Nebro on 21/10/14 based on the ideas of Matthieu Vergne
Methods
getMeasureManager
public MeasureManager getMeasureManager()
Returns:the MeasureManager which stores all the Measures supported by this Measurable entity

Measure

public interface Measure<Value> extends DescribedEntity, Serializable

A Measure aims at providing the Value of a specific property, typically of an Algorithm. In order to facilitate external uses, it implements the methods of DescribedEntity.

Author:

Created by Antonio J. Nebro on 21/10/14 based on the ideas of Matthieu Vergne

Parameters:
  • <Value> – the type of value the Measure can provide

MeasureListener

public interface MeasureListener<Value>

A MeasureListener allows to register a given behavior to PushMeasure.register(MeasureListener). When the PushMeasure generate a Value, it is provided to MeasureListener.measureGenerated(Object) in order to execute the specified behavior.

Author:

Created by Antonio J. Nebro on 21/10/14 based on the ideas of Matthieu Vergne

Parameters:
  • <Value>
Methods
measureGenerated
public void measureGenerated(Value value)
Parameters:

MeasureManager

public interface MeasureManager

A MeasureManager aims at managing a set of Measures. Typically, a Measurable entity would create a single MeasureManager to store all the Measures it would like to support, each of them being identified by a key. Because a Measure can be whether a PullMeasure or a PushMeasure, the two methods getPullMeasure(Object) and getPushMeasure(Object) are provided. It could be that a single Measure is also available through both (via a single instance implementing both interfaces or two different instances implementing each interface), leading to have both methods returning a non-null value for the same key.

Author:Created by Antonio J. Nebro on 21/10/14 based on the ideas of Matthieu Vergne
Methods
getMeasureKeys
public Collection<Object> getMeasureKeys()

This method should return all the keys identifying the Measures managed by this MeasureManager. More precisely, if getPullMeasure(Object) or getPushMeasure(Object) returns a non-null value for a given key, then this key should be returned by getMeasureKeys(). However, it is not because a key is returned by getMeasureKeys() that it necessarily has a PullMeasure or a PushMeasure returned by this MeasureManager.

Returns:the set of keys identifying the managed Measures
getPullMeasure
public <T> PullMeasure<T> getPullMeasure(Object key)
Parameters:
Returns:

the PullMeasure identified by this key

getPushMeasure
public <T> PushMeasure<T> getPushMeasure(Object key)
Parameters:
Returns:

the PushMeasure identified by this key

PullMeasure

public interface PullMeasure<Value> extends Measure<Value>

A PullMeasure is a Measure from which the Value can be accessed on demand through the get() method. As such, a PullMeasure should ensure that its current Value is always available or generated before to be returned by get().

Author:

Created by Antonio J. Nebro on 21/10/14 based on the ideas of Matthieu Vergne

Parameters:
  • <Value> – the type of value the PullMeasure can provide
Methods
get
public Value get()
Returns:the current Value of the Measure

PushMeasure

public interface PushMeasure<Value> extends Measure<Value>

A PushMeasure is a Measure which provides its Value through notifications. As such, any observer on a PushMeasure should register a MeasureListener through register(MeasureListener) to specify what to do with the Value once it is received.

Author:

Created by Antonio J. Nebro on 21/10/14 based on the ideas of Matthieu Vergne

Parameters:
  • <Value> – the type of value the PushMeasure can provide
Methods
register
public void register(MeasureListener<Value> listener)

Register a MeasureListener to use the Values of the PushMeasure when they are generated.

Parameters:
unregister
public void unregister(MeasureListener<Value> listener)

Unregister a MeasureListener registered with register(MeasureListener) to stop receiving the notifications of the PushMeasure.

Parameters:

org.uma.jmetal.measure.impl

BasicMeasure

public class BasicMeasure<T> extends SimplePushMeasure<T> implements PullMeasure<T>, PushMeasure<T>

A BasicMeasure provides a simple way to define a measure that merely stores a single value

Author:Antonio J. Nebro
Constructors
BasicMeasure
public BasicMeasure()

Create a BasicMeasure

Methods
get
public synchronized T get()
Returns:the current value
push
public void push(T value)
set
public synchronized void set(T value)
Parameters:
  • value – The value to be stored

CountingMeasure

public class CountingMeasure extends SimplePushMeasure<Long> implements PullMeasure<Long>, PushMeasure<Long>

A CountingMeasure provides a simple way to evaluate a number of occurrences. For instance, it can be used to count how many solutions have been generated within an algorithm, how many evaluations have been computed, how many rounds have been run, etc. If these occurrences are provided by some PushMeasures, you can use link(PushMeasure) to register the CountingMeasure to these PushMeasures. Otherwise, use increment() when the CountingMeasure need to count one more occurrence. In order to get the count, one can access it immediately through get() or when it is updated by registering a listener with register(MeasureListener).

Author:Matthieu Vergne
Fields
count
long count

The current amount of occurrences counted.

Constructors
CountingMeasure
public CountingMeasure(String name, String description, long initialCount)

Create a CountingMeasure which starts at a given value. The next value to be pushed to the registered observers will be this value + 1.

Parameters:
  • name – the name of the measure
  • description – the description of the measure
  • initialCount – the value to start from
CountingMeasure
public CountingMeasure(String name, String description)

Create a CountingMeasure starting from zero. The registered observers will receive their first notification when it will increment to 1.

Parameters:
  • name – the name of the measure
  • description – the description of the measure
CountingMeasure
public CountingMeasure(long initialCount)

Create a CountingMeasure which starts at a given value. The next value to be pushed to the registered observers will be this value + 1. A default name and description are used.

Parameters:
  • initialCount – the value to start from
CountingMeasure
public CountingMeasure()

Create a CountingMeasure starting from zero. The registered observers will receive their first notification when it will increment to 1. A default name and description are used.

Methods
finalize
protected void finalize()
get
public synchronized Long get()
Returns:the current amount of occurrences counted
increment
public synchronized void increment()

Add 1 to the current count and push its value to all the registered observers.

increment
public synchronized void increment(long amount)

Increment the current count in a given amount. If the amount is zero, no change occurs, thus no notification is sent.

Parameters:
  • amount – the amount to add
reset
public synchronized void reset()

Restart the counter to zero. Generate a notification if the value was not zero.

reset
public synchronized void reset(long value)

Restart the counter to a given value. Generate a notification if the value was different.

Parameters:
  • value – the value to restart from

CountingMeasureTest

public class CountingMeasureTest
Methods
testGetAlignedWithNotifications
public void testGetAlignedWithNotifications()
testIncrementAddOne
public void testIncrementAddOne()
testIncrementNotificationsOccur
public void testIncrementNotificationsOccur()
testIncrementNotificationsOccurIfNonZero
public void testIncrementNotificationsOccurIfNonZero()
testLinkedMeasureCorrectlyCounted
public void testLinkedMeasureCorrectlyCounted()
testMultipleLinkedMeasuresCorrectlyCounted
public void testMultipleLinkedMeasuresCorrectlyCounted()
testMultipleLinksOnTheSameMeasureCountedOnce
public void testMultipleLinksOnTheSameMeasureCountedOnce()
testReset
public void testReset()
testResetNotificationsOccur
public void testResetNotificationsOccur()
testResetToAGivenValue
public void testResetToAGivenValue()
testUnlinkCorrectlyIgnored
public void testUnlinkCorrectlyIgnored()

DurationMeasure

public class DurationMeasure extends SimplePullMeasure<Long>

This measure allows to have a simple way to compute the time spent in doing something. For instance, an algorithm can compute the time spent to run. In such a case, the algorithm would call start() at the beginning of the running and stop() at the end. Additional calls to these two methods can also be made during the running to exclude specific parts from the counting. At any time during (and after) the running, the get() method can be used to know how much time have been spent so far. If the algorithm is rerun, it will restart and the additional time will sum up to the time already spent before, but it can be avoided by resetting the measure with reset().

Author:Matthieu Vergne
Constructors
DurationMeasure
public DurationMeasure()
Methods
get
public Long get()
Returns:the total time spent so far
reset
public void reset()

Reset the total time to zero. If a round is currently running, it is restarted.

start
public void start()

Start a round. If the round is already started, it has no effect.

stop
public void stop()

Stop a round. If the round is already stopped, it has no effect.

DurationMeasureTest

public class DurationMeasureTest
Methods
testDoNotEvolveBetweenStopAndRestart
public void testDoNotEvolveBetweenStopAndRestart()
testIncreasesBetweenStartAndStop
public void testIncreasesBetweenStartAndStop()
testNoRunningRemainsAtZero
public void testNoRunningRemainsAtZero()
testResetGoBackToZeroWhenStopped
public void testResetGoBackToZeroWhenStopped()
testResetRestartFromZeroWhenRunning
public void testResetRestartFromZeroWhenRunning()

LastEvaluationMeasure

public class LastEvaluationMeasure<Solution, Value> extends SimplePushMeasure<Evaluation<Solution, Value>>

LastEvaluationMeasure is a PushMeasure providing the last evaluation made in an algorithm. It extends SimplePushMeasure and add the method push(Object,Object) for simplicity.

Author:

Matthieu Vergne

Parameters:
  • <Solution> – the solution evaluated
  • <Value> – the type of value used to evaluate the solution (Double, BigDecimal, enum, …)
Constructors
LastEvaluationMeasure
public LastEvaluationMeasure()
Methods
push
public void push(Solution solution, Value value)

This method is equivalent to push(Object) excepted that it automatically create the Evaluation instance.

Parameters:
  • solution – the solution evaluated
  • value – the value of this solution

LastEvaluationMeasure.Evaluation

public static class Evaluation<Solution, Value>

This structure represent an atomic evaluation of a given solution.

Author:Matthieu Vergne
Fields
solution
Solution solution

The solution evaluated.

value
Value value

The evaluation of the solution.

LastEvaluationMeasureTest

public class LastEvaluationMeasureTest
Methods
testSpecializedPushActLikeParentPush
public void testSpecializedPushActLikeParentPush()

ListenerTimeMeasure

public class ListenerTimeMeasure extends SimplePullMeasure<Long> implements PullMeasure<Long>

This measure is a facility to evaluate the time spent in MeasureListeners registered in PushMeasures. In order to measure the time spent in a MeasureListener, you should wrap it by calling wrapListener(MeasureListener). The wrapper returned should be used instead of the original MeasureListener to allow the ListenerTimeMeasure to account for its execution time. If you want to wrap automatically all the MeasureListeners registered to a given PushMeasure, you can wrap the PushMeasure through wrapMeasure(PushMeasure): all the MeasureListeners registered to the wrapper will be wrapped too. You can restart the evaluation by calling reset(). Notice that the time accounted is not the physical time but the processing time: if several listeners run in parallel, their execution time is summed as if they were running sequentially, thus you can have a measured time which is superior to the physical time spent. If you want to measure the physical time spent in the execution of parallel runs, you should use another way.

Author:Matthieu Vergne
Methods
get
public Long get()
Returns:the time spent in the wrapped MeasureListeners
reset
public void reset()

This method reset the time measured to zero. Notice that MeasureListeners which are still running will be affected consequently: their execution time will be measured from the reset time, not from their own starting time.

wrapListener
public <Value> MeasureListener<Value> wrapListener(MeasureListener<Value> wrapped)

This method wrap a MeasureListener (the wrapped) into another one (the wrapper). Any notification made via the wrapper will allow to measure how much time has been spent by the wrapped to treat this notification. The wrapped listener is not changed, thus it can be reused in other PushMeasures that we don’t want to consider. If a wrapper has already been made for the given wrapped, it will be returned and no new one will be instantiated (weak references are used to not keep in memory the unused wrappers).

Parameters:
Returns:

the MeasureListener wrapper

wrapManager
public <Value> MeasureManager wrapManager(MeasureManager wrapped, Object measureKey)

This method wrap a MeasureManager (the wrapped) into another one (the wrapper) which provides the same measures, excepted that any PushMeasure returned by the wrapper will be automatically wrapped via wrapMeasure(PushMeasure). This allows to ensure that any MeasureListener registered to the PushMeasures provided by the wrapper will be considered, independently of who registers it or when it is registered. You can also provide an additional key to add this ListenerTimeMeasure to the wrapper. The wrapped manager is not changed, thus it can be reused to register MeasureListeners that we don’t want to consider.

Parameters:
Returns:

the MeasureManager wrapper

wrapMeasure
public <Value> PushMeasure<Value> wrapMeasure(PushMeasure<Value> wrapped)

This method wrap a PushMeasure (the wrapped) into another one (the wrapper). Any MeasureListener registered to the wrapper will be automatically wrapped via wrapListener(MeasureListener). This allows to ensure that any MeasureListener registered will be considered, independently of who registers it or when it is registered. The wrapped measure is not changed, thus it can be reused to register MeasureListeners that we don’t want to consider. If a wrapper has already been made for the given wrapped, it will be returned and no new one will be instantiated (weak references are used to not keep in memory the unused wrappers).

Parameters:
Returns:

the PushMeasure wrapper

ListenerTimeMeasureTest

public class ListenerTimeMeasureTest
Methods
testAdditionalKeyForWrappedManagerRejectAlreadyUsedKeys
public void testAdditionalKeyForWrappedManagerRejectAlreadyUsedKeys()
testAdditionalKeyForWrappedManagerReturnCurrentMeasure
public void testAdditionalKeyForWrappedManagerReturnCurrentMeasure()
testAdditionalKeyProvidedByManager
public void testAdditionalKeyProvidedByManager()
testCountTimeInListeners
public void testCountTimeInListeners()
testCountTimeInManager
public void testCountTimeInManager()
testCountTimeInMeasures
public void testCountTimeInMeasures()
testExceptionOnNullListener
public void testExceptionOnNullListener()
testExceptionOnNullManager
public void testExceptionOnNullManager()
testExceptionOnNullMeasure
public void testExceptionOnNullMeasure()
testFakeListener
public void testFakeListener()
testForgetListenerWrapperIfNotUsedAnymore
public void testForgetListenerWrapperIfNotUsedAnymore()
testForgetMeasureWrapperIfNotUsedAnymore
public void testForgetMeasureWrapperIfNotUsedAnymore()
testResetToCurrentTimeWhenListenerIsRunning
public void testResetToCurrentTimeWhenListenerIsRunning()
testResetToZeroWhenNoListenerIsRunning
public void testResetToZeroWhenNoListenerIsRunning()
testReturnSameWrapperForSameListener
public void testReturnSameWrapperForSameListener()
testReturnSameWrapperForSameMeasure
public void testReturnSameWrapperForSameMeasure()
testSameNameAndDescriptionThanOriginalMeasure
public void testSameNameAndDescriptionThanOriginalMeasure()

MeasureFactory

public class MeasureFactory

The MeasureFactory provides some useful methods to build specific Measures.

Author:Matthieu Vergne
Methods
createPullFromPush
public <Value> PullMeasure<Value> createPullFromPush(PushMeasure<Value> push, Value initialValue)

Create a PullMeasure to backup the last Value of a PushMeasure. When the PushMeasure send a notification with a given Value, this Value is stored into a variable so that it can be retrieved at any time through the method PullMeasure.get().

Parameters:
  • push – a PushMeasure to backup
  • initialValue – the Value to return before the next notification of the PushMeasure is sent
Returns:

a PullMeasure allowing to retrieve the last value sent by the PushMeasure, or the initial value if it did not send any

createPullsFromFields
public Map<String, PullMeasure<?>> createPullsFromFields(Object object)

Create PullMeasures based on the fields available from an instance, whatever it is. The Class of the instance is analyzed to retrieve its public fields and a PullMeasure is built for each of them. The name of the field is further exploited to identify the measure, such that the map returned use the name of the field as a key which maps to the PullMeasure built from this field. The PullMeasure itself is named by using the name of the field.

Parameters:
  • object – the Object to cover
Returns:

the Map which contains the names of the getter methods and the corresponding PullMeasure built from them

createPullsFromGetters
public Map<String, PullMeasure<?>> createPullsFromGetters(Object object)

Create PullMeasures based on the getters available from an instance, whatever it is. The Class of the instance is analyzed to retrieve its public methods and a PullMeasure is built for each method which use a getter-like signature. The name of the method is further exploited to identify the measure, such that the map returned use the name of the method (without “get”) as a key which maps to the PullMeasure built from this method. The PullMeasure itself is named by using the name of the method.

Parameters:
  • object – the Object to cover
Returns:

the Map which contains the names of the getter methods and the corresponding PullMeasure built from them

createPushFromPull
public <Value> PushMeasure<Value> createPushFromPull(PullMeasure<Value> pull, long period)

Create a PushMeasure which checks at regular intervals the value of a PullMeasure. If the value have changed since the last check (or since the creation of the PushMeasure), a notification will be generated by the PushMeasure with the new Value. Notice that if the period is two small, the checking process could have a significant impact on performances, because a Thread is run in parallel to check regularly the Value modifications. If the period is too big, you could miss relevant notifications, especially if the PullMeasure change to a new Value and change back to its previous Value between two consecutive checks. In such a case, no notification will be sent because the Value during the two checks is equal.

Parameters:
  • pull – the PullMeasure to cover
  • period – the number of milliseconds between each check
Returns:

a PushMeasure which will notify any change occurred on the PullMeasure at the given frequency

MeasureFactoryTest

public class MeasureFactoryTest
Methods
testCreatePullFromPush
public void testCreatePullFromPush()
testCreatePullsFromFieldsRetrieveAllInheritedPublicFields
public void testCreatePullsFromFieldsRetrieveAllInheritedPublicFields()
testCreatePullsFromFieldsRetrieveAllInstantiatedPublicFields
public void testCreatePullsFromFieldsRetrieveAllInstantiatedPublicFields()
testCreatePullsFromFieldsRetrieveNoInheritedProtectedNorPrivateField
public void testCreatePullsFromFieldsRetrieveNoInheritedProtectedNorPrivateField()
testCreatePullsFromFieldsRetrieveNoInstantiatedProtectedNorPrivateField
public void testCreatePullsFromFieldsRetrieveNoInstantiatedProtectedNorPrivateField()
testCreatePullsFromFieldsRetrieveNothingFromEmptyObject
public void testCreatePullsFromFieldsRetrieveNothingFromEmptyObject()
testCreatePullsFromGettersRetrieveAllInheritedPublicGetters
public void testCreatePullsFromGettersRetrieveAllInheritedPublicGetters()
testCreatePullsFromGettersRetrieveAllInstantiatedPublicGetters
public void testCreatePullsFromGettersRetrieveAllInstantiatedPublicGetters()
testCreatePullsFromGettersRetrieveNoInheritedProtectedNorPrivateGetter
public void testCreatePullsFromGettersRetrieveNoInheritedProtectedNorPrivateGetter()
testCreatePullsFromGettersRetrieveNoInstantiatedProtectedNorPrivateGetter
public void testCreatePullsFromGettersRetrieveNoInstantiatedProtectedNorPrivateGetter()
testCreatePullsFromGettersRetrieveNothingFromEmptyObject
public void testCreatePullsFromGettersRetrieveNothingFromEmptyObject()
testCreatePushFromPullNotifiesOnlyWhenValueChanged
public void testCreatePushFromPullNotifiesOnlyWhenValueChanged()
testCreatePushFromPullNotifiesWithTheCorrectFrequency
public void testCreatePushFromPullNotifiesWithTheCorrectFrequency()
testCreatePushFromPullStopNotificationsWhenPullDestroyed
public void testCreatePushFromPullStopNotificationsWhenPullDestroyed()
testCreatePushFromPullStopNotificationsWhenPushDestroyed
public void testCreatePushFromPullStopNotificationsWhenPushDestroyed()

PullPushMeasure

public class PullPushMeasure<Value> implements PullMeasure<Value>, PushMeasure<Value>

A PullPushMeasure aims at providing both the PushMeasure and PullMeasure abilities into a single Measure. One could simply build a brand new Measure by calling PullPushMeasure(String,String), but in the case where some existing measures are available, he can wrap them into a PullPushMeasure by calling PullPushMeasure(PushMeasure,Object) or other constructors taking a Measure as argument.

Author:

Matthieu Vergne

Parameters:
  • <Value>
Constructors
PullPushMeasure
public PullPushMeasure(PullMeasure<Value> pull, PushMeasure<Value> push, DescribedEntity reference)

Create a PullPushMeasure which wraps both a PullMeasure and a PushMeasure. The assumption is that both Measures already represent the same Measure (i.e. the same Value) but were implemented separately. Instantiating a PullPushMeasure this way allows to merge them easily without creating a completely new measure. Don’t use this constructor to merge two different Measures. The last parameter is generally used to specify which of the two Measures should be used for getName() and getDescription(), but you can also provide a completely new instance to change them.

Parameters:
PullPushMeasure
public PullPushMeasure(PullMeasure<Value> pull, PushMeasure<Value> push, String name, String description)

Equivalent to PullPushMeasure(PullMeasure,PushMeasure,DescribedEntity) but the reference parameter is replaced by the specific name and description that you want to provide. This is a shortcut to the creation of the DescribedEntity instance followed by the call of the reference-based method.

Parameters:
PullPushMeasure
public PullPushMeasure(PushMeasure<Value> push, Value initialValue)

Create a PullPushMeasure which wraps a PushMeasure. The PullMeasure ability corresponds the storage of the Value pushed by the PushMeasure in order to retrieve it on demand through PullMeasure.get(). The name and the description of the PullPushMeasure are the ones provided by the wrapped PushMeasure.

Parameters:
  • push – the PushMeasure to wraps
  • initialValue – the Value to return before the next notification of the PushMeasure
PullPushMeasure
public PullPushMeasure(String name, String description)

Create a PullPushMeasure from scratch.

Parameters:
Methods
get
public Value get()
getDescription
public String getDescription()
getName
public String getName()
register
public void register(MeasureListener<Value> listener)
unregister
public void unregister(MeasureListener<Value> listener)

SimpleMeasure

public class SimpleMeasure<Value> extends SimpleDescribedEntity implements Measure<Value>

SimpleMeasure is a basic implementation of Measure. It provides a basic support for the most generic properties required by this interface.

Author:

Matthieu Vergne

Parameters:
  • <Value>
Constructors
SimpleMeasure
public SimpleMeasure(String name, String description)

Create a SimpleMeasure with a given name and a given description.

Parameters:
  • name – the name of the Measure
  • description – the description of the Measure
SimpleMeasure
public SimpleMeasure(String name)

Create a SimpleMeasure with a given name and a null description.

Parameters:
SimpleMeasure
public SimpleMeasure()

Create a SimpleMeasure with the class name as its name and a null description.

SimpleMeasureManager

public class SimpleMeasureManager implements MeasureManager

This SimpleMeasureManager provides a basic implementation to manage a collection of Measures. One can use the setXxxMeasure() methods to configure the MeasureManager with the finest granularity, or exploit the centralized setMeasure(Object,Measure) to register a Measure depending on the interfaces it implements, or even use the massive setAllMeasures(Map) to register a set of Measures at once. The corresponding removeXxx methods are also available for each case. However, the only way to access a Measure is through the finest granularity with getPullMeasure(Object) and getPushMeasure(Object).

Author:Matthieu Vergne
Methods
getMeasureKeys
public Collection<Object> getMeasureKeys()

Provides the keys of all the Measures which are supported by this SimpleMeasureManager. If a key is provided, then at least one version is available through getPullMeasure(Object) or getPushMeasure(Object).

getPullMeasure
public <T> PullMeasure<T> getPullMeasure(Object key)
getPushMeasure
public <T> PushMeasure<T> getPushMeasure(Object key)
removeAllMeasures
public void removeAllMeasures(Iterable<? extends Object> keys)

Massive equivalent to removeMeasure(Object).

Parameters:
  • keys – the keys of the Measures to remove
removeMeasure
public void removeMeasure(Object key)

This method removes an entire Measure, meaning that if both a PullMeasure and a PushMeasure are registered for this key, then both are removed.

Parameters:
  • key – the key of the Measure to remove
removePullMeasure
public void removePullMeasure(Object key)
Parameters:
removePushMeasure
public void removePushMeasure(Object key)
Parameters:
setAllMeasures
public void setAllMeasures(Map<? extends Object, ? extends Measure<?>> measures)

Massive equivalent of setMeasure(Object,Measure).

Parameters:
  • measures – the Measures to register with their corresponding keys
setMeasure
public void setMeasure(Object key, Measure<?> measure)

This method call setPullMeasure(Object,PullMeasure) or setPushMeasure(Object,PushMeasure) depending on the interfaces implemented by the Measure given in argument. If both interfaces are implemented, both methods are called, allowing to register all the aspects of the Measure in one call.

Parameters:
setPullMeasure
public void setPullMeasure(Object key, PullMeasure<?> measure)
Parameters:
setPushMeasure
public void setPushMeasure(Object key, PushMeasure<?> measure)
Parameters:

SimpleMeasureManagerTest

public class SimpleMeasureManagerTest
Methods
testAddMeasureAddKey
public void testAddMeasureAddKey()
testAddMultipleMeasures
public void testAddMultipleMeasures()
testRemoveBothAtOnce
public void testRemoveBothAtOnce()
testRemoveBothMeasuresRemoveKey
public void testRemoveBothMeasuresRemoveKey()
testRemoveMultipleMeasures
public void testRemoveMultipleMeasures()
testSetGetPullMeasure
public void testSetGetPullMeasure()
testSetGetPushMeasure
public void testSetGetPushMeasure()
testSetMeasureGetBoth
public void testSetMeasureGetBoth()
testStartEmpty
public void testStartEmpty()

SimplePullMeasure

public abstract class SimplePullMeasure<Value> extends SimpleMeasure<Value> implements PullMeasure<Value>

SimplePullMeasure is a basic implementation of PullMeasure. As a PullMeasure, it is intended to be used by external entities through its get() method. This method must be implemented by the algorithm to specify how the value can be retrieved.

Author:

Matthieu Vergne

Parameters:
  • <Value>
Constructors
SimplePullMeasure
public SimplePullMeasure(String name, String description)

Create a SimplePullMeasure with a given name and a given description.

Parameters:
  • name – the name of the Measure
  • description – the description of the Measure
SimplePullMeasure
public SimplePullMeasure(String name)

Create a SimplePullMeasure with a given name and a null description.

Parameters:
SimplePullMeasure
public SimplePullMeasure()

Create a SimplePullMeasure with the class name as its name and a null description.

SimplePushMeasure

public class SimplePushMeasure<Value> extends SimpleMeasure<Value> implements PushMeasure<Value>

SimplePushMeasure is a basic implementation of PushMeasure. As a PushMeasure, it is intended to be fed by the algorithm while external entities should use register(MeasureListener) to be notified in real time. For the algorithm to feed it, it should provide a solution and its value to push(Object,Object), leading to the notification of the registered observers.

Author:

Matthieu Vergne

Parameters:
  • <Value>
Constructors
SimplePushMeasure
public SimplePushMeasure(String name, String description)

Create a SimplePushMeasure with a given name and a given description.

Parameters:
  • name – the name of the Measure
  • description – the description of the Measure
SimplePushMeasure
public SimplePushMeasure(String name)

Create a SimplePushMeasure with a given name and a null description.

Parameters:
SimplePushMeasure
public SimplePushMeasure()

Create a SimplePushMeasure with the class name as its name and a null description.

Methods
push
public void push(Value value)

Notify the observers which has registered a MeasureListener through register(MeasureListener) about a value.

Parameters:
  • value – the value to send to the observers
register
public void register(MeasureListener<Value> listener)
unregister
public void unregister(MeasureListener<Value> listener)

SimplePushMeasureTest

public class SimplePushMeasureTest
Methods
testNotNotifiedWhenUnregistered
public void testNotNotifiedWhenUnregistered()
testNotifiedWhenRegistered
public void testNotifiedWhenRegistered()

org.uma.jmetal.operator

CrossoverOperator

public interface CrossoverOperator<Source> extends Operator<List<Source>, List<Source>>

Interface representing crossover operators. They will receive a list of solutions and return another list of solutions

Author:

Antonio J. Nebro

Parameters:
  • <Source> – The class of the solutions
Methods
getNumberOfGeneratedChildren
int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
int getNumberOfRequiredParents()

LocalSearchOperator

public interface LocalSearchOperator<Source> extends Operator<Source, Source>

Interface representing a local search operator Created by cbarba on 5/3/15.

Methods
getEvaluations
int getEvaluations()
getNumberOfImprovements
int getNumberOfImprovements()
getNumberOfNonComparableSolutions
int getNumberOfNonComparableSolutions()

MutationOperator

public interface MutationOperator<Source> extends Operator<Source, Source>

Interface representing mutation operators

Author:

Antonio J. Nebro

Parameters:
  • <Source> – The solution class of the solution to be mutated

Operator

public interface Operator<Source, Result> extends Serializable

Interface representing an operator

Author:

Antonio J. Nebro

Parameters:
  • <Source> – Source Class of the object to be operated with
  • <Result> – Result Class of the result obtained after applying the operator
Methods
execute
Result execute(Source source)
Parameters:
  • source – The data to process

SelectionOperator

public interface SelectionOperator<Source, Result> extends Operator<Source, Result>

Interface representing selection operators

Author:

Antonio J. Nebro

Parameters:
  • <Source> – Class of the source object (typically, a list of solutions)
  • <Result> – Class of the result of applying the operator

org.uma.jmetal.operator.impl.crossover

BLXAlphaCrossover

public class BLXAlphaCrossover implements CrossoverOperator<DoubleSolution>

This class allows to apply a BLX-alpha crossover operator to two parent solutions.

Author:Antonio J. Nebro
Constructors
BLXAlphaCrossover
public BLXAlphaCrossover(double crossoverProbability)

Constructor

BLXAlphaCrossover
public BLXAlphaCrossover(double crossoverProbability, double alpha)

Constructor

BLXAlphaCrossover
public BLXAlphaCrossover(double crossoverProbability, double alpha, RepairDoubleSolution solutionRepair)

Constructor

BLXAlphaCrossover
public BLXAlphaCrossover(double crossoverProbability, double alpha, RepairDoubleSolution solutionRepair, RandomGenerator<Double> randomGenerator)

Constructor

Methods
doCrossover
public List<DoubleSolution> doCrossover(double probability, DoubleSolution parent1, DoubleSolution parent2)

doCrossover method

execute
public List<DoubleSolution> execute(List<DoubleSolution> solutions)

Execute() method

getAlpha
public double getAlpha()
getCrossoverProbability
public double getCrossoverProbability()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()
setAlpha
public void setAlpha(double alpha)
setCrossoverProbability
public void setCrossoverProbability(double crossoverProbability)

BLXAlphaCrossoverTest

public class BLXAlphaCrossoverTest

Note: this class does check that the BLX-aplha crossover operator does not return invalid values, but not that it works properly (@see BLXAlphaCrossoverWorkingTest)

Author:Antonio J. Nebro
Methods
shouldConstructorAssignTheCorrectDistributionIndex
public void shouldConstructorAssignTheCorrectDistributionIndex()
shouldConstructorAssignTheCorrectProbabilityValue
public void shouldConstructorAssignTheCorrectProbabilityValue()
shouldConstructorFailWhenPassedANegativeAlphaValue
public void shouldConstructorFailWhenPassedANegativeAlphaValue()
shouldConstructorFailWhenPassedANegativeProbabilityValue
public void shouldConstructorFailWhenPassedANegativeProbabilityValue()
shouldCrossingTwoDoubleVariableSolutionsReturnValidSolutions
public void shouldCrossingTwoDoubleVariableSolutionsReturnValidSolutions()
shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfNotCrossoverIsApplied
public void shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfNotCrossoverIsApplied()
shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfProbabilityIsZero
public void shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfProbabilityIsZero()
shouldCrossingTwoSingleVariableSolutionsReturnValidSolutions
public void shouldCrossingTwoSingleVariableSolutionsReturnValidSolutions()
shouldCrossingTwoSingleVariableSolutionsWithSimilarValueReturnTheSameVariables
public void shouldCrossingTwoSingleVariableSolutionsWithSimilarValueReturnTheSameVariables()
shouldExecuteWithInvalidSolutionListSizeThrowAnException
public void shouldExecuteWithInvalidSolutionListSizeThrowAnException()
shouldExecuteWithNullParameterThrowAnException
public void shouldExecuteWithNullParameterThrowAnException()
shouldGetAlphaReturnTheRightValue
public void shouldGetAlphaReturnTheRightValue()
shouldGetProbabilityReturnTheRightValue
public void shouldGetProbabilityReturnTheRightValue()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

DifferentialEvolutionCrossover

public class DifferentialEvolutionCrossover implements CrossoverOperator<DoubleSolution>

Differential evolution crossover operator

Author:Antonio J. Nebro Comments: - The operator receives two parameters: the current individual and an array of three parent individuals - The best and rand variants depends on the third parent, according whether it represents the current of the “best” individual or a random one. The implementation of both variants are the same, due to that the parent selection is external to the crossover operator. - Implemented variants: - rand/1/bin (best/1/bin) - rand/1/exp (best/1/exp) - current-to-rand/1 (current-to-best/1) - current-to-rand/1/bin (current-to-best/1/bin) - current-to-rand/1/exp (current-to-best/1/exp)
Constructors
DifferentialEvolutionCrossover
public DifferentialEvolutionCrossover()

Constructor

DifferentialEvolutionCrossover
public DifferentialEvolutionCrossover(double cr, double f, String variant)

Constructor

Parameters:
  • cr
  • f
  • variant
DifferentialEvolutionCrossover
public DifferentialEvolutionCrossover(double cr, double f, String variant, RandomGenerator<Double> randomGenerator)

Constructor

Parameters:
  • cr
  • f
  • variant
  • jRandomGenerator
  • crRandomGenerator
DifferentialEvolutionCrossover
public DifferentialEvolutionCrossover(double cr, double f, String variant, BoundedRandomGenerator<Integer> jRandomGenerator, BoundedRandomGenerator<Double> crRandomGenerator)

Constructor

Parameters:
  • cr
  • f
  • variant
  • jRandomGenerator
  • crRandomGenerator
DifferentialEvolutionCrossover
public DifferentialEvolutionCrossover(double cr, double f, double k, String variant)

Constructor

Methods
execute
public List<DoubleSolution> execute(List<DoubleSolution> parentSolutions)

Execute() method

getCr
public double getCr()
getF
public double getF()
getK
public double getK()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()
getVariant
public String getVariant()
setCr
public void setCr(double cr)
setCurrentSolution
public void setCurrentSolution(DoubleSolution current)
setF
public void setF(double f)
setK
public void setK(double k)

DifferentialEvolutionCrossoverTest

public class DifferentialEvolutionCrossoverTest
Methods
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

HUXCrossover

public class HUXCrossover implements CrossoverOperator<BinarySolution>

This class allows to apply a HUX crossover operator using two parent solutions. NOTE: the operator is applied to the first encoding.variable of the solutions, and the type of the solutions must be Binary

Author:Antonio J. Nebro, Juan J. Durillo
Constructors
HUXCrossover
public HUXCrossover(double crossoverProbability)

Constructor

HUXCrossover
public HUXCrossover(double crossoverProbability, RandomGenerator<Double> randomGenerator)

Constructor

Methods
doCrossover
public List<BinarySolution> doCrossover(double probability, BinarySolution parent1, BinarySolution parent2)

Perform the crossover operation

Parameters:
  • probability – Crossover setProbability
  • parent1 – The first parent
  • parent2 – The second parent
Throws:
Returns:

An array containing the two offspring

execute
public List<BinarySolution> execute(List<BinarySolution> parents)

Execute() method

getCrossoverProbability
public double getCrossoverProbability()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()
setCrossoverProbability
public void setCrossoverProbability(double crossoverProbability)

HUXCrossoverTest

public class HUXCrossoverTest
Methods
testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided
public void testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided()

IntegerSBXCrossover

public class IntegerSBXCrossover implements CrossoverOperator<IntegerSolution>

This class allows to apply a SBX crossover operator using two parent solutions (Integer encoding)

Author:Antonio J. Nebro
Constructors
IntegerSBXCrossover
public IntegerSBXCrossover(double crossoverProbability, double distributionIndex)

Constructor

IntegerSBXCrossover
public IntegerSBXCrossover(double crossoverProbability, double distributionIndex, RandomGenerator<Double> randomGenerator)

Constructor

Methods
doCrossover
public List<IntegerSolution> doCrossover(double probability, IntegerSolution parent1, IntegerSolution parent2)

doCrossover method

execute
public List<IntegerSolution> execute(List<IntegerSolution> solutions)

Execute() method

getCrossoverProbability
public double getCrossoverProbability()
getDistributionIndex
public double getDistributionIndex()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()
setCrossoverProbability
public void setCrossoverProbability(double crossoverProbability)
setDistributionIndex
public void setDistributionIndex(double distributionIndex)

IntegerSBXCrossoverTest

public class IntegerSBXCrossoverTest
Methods
testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided
public void testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided()

NPointCrossover

public class NPointCrossover<T> implements CrossoverOperator<Solution<T>>

Created by FlapKap on 23-03-2017.

Constructors
NPointCrossover
public NPointCrossover(double probability, int crossovers)
NPointCrossover
public NPointCrossover(int crossovers)
Methods
execute
public List<Solution<T>> execute(List<Solution<T>> s)
getCrossoverProbability
public double getCrossoverProbability()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()

NullCrossover

public class NullCrossover<S extends Solution<?>> implements CrossoverOperator<S>

This class defines a null crossover operator: the parent solutions are returned without any change. It can be useful when configuring a genetic algorithm and we want to use only mutation.

Author:Antonio J. Nebro
Methods
execute
public List<S> execute(List<S> source)

Execute() method

getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()

NullCrossoverTest

public class NullCrossoverTest

Created by ajnebro on 10/6/15.

Methods
shouldExecuteReturnTwoDifferentObjectsWhichAreEquals
public void shouldExecuteReturnTwoDifferentObjectsWhichAreEquals()

PMXCrossover

public class PMXCrossover implements CrossoverOperator<PermutationSolution<Integer>>

This class allows to apply a PMX crossover operator using two parent solutions.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
PMXCrossover
public PMXCrossover(double crossoverProbability)

Constructor

PMXCrossover
public PMXCrossover(double crossoverProbability, RandomGenerator<Double> randomGenerator)

Constructor

PMXCrossover
public PMXCrossover(double crossoverProbability, RandomGenerator<Double> crossoverRandomGenerator, BoundedRandomGenerator<Integer> cuttingPointRandomGenerator)

Constructor

Methods
doCrossover
public List<PermutationSolution<Integer>> doCrossover(double probability, List<PermutationSolution<Integer>> parents)

Perform the crossover operation

Parameters:
  • probability – Crossover probability
  • parents – Parents
Returns:

An array containing the two offspring

execute
public List<PermutationSolution<Integer>> execute(List<PermutationSolution<Integer>> parents)

Executes the operation

Parameters:
  • parents – An object containing an array of two solutions
getCrossoverProbability
public double getCrossoverProbability()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()
setCrossoverProbability
public void setCrossoverProbability(double crossoverProbability)

PMXCrossoverTest

public class PMXCrossoverTest
Methods
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

SBXCrossover

public class SBXCrossover implements CrossoverOperator<DoubleSolution>

This class allows to apply a SBX crossover operator using two parent solutions (Double encoding). A RepairDoubleSolution object is used to decide the strategy to apply when a value is out of range. The implementation is based on the NSGA-II code available in http://www.iitk.ac.in/kangal/codes.shtml

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
SBXCrossover
public SBXCrossover(double crossoverProbability, double distributionIndex)

Constructor

SBXCrossover
public SBXCrossover(double crossoverProbability, double distributionIndex, RandomGenerator<Double> randomGenerator)

Constructor

SBXCrossover
public SBXCrossover(double crossoverProbability, double distributionIndex, RepairDoubleSolution solutionRepair)

Constructor

SBXCrossover
public SBXCrossover(double crossoverProbability, double distributionIndex, RepairDoubleSolution solutionRepair, RandomGenerator<Double> randomGenerator)

Constructor

Methods
doCrossover
public List<DoubleSolution> doCrossover(double probability, DoubleSolution parent1, DoubleSolution parent2)

doCrossover method

execute
public List<DoubleSolution> execute(List<DoubleSolution> solutions)

Execute() method

getCrossoverProbability
public double getCrossoverProbability()
getDistributionIndex
public double getDistributionIndex()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()
setCrossoverProbability
public void setCrossoverProbability(double probability)
setDistributionIndex
public void setDistributionIndex(double distributionIndex)

SBXCrossoverTest

public class SBXCrossoverTest

Note: this class does check that the SBX crossover operator does not return invalid values, but not that it works properly (@see SBXCrossoverWorkingTest)

Author:Antonio J. Nebro
Methods
shouldConstructorAssignTheCorrectDistributionIndex
public void shouldConstructorAssignTheCorrectDistributionIndex()
shouldConstructorAssignTheCorrectProbabilityValue
public void shouldConstructorAssignTheCorrectProbabilityValue()
shouldConstructorFailWhenPassedANegativeDistributionIndex
public void shouldConstructorFailWhenPassedANegativeDistributionIndex()
shouldConstructorFailWhenPassedANegativeProbabilityValue
public void shouldConstructorFailWhenPassedANegativeProbabilityValue()
shouldCrossingTheSecondVariableReturnTheOtherVariablesUnchangedInTheOffspringSolutions
public void shouldCrossingTheSecondVariableReturnTheOtherVariablesUnchangedInTheOffspringSolutions()
shouldCrossingTwoDoubleVariableSolutionsReturnValidSolutions
public void shouldCrossingTwoDoubleVariableSolutionsReturnValidSolutions()
shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfNotCrossoverIsApplied
public void shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfNotCrossoverIsApplied()
shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfProbabilityIsZero
public void shouldCrossingTwoSingleVariableSolutionsReturnTheSameSolutionsIfProbabilityIsZero()
shouldCrossingTwoSingleVariableSolutionsReturnValidSolutions
public void shouldCrossingTwoSingleVariableSolutionsReturnValidSolutions()
shouldCrossingTwoSingleVariableSolutionsWithSimilarValueReturnTheSameVariables
public void shouldCrossingTwoSingleVariableSolutionsWithSimilarValueReturnTheSameVariables()
shouldExecuteWithInvalidSolutionListSizeThrowAnException
public void shouldExecuteWithInvalidSolutionListSizeThrowAnException()
shouldExecuteWithNullParameterThrowAnException
public void shouldExecuteWithNullParameterThrowAnException()
shouldGetDistributionIndexReturnTheRightValue
public void shouldGetDistributionIndexReturnTheRightValue()
shouldGetProbabilityReturnTheRightValue
public void shouldGetProbabilityReturnTheRightValue()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

SinglePointCrossover

public class SinglePointCrossover implements CrossoverOperator<BinarySolution>

This class implements a single point crossover operator.

Author:Antonio J. Nebro
Constructors
SinglePointCrossover
public SinglePointCrossover(double crossoverProbability)

Constructor

SinglePointCrossover
public SinglePointCrossover(double crossoverProbability, RandomGenerator<Double> randomGenerator)

Constructor

SinglePointCrossover
public SinglePointCrossover(double crossoverProbability, RandomGenerator<Double> crossoverRandomGenerator, BoundedRandomGenerator<Integer> pointRandomGenerator)

Constructor

Methods
doCrossover
public List<BinarySolution> doCrossover(double probability, BinarySolution parent1, BinarySolution parent2)

Perform the crossover operation.

Parameters:
  • probability – Crossover setProbability
  • parent1 – The first parent
  • parent2 – The second parent
Returns:

An array containing the two offspring

execute
public List<BinarySolution> execute(List<BinarySolution> solutions)
getCrossoverProbability
public double getCrossoverProbability()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()
setCrossoverProbability
public void setCrossoverProbability(double crossoverProbability)

SinglePointCrossoverTest

public class SinglePointCrossoverTest
Methods
shouldConstructorAssignTheCorrectProbabilityValue
public void shouldConstructorAssignTheCorrectProbabilityValue()
shouldConstructorFailWhenPassedANegativeProbabilityValue
public void shouldConstructorFailWhenPassedANegativeProbabilityValue()
shouldCrossingTheBitInTheMiddleOfSecondVariableReturnTheCorrectCrossedSolutions
public void shouldCrossingTheBitInTheMiddleOfSecondVariableReturnTheCorrectCrossedSolutions()
shouldCrossingTheBitInTheMiddleOfTwoSingleVariableSolutionsReturnTheCorrectCrossedSolutions
public void shouldCrossingTheBitInTheMiddleOfTwoSingleVariableSolutionsReturnTheCorrectCrossedSolutions()
shouldCrossingTheFistBitOfSecondVariableReturnTheCorrectCrossedSolutions
public void shouldCrossingTheFistBitOfSecondVariableReturnTheCorrectCrossedSolutions()
shouldCrossingTheFistBitOfTwoSingleVariableSolutionsReturnTheCorrectCrossedSolutions
public void shouldCrossingTheFistBitOfTwoSingleVariableSolutionsReturnTheCorrectCrossedSolutions()
shouldCrossingTheLastBitOfTwoSingleVariableSolutionsReturnTheCorrectCrossedSolutions
public void shouldCrossingTheLastBitOfTwoSingleVariableSolutionsReturnTheCorrectCrossedSolutions()
shouldCrossingTwoVariableSolutionsReturnTheSameSolutionsIfNoBitsAreMutated
public void shouldCrossingTwoVariableSolutionsReturnTheSameSolutionsIfNoBitsAreMutated()
shouldExecuteFailIfTheListContainsMoreThanTwoSolutions
public void shouldExecuteFailIfTheListContainsMoreThanTwoSolutions()
shouldExecuteFailIfTheListContainsOnlyOneSolution
public void shouldExecuteFailIfTheListContainsOnlyOneSolution()
shouldExecuteWithNullParameterThrowAnException
public void shouldExecuteWithNullParameterThrowAnException()
shouldGetMutationProbabilityReturnTheRightValue
public void shouldGetMutationProbabilityReturnTheRightValue()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

TwoPointCrossover

public class TwoPointCrossover<T> implements CrossoverOperator<Solution<T>>

Created by FlapKap on 27-05-2017.

Fields
operator
NPointCrossover<T> operator
Constructors
TwoPointCrossover
public TwoPointCrossover(double probability)
Methods
execute
public List<Solution<T>> execute(List<Solution<T>> solutions)
getCrossoverProbability
public double getCrossoverProbability()
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()
getNumberOfRequiredParents
public int getNumberOfRequiredParents()

org.uma.jmetal.operator.impl.localsearch

ArchiveMutationLocalSearch

public class ArchiveMutationLocalSearch<S extends Solution<?>> implements LocalSearchOperator<S>

This class implements a local search operator based in the use of a mutation operator. An archive is used to store the non-dominated solutions found during the search.

Author:Antonio J. Nebro
Constructors
ArchiveMutationLocalSearch
public ArchiveMutationLocalSearch(int improvementRounds, MutationOperator<S> mutationOperator, Archive<S> archive, Problem<S> problem)

Constructor. Creates a new local search object.

Parameters:
  • improvementRounds – number of iterations
  • mutationOperator – mutation operator
  • archive – archive to store non-dominated solution
  • problem – problem to resolve
Methods
execute
public S execute(S solution)

Executes the local search.

Parameters:
  • solution – The solution to improve
Returns:

The improved solution

getEvaluations
public int getEvaluations()

Returns the number of evaluations

getNumberOfImprovements
public int getNumberOfImprovements()
getNumberOfNonComparableSolutions
public int getNumberOfNonComparableSolutions()

BasicLocalSearch

public class BasicLocalSearch<S extends Solution<?>> implements LocalSearchOperator<S>

This class implements a basic local search operator based in the use of a mutation operator.

Author:Antonio J. Nebro
Constructors
BasicLocalSearch
public BasicLocalSearch(int improvementRounds, MutationOperator<S> mutationOperator, Comparator<S> comparator, Problem<S> problem)

Constructor. Creates a new local search object.

Parameters:
  • improvementRounds – number of iterations
  • mutationOperator – mutation operator
  • comparator – comparator to determine which solution is the best
  • problem – problem to resolve
BasicLocalSearch
public BasicLocalSearch(int improvementRounds, MutationOperator<S> mutationOperator, Comparator<S> comparator, Problem<S> problem, RandomGenerator<Double> randomGenerator)

Constructor. Creates a new local search object.

Parameters:
  • improvementRounds – number of iterations
  • mutationOperator – mutation operator
  • comparator – comparator to determine which solution is the best
  • problem – problem to resolve
  • randomGenerator – the RandomGenerator to use when we must choose between equivalent solutions
Methods
execute
public S execute(S solution)

Executes the local search.

Parameters:
  • solution – The solution to improve
Returns:

An improved solution

getEvaluations
public int getEvaluations()

Returns the number of evaluations

getNumberOfImprovements
public int getNumberOfImprovements()
getNumberOfNonComparableSolutions
public int getNumberOfNonComparableSolutions()

BasicLocalSearchTest

public class BasicLocalSearchTest
Methods
testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided
public void testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided()

org.uma.jmetal.operator.impl.mutation

BitFlipMutation

public class BitFlipMutation implements MutationOperator<BinarySolution>
Author:Antonio J. Nebro
Constructors
BitFlipMutation
public BitFlipMutation(double mutationProbability)

Constructor

BitFlipMutation
public BitFlipMutation(double mutationProbability, RandomGenerator<Double> randomGenerator)

Constructor

Methods
doMutation
public void doMutation(double probability, BinarySolution solution)

Perform the mutation operation

Parameters:
  • probability – Mutation setProbability
  • solution – The solution to mutate
execute
public BinarySolution execute(BinarySolution solution)

Execute() method

getMutationProbability
public double getMutationProbability()
setMutationProbability
public void setMutationProbability(double mutationProbability)

BitFlipMutationTest

public class BitFlipMutationTest
Methods
shouldConstructorAssignTheCorrectProbabilityValue
public void shouldConstructorAssignTheCorrectProbabilityValue()
shouldConstructorFailWhenPassedANegativeProbabilityValue
public void shouldConstructorFailWhenPassedANegativeProbabilityValue()
shouldExecuteWithNullParameterThrowAnException
public void shouldExecuteWithNullParameterThrowAnException()
shouldGetMutationProbabilityReturnTheRightValue
public void shouldGetMutationProbabilityReturnTheRightValue()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()
shouldMutateASingleVariableSolutionReturnTheSameSolutionIfNoBitsAreMutated
public void shouldMutateASingleVariableSolutionReturnTheSameSolutionIfNoBitsAreMutated()
shouldMutateASingleVariableSolutionWhenASingleBitIsMutated
public void shouldMutateASingleVariableSolutionWhenASingleBitIsMutated()
shouldMutateATwoVariableSolutionReturnTheSameSolutionIfNoBitsAreMutated
public void shouldMutateATwoVariableSolutionReturnTheSameSolutionIfNoBitsAreMutated()
shouldMutateATwoVariableSolutionWhenTwoBitsAreMutated
public void shouldMutateATwoVariableSolutionWhenTwoBitsAreMutated()

CDGMutation

public class CDGMutation implements MutationOperator<DoubleSolution>

This class implements a polynomial mutation operator The implementation is based on the NSGA-II code available in http://www.iitk.ac.in/kangal/codes.shtml If the lower and upper bounds of a variable are the same, no mutation is carried out and the bound value is returned.

Author:Feng Zhang
Constructors
CDGMutation
public CDGMutation()

Constructor

CDGMutation
public CDGMutation(DoubleProblem problem, double delta)

Constructor

CDGMutation
public CDGMutation(double mutationProbability, double delta)

Constructor

CDGMutation
public CDGMutation(double mutationProbability, double delta, RepairDoubleSolution solutionRepair)

Constructor

Methods
execute
public DoubleSolution execute(DoubleSolution solution)

Execute() method

getDelta
public double getDelta()
getMutationProbability
public double getMutationProbability()
setDelta
public void setDelta(double delta)
setMutationProbability
public void setMutationProbability(double probability)

IntegerPolynomialMutation

public class IntegerPolynomialMutation implements MutationOperator<IntegerSolution>

This class implements a polynomial mutation operator to be applied to Integer solutions If the lower and upper bounds of a variable are the same, no mutation is carried out and the bound value is returned. A RepairDoubleSolution object is used to decide the strategy to apply when a value is out of range.

Author:Antonio J. Nebro
Constructors
IntegerPolynomialMutation
public IntegerPolynomialMutation()

Constructor

IntegerPolynomialMutation
public IntegerPolynomialMutation(IntegerProblem problem, double distributionIndex)

Constructor

IntegerPolynomialMutation
public IntegerPolynomialMutation(double mutationProbability, double distributionIndex)

Constructor

IntegerPolynomialMutation
public IntegerPolynomialMutation(double mutationProbability, double distributionIndex, RepairDoubleSolution solutionRepair)

Constructor

IntegerPolynomialMutation
public IntegerPolynomialMutation(double mutationProbability, double distributionIndex, RepairDoubleSolution solutionRepair, RandomGenerator<Double> randomGenerator)

Constructor

Methods
execute
public IntegerSolution execute(IntegerSolution solution)

Execute() method

getDistributionIndex
public double getDistributionIndex()
getMutationProbability
public double getMutationProbability()
setDistributionIndex
public void setDistributionIndex(double distributionIndex)
setMutationProbability
public void setMutationProbability(double mutationProbability)

IntegerPolynomialMutationTest

public class IntegerPolynomialMutationTest
Methods
shouldConstructorAssignTheCorrectDistributionIndex
public void shouldConstructorAssignTheCorrectDistributionIndex()
shouldConstructorAssignTheCorrectProbabilityValue
public void shouldConstructorAssignTheCorrectProbabilityValue()
shouldConstructorFailWhenPassedANegativeDistributionIndex
public void shouldConstructorFailWhenPassedANegativeDistributionIndex()
shouldConstructorFailWhenPassedANegativeProbabilityValue
public void shouldConstructorFailWhenPassedANegativeProbabilityValue()
shouldConstructorWithProblemAndDistributionIndexParametersAssignTheCorrectValues
public void shouldConstructorWithProblemAndDistributionIndexParametersAssignTheCorrectValues()
shouldConstructorWithoutParameterAssignTheDefaultValues
public void shouldConstructorWithoutParameterAssignTheDefaultValues()
shouldExecuteWithNullParameterThrowAnException
public void shouldExecuteWithNullParameterThrowAnException()
shouldGetDistributionIndexReturnTheRightValue
public void shouldGetDistributionIndexReturnTheRightValue()
shouldGetMutationProbabilityReturnTheRightValue
public void shouldGetMutationProbabilityReturnTheRightValue()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()
shouldMutateASingleVariableSolutionReturnAValidSolution
public void shouldMutateASingleVariableSolutionReturnAValidSolution()
shouldMutateASingleVariableSolutionReturnAnotherValidSolution
public void shouldMutateASingleVariableSolutionReturnAnotherValidSolution()
shouldMutateASingleVariableSolutionReturnTheSameSolutionIfItIsNotMutated
public void shouldMutateASingleVariableSolutionReturnTheSameSolutionIfItIsNotMutated()
shouldMutateASingleVariableSolutionReturnTheSameSolutionIfProbabilityIsZero
public void shouldMutateASingleVariableSolutionReturnTheSameSolutionIfProbabilityIsZero()
shouldMutateASingleVariableSolutionWithSameLowerAndUpperBoundsReturnTheBoundValue
public void shouldMutateASingleVariableSolutionWithSameLowerAndUpperBoundsReturnTheBoundValue()

NonUniformMutation

public class NonUniformMutation implements MutationOperator<DoubleSolution>

This class implements a non-uniform mutation operator.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
NonUniformMutation
public NonUniformMutation(double mutationProbability, double perturbation, int maxIterations)

Constructor

NonUniformMutation
public NonUniformMutation(double mutationProbability, double perturbation, int maxIterations, RandomGenerator<Double> randomGenenerator)

Constructor

Methods
doMutation
public void doMutation(double probability, DoubleSolution solution)

Perform the mutation operation

Parameters:
  • probability – Mutation setProbability
  • solution – The solution to mutate
execute
public DoubleSolution execute(DoubleSolution solution)

Execute() method

getCurrentIteration
public int getCurrentIteration()
getMaxIterations
public int getMaxIterations()
getMutationProbability
public double getMutationProbability()
getPerturbation
public double getPerturbation()
setCurrentIteration
public void setCurrentIteration(int currentIteration)
setMaxIterations
public void setMaxIterations(int maxIterations)
setMutationProbability
public void setMutationProbability(double mutationProbability)
setPerturbation
public void setPerturbation(double perturbation)

NonUniformMutationTest

public class NonUniformMutationTest
Methods
testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided
public void testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided()

NullMutation

public class NullMutation<S> implements MutationOperator<S>

This class is intended to perform no mutation. It can be useful when configuring a genetic algorithm and we want to use only crossover.

Author:Antonio J. Nebro
Methods
execute
public S execute(S source)

Execute() method

PermutationSwapMutation

public class PermutationSwapMutation<T> implements MutationOperator<PermutationSolution<T>>

This class implements a swap mutation. The solution type of the solution must be Permutation.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
PermutationSwapMutation
public PermutationSwapMutation(double mutationProbability)

Constructor

PermutationSwapMutation
public PermutationSwapMutation(double mutationProbability, RandomGenerator<Double> randomGenerator)

Constructor

PermutationSwapMutation
public PermutationSwapMutation(double mutationProbability, RandomGenerator<Double> mutationRandomGenerator, BoundedRandomGenerator<Integer> positionRandomGenerator)

Constructor

Methods
doMutation
public void doMutation(PermutationSolution<T> solution)

Performs the operation

execute
public PermutationSolution<T> execute(PermutationSolution<T> solution)
getMutationProbability
public double getMutationProbability()
setMutationProbability
public void setMutationProbability(double mutationProbability)

PermutationSwapMutationTest

public class PermutationSwapMutationTest
Methods
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

PolynomialMutation

public class PolynomialMutation implements MutationOperator<DoubleSolution>

This class implements a polynomial mutation operator The implementation is based on the NSGA-II code available in http://www.iitk.ac.in/kangal/codes.shtml If the lower and upper bounds of a variable are the same, no mutation is carried out and the bound value is returned.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
PolynomialMutation
public PolynomialMutation()

Constructor

PolynomialMutation
public PolynomialMutation(DoubleProblem problem, double distributionIndex)

Constructor

PolynomialMutation
public PolynomialMutation(DoubleProblem problem, double distributionIndex, RandomGenerator<Double> randomGenerator)

Constructor

PolynomialMutation
public PolynomialMutation(double mutationProbability, double distributionIndex)

Constructor

PolynomialMutation
public PolynomialMutation(double mutationProbability, double distributionIndex, RandomGenerator<Double> randomGenerator)

Constructor

PolynomialMutation
public PolynomialMutation(double mutationProbability, double distributionIndex, RepairDoubleSolution solutionRepair)

Constructor

PolynomialMutation
public PolynomialMutation(double mutationProbability, double distributionIndex, RepairDoubleSolution solutionRepair, RandomGenerator<Double> randomGenerator)

Constructor

Methods
execute
public DoubleSolution execute(DoubleSolution solution)

Execute() method

getDistributionIndex
public double getDistributionIndex()
getMutationProbability
public double getMutationProbability()
setDistributionIndex
public void setDistributionIndex(double distributionIndex)
setMutationProbability
public void setMutationProbability(double probability)

PolynomialMutationTest

public class PolynomialMutationTest

Note: this class does check that the polynomial mutation operator does not return invalid values, but not that it works properly (@see PolynomialMutationWorkingTest)

Author:Antonio J. Nebro
Methods
shouldConstructorAssignTheCorrectDistributionIndex
public void shouldConstructorAssignTheCorrectDistributionIndex()
shouldConstructorAssignTheCorrectProbabilityValue
public void shouldConstructorAssignTheCorrectProbabilityValue()
shouldConstructorFailWhenPassedANegativeDistributionIndex
public void shouldConstructorFailWhenPassedANegativeDistributionIndex()
shouldConstructorFailWhenPassedANegativeProbabilityValue
public void shouldConstructorFailWhenPassedANegativeProbabilityValue()
shouldConstructorWithProblemAndDistributionIndexParametersAssignTheCorrectValues
public void shouldConstructorWithProblemAndDistributionIndexParametersAssignTheCorrectValues()
shouldConstructorWithoutParameterAssignTheDefaultValues
public void shouldConstructorWithoutParameterAssignTheDefaultValues()
shouldExecuteWithNullParameterThrowAnException
public void shouldExecuteWithNullParameterThrowAnException()
shouldGetDistributionIndexReturnTheRightValue
public void shouldGetDistributionIndexReturnTheRightValue()
shouldGetMutationProbabilityReturnTheRightValue
public void shouldGetMutationProbabilityReturnTheRightValue()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()
shouldMutateASingleVariableSolutionReturnAValidSolution
public void shouldMutateASingleVariableSolutionReturnAValidSolution()
shouldMutateASingleVariableSolutionReturnAnotherValidSolution
public void shouldMutateASingleVariableSolutionReturnAnotherValidSolution()
shouldMutateASingleVariableSolutionReturnTheSameSolutionIfItIsNotMutated
public void shouldMutateASingleVariableSolutionReturnTheSameSolutionIfItIsNotMutated()
shouldMutateASingleVariableSolutionReturnTheSameSolutionIfProbabilityIsZero
public void shouldMutateASingleVariableSolutionReturnTheSameSolutionIfProbabilityIsZero()
shouldMutateASingleVariableSolutionWithSameLowerAndUpperBoundsReturnTheBoundValue
public void shouldMutateASingleVariableSolutionWithSameLowerAndUpperBoundsReturnTheBoundValue()

SimpleRandomMutation

public class SimpleRandomMutation implements MutationOperator<DoubleSolution>

This class implements a random mutation operator for double solutions

Author:Antonio J. Nebro
Constructors
SimpleRandomMutation
public SimpleRandomMutation(double probability)

Constructor

SimpleRandomMutation
public SimpleRandomMutation(double probability, RandomGenerator<Double> randomGenerator)

Constructor

Methods
execute
public DoubleSolution execute(DoubleSolution solution)

Execute() method

getMutationProbability
public double getMutationProbability()
setMutationProbability
public void setMutationProbability(double mutationProbability)

SimpleRandomMutationTest

public class SimpleRandomMutationTest
Methods
testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided
public void testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided()

UniformMutation

public class UniformMutation implements MutationOperator<DoubleSolution>

This class implements a uniform mutation operator.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
UniformMutation
public UniformMutation(double mutationProbability, double perturbation)

Constructor

UniformMutation
public UniformMutation(double mutationProbability, double perturbation, RandomGenerator<Double> randomGenenerator)

Constructor

Methods
doMutation
public void doMutation(double probability, DoubleSolution solution)

Perform the operation

Parameters:
  • probability – Mutation setProbability
  • solution – The solution to mutate
execute
public DoubleSolution execute(DoubleSolution solution)

Execute() method

getMutationProbability
public Double getMutationProbability()
getPerturbation
public double getPerturbation()
setMutationProbability
public void setMutationProbability(Double mutationProbability)
setPerturbation
public void setPerturbation(Double perturbation)

UniformMutationTest

public class UniformMutationTest
Methods
testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided
public void testJMetalRandomGeneratorNotUsedWhenCustomRandomGeneratorProvided()

org.uma.jmetal.operator.impl.selection

BestSolutionSelection

public class BestSolutionSelection<S> implements SelectionOperator<List<S>, S>

This class implements a selection operator used for selecting the best solution in a list according to a given comparator.

Author:Antonio J. Nebro
Constructors
BestSolutionSelection
public BestSolutionSelection(Comparator<S> comparator)
Methods
execute
public S execute(List<S> solutionList)

Execute() method

BinaryTournamentSelection

public class BinaryTournamentSelection<S extends Solution<?>> extends TournamentSelection<S>

Applies a binary tournament selection to return the best solution between two that have been chosen at random from a solution list. Modified by Juanjo in 13.03.2015. A binary tournament is now a TournamenteSelection with 2 tournaments

Author:Antonio J. Nebro, Juan J. Durillo
Constructors
BinaryTournamentSelection
public BinaryTournamentSelection()

Constructor

BinaryTournamentSelection
public BinaryTournamentSelection(Comparator<S> comparator)

Constructor

BinaryTournamentSelectionTest

public class BinaryTournamentSelectionTest
Author:Antonio J. Nebro
Methods
shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsEmpty
public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsEmpty()
shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsNull
public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsNull()
shouldExecuteReturnAValidSolutionIsWithCorrectParameters
public void shouldExecuteReturnAValidSolutionIsWithCorrectParameters()
shouldExecuteReturnTheSameSolutionIfTheListContainsOneSolution
public void shouldExecuteReturnTheSameSolutionIfTheListContainsOneSolution()
shouldExecuteReturnTwoSolutionsIfTheListContainsTwoSolutions
public void shouldExecuteReturnTwoSolutionsIfTheListContainsTwoSolutions()
shouldExecuteWorkProperlyIfTheTwoSolutionsInTheListAreNondominated
public void shouldExecuteWorkProperlyIfTheTwoSolutionsInTheListAreNondominated()
tearDown
public void tearDown()

DifferentialEvolutionSelection

public class DifferentialEvolutionSelection implements SelectionOperator<List<DoubleSolution>, List<DoubleSolution>>

Class implementing the selection operator used in DE: three different solutions are returned from a population. The three solutions must be also different from the one indicated by an index (its position in the list). As a consequence, the operator requires a solution list with at least for elements.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
DifferentialEvolutionSelection
public DifferentialEvolutionSelection()

Constructor

DifferentialEvolutionSelection
public DifferentialEvolutionSelection(BoundedRandomGenerator<Integer> randomGenerator)

Constructor

Methods
execute
public List<DoubleSolution> execute(List<DoubleSolution> solutionSet)

Execute() method

setIndex
public void setIndex(int index)

DifferentialEvolutionSelectionTest

public class DifferentialEvolutionSelectionTest

Created by ajnebro on 3/5/15.

Fields
exception
public ExpectedException exception
Methods
shouldExecuteRaiseAnExceptionIfTheIndexIsHigherThanTheSolutionListLength
public void shouldExecuteRaiseAnExceptionIfTheIndexIsHigherThanTheSolutionListLength()
shouldExecuteRaiseAnExceptionIfTheIndexIsNegative
public void shouldExecuteRaiseAnExceptionIfTheIndexIsNegative()
shouldExecuteRaiseAnExceptionIfTheIndexIsNotIndicated
public void shouldExecuteRaiseAnExceptionIfTheIndexIsNotIndicated()
shouldExecuteRaiseAnExceptionIfTheListOfSolutionsHasOneSolution
public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsHasOneSolution()
shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsEmpty
public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsEmpty()
shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsNull
public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsNull()
shouldExecuteReturnThreeDifferentSolutionsIfTheListHasFourElements
public void shouldExecuteReturnThreeDifferentSolutionsIfTheListHasFourElements()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

NaryRandomSelection

public class NaryRandomSelection<S> implements SelectionOperator<List<S>, List<S>>

This class implements a random selection operator used for selecting a N number of solutions from a list

Author:Antonio J. Nebro
Constructors
NaryRandomSelection
public NaryRandomSelection()

Constructor

NaryRandomSelection
public NaryRandomSelection(int numberOfSolutionsToBeReturned)

Constructor

Methods
execute
public List<S> execute(List<S> solutionList)

Execute() method

NaryRandomSelectionTest

public class NaryRandomSelectionTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldDefaultConstructorReturnASingleSolution
public void shouldDefaultConstructorReturnASingleSolution()
shouldExecuteRaiseAnExceptionIfTheListSizeIsOneAndTwoSolutionsAreRequested
public void shouldExecuteRaiseAnExceptionIfTheListSizeIsOneAndTwoSolutionsAreRequested()
shouldExecuteRaiseAnExceptionIfTheListSizeIsTwoAndFourSolutionsAreRequested
public void shouldExecuteRaiseAnExceptionIfTheListSizeIsTwoAndFourSolutionsAreRequested()
shouldExecuteRaiseAnExceptionIfTheSolutionListIsEmpty
public void shouldExecuteRaiseAnExceptionIfTheSolutionListIsEmpty()
shouldExecuteRaiseAnExceptionIfTheSolutionListIsNull
public void shouldExecuteRaiseAnExceptionIfTheSolutionListIsNull()
shouldExecuteReturnTheCorrectNumberOfSolutions
public void shouldExecuteReturnTheCorrectNumberOfSolutions()
shouldExecuteReturnTheSolutionInTheListIfTheListContainsASolution
public void shouldExecuteReturnTheSolutionInTheListIfTheListContainsASolution()
shouldExecuteReturnTheSolutionSInTheListIfTheListContainsTwoSolutions
public void shouldExecuteReturnTheSolutionSInTheListIfTheListContainsTwoSolutions()
shouldNonDefaultConstructorReturnTheCorrectNumberOfSolutions
public void shouldNonDefaultConstructorReturnTheCorrectNumberOfSolutions()
shouldSelectNRandomDifferentSolutionsReturnTheCorrectListOfSolutions
public void shouldSelectNRandomDifferentSolutionsReturnTheCorrectListOfSolutions()

If the list contains 4 solutions, the result list must return all of them

NaryTournamentSelection

public class NaryTournamentSelection<S extends Solution<?>> implements SelectionOperator<List<S>, S>

Applies a N-ary tournament selection to return the best solution between N that have been chosen at random from a solution list.

Author:Antonio J. Nebro
Constructors
NaryTournamentSelection
public NaryTournamentSelection()

Constructor

NaryTournamentSelection
public NaryTournamentSelection(int numberOfSolutionsToBeReturned, Comparator<S> comparator)

Constructor

Methods
execute
public S execute(List<S> solutionList)

NaryTournamentSelectionTest

public class NaryTournamentSelectionTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldDefaultConstructorSetTheNumberOfSolutionsToBeReturnedEqualsToTwo
public void shouldDefaultConstructorSetTheNumberOfSolutionsToBeReturnedEqualsToTwo()
shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsEmpty
public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsEmpty()
shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsNull
public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsNull()
shouldExecuteRaiseAnExceptionIfTheListSizeIsOneAndTwoSolutionsAreRequested
public void shouldExecuteRaiseAnExceptionIfTheListSizeIsOneAndTwoSolutionsAreRequested()
shouldExecuteReturnAValidSolutionIsWithCorrectParameters
public void shouldExecuteReturnAValidSolutionIsWithCorrectParameters()
shouldExecuteReturnTheSameSolutionIfTheListContainsOneSolution
public void shouldExecuteReturnTheSameSolutionIfTheListContainsOneSolution()
shouldExecuteReturnTwoSolutionsIfTheListContainsTwoSolutions
public void shouldExecuteReturnTwoSolutionsIfTheListContainsTwoSolutions()

RandomSelection

public class RandomSelection<S> implements SelectionOperator<List<S>, S>

This class implements a random selection operator used for selecting a N number of solutions from a list

Author:Antonio J. Nebro
Methods
execute
public S execute(List<S> solutionList)

Execute() method

RandomSelectionTest

public class RandomSelectionTest

Created by ajnebro on 4/5/15.

RankingAndCrowdingSelection

public class RankingAndCrowdingSelection<S extends Solution<?>> implements SelectionOperator<List<S>, List<S>>

This class implements a selection for selecting a number of solutions from a solution list. The solutions are taken by mean of its ranking and crowding distance values.

Author:Antonio J. Nebro, Juan J. Durillo
Constructors
RankingAndCrowdingSelection
public RankingAndCrowdingSelection(int solutionsToSelect, Comparator<S> dominanceComparator)

Constructor

RankingAndCrowdingSelection
public RankingAndCrowdingSelection(int solutionsToSelect)

Constructor

Methods
addLastRankedSolutionsToPopulation
protected void addLastRankedSolutionsToPopulation(Ranking<S> ranking, int rank, List<S> population)
addRankedSolutionsToPopulation
protected void addRankedSolutionsToPopulation(Ranking<S> ranking, int rank, List<S> population)
crowdingDistanceSelection
protected List<S> crowdingDistanceSelection(Ranking<S> ranking)
execute
public List<S> execute(List<S> solutionList)

Execute() method

getNumberOfSolutionsToSelect
public int getNumberOfSolutionsToSelect()
subfrontFillsIntoThePopulation
protected boolean subfrontFillsIntoThePopulation(Ranking<S> ranking, int rank, List<S> population)

RankingAndCrowdingSelectionTest

public class RankingAndCrowdingSelectionTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldDefaultConstructorReturnASingleSolution
public void shouldDefaultConstructorReturnASingleSolution()
shouldExecuteRaiseAnExceptionIfTheSolutionListIsEmpty
public void shouldExecuteRaiseAnExceptionIfTheSolutionListIsEmpty()
shouldExecuteRaiseAnExceptionIfTheSolutionListIsNull
public void shouldExecuteRaiseAnExceptionIfTheSolutionListIsNull()
shouldNonDefaultConstructorReturnTheCorrectNumberOfSolutions
public void shouldNonDefaultConstructorReturnTheCorrectNumberOfSolutions()

RankingAndPreferenceSelection

public class RankingAndPreferenceSelection<S extends Solution<?>> implements SelectionOperator<List<S>, List<S>>
Constructors
RankingAndPreferenceSelection
public RankingAndPreferenceSelection(int solutionsToSelect, List<Double> interestPoint, double epsilon)

Constructor

Methods
addLastRankedSolutionsToPopulation
protected void addLastRankedSolutionsToPopulation(Ranking<S> ranking, int rank, List<S> population)
addRankedSolutionsToPopulation
protected void addRankedSolutionsToPopulation(Ranking<S> ranking, int rank, List<S> population)
execute
public List<S> execute(List<S> solutionList)
getNumberOfSolutionsToSelect
public int getNumberOfSolutionsToSelect()
preferenceDistanceSelection
protected List<S> preferenceDistanceSelection(Ranking<S> ranking, int numberOfObjectives)
subfrontFillsIntoThePopulation
protected boolean subfrontFillsIntoThePopulation(Ranking<S> ranking, int rank, List<S> population)

TournamentSelection

public class TournamentSelection<S extends Solution<?>> implements SelectionOperator<List<S>, S>
Author:Juanjo
Constructors
TournamentSelection
public TournamentSelection(int numberOfTournaments)

Constructor

TournamentSelection
public TournamentSelection(Comparator<S> comparator, int numberOfTournaments)

Constructor

Methods
execute
public S execute(List<S> solutionList)

TournamentSelectionTest

public class TournamentSelectionTest

Created by ajnebro on 3/5/15.

Fields
exception
public ExpectedException exception
Methods
shouldConstructorAssignTheCorrectValueSToTheNumberOfTournamentsAndTheComparator
public void shouldConstructorAssignTheCorrectValueSToTheNumberOfTournamentsAndTheComparator()
shouldConstructorAssignTheCorrectValueToTheNumberOfTournaments
public void shouldConstructorAssignTheCorrectValueToTheNumberOfTournaments()
shouldExecuteRaiseAnExceptionIfTheSolutionListIsEmpty
public void shouldExecuteRaiseAnExceptionIfTheSolutionListIsEmpty()
shouldExecuteRaiseAnExceptionIfTheSolutionListIsNull
public void shouldExecuteRaiseAnExceptionIfTheSolutionListIsNull()
shouldExecuteReturnAnElementIfTheListHasOneElement
public void shouldExecuteReturnAnElementIfTheListHasOneElement()

org.uma.jmetal.problem

BinaryProblem

public interface BinaryProblem extends Problem<BinarySolution>

Interface representing binary problems

Author:Antonio J. Nebro
Methods
getNumberOfBits
public int getNumberOfBits(int index)
getTotalNumberOfBits
public int getTotalNumberOfBits()

ConstrainedProblem

public interface ConstrainedProblem<S> extends Problem<S>

Interface representing problems having constraints

Author:Antonio J. Nebro
Methods
evaluateConstraints
public void evaluateConstraints(S solution)
getNumberOfConstraints
public int getNumberOfConstraints()

DoubleBinaryProblem

public interface DoubleBinaryProblem<S> extends Problem<S>

Interface representing problems having integer and double variables

Author:Antonio J. Nebro
Methods
getLowerBound
public Number getLowerBound(int index)
getNumberOfBits
public int getNumberOfBits()
getNumberOfDoubleVariables
public int getNumberOfDoubleVariables()
getUpperBound
public Number getUpperBound(int index)

DoubleProblem

public interface DoubleProblem extends Problem<DoubleSolution>

Interface representing continuous problems

Author:Antonio J. Nebro
Methods
getLowerBound
Double getLowerBound(int index)
getUpperBound
Double getUpperBound(int index)

IntegerDoubleProblem

public interface IntegerDoubleProblem<S> extends Problem<S>

Interface representing problems having integer and double variables

Author:Antonio J. Nebro
Methods
getLowerBound
public Number getLowerBound(int index)
getNumberOfDoubleVariables
public int getNumberOfDoubleVariables()
getNumberOfIntegerVariables
public int getNumberOfIntegerVariables()
getUpperBound
public Number getUpperBound(int index)

IntegerProblem

public interface IntegerProblem extends Problem<IntegerSolution>

Interface representing integer problems

Author:Antonio J. Nebro
Methods
getLowerBound
public Integer getLowerBound(int index)
getUpperBound
public Integer getUpperBound(int index)

PermutationProblem

public interface PermutationProblem<S extends PermutationSolution<?>> extends Problem<S>

Interface representing permutation problems

Author:Antonio J. Nebro
Methods
getPermutationLength
public int getPermutationLength()

Problem

public interface Problem<S> extends Serializable

Interface representing a multi-objective optimization problem

Author:

Antonio J. Nebro

Parameters:
  • <S> – Encoding
Methods
createSolution
S createSolution()
evaluate
void evaluate(S solution)
getName
String getName()
getNumberOfConstraints
int getNumberOfConstraints()
getNumberOfObjectives
int getNumberOfObjectives()
getNumberOfVariables
int getNumberOfVariables()

org.uma.jmetal.problem.impl

AbstractBinaryProblem

public abstract class AbstractBinaryProblem extends AbstractGenericProblem<BinarySolution> implements BinaryProblem
Methods
createSolution
public BinarySolution createSolution()
getBitsPerVariable
protected abstract int getBitsPerVariable(int index)
getNumberOfBits
public int getNumberOfBits(int index)
getTotalNumberOfBits
public int getTotalNumberOfBits()

AbstractDoubleProblem

public abstract class AbstractDoubleProblem extends AbstractGenericProblem<DoubleSolution> implements DoubleProblem
Methods
createSolution
public DoubleSolution createSolution()
getLowerBound
public Double getLowerBound(int index)
getUpperBound
public Double getUpperBound(int index)
setLowerLimit
protected void setLowerLimit(List<Double> lowerLimit)
setUpperLimit
protected void setUpperLimit(List<Double> upperLimit)

AbstractGenericProblem

public abstract class AbstractGenericProblem<S> implements Problem<S>
Methods
getName
public String getName()
getNumberOfConstraints
public int getNumberOfConstraints()
getNumberOfObjectives
public int getNumberOfObjectives()
getNumberOfVariables
public int getNumberOfVariables()
setName
protected void setName(String name)
setNumberOfConstraints
protected void setNumberOfConstraints(int numberOfConstraints)
setNumberOfObjectives
protected void setNumberOfObjectives(int numberOfObjectives)
setNumberOfVariables
protected void setNumberOfVariables(int numberOfVariables)

AbstractIntegerDoubleProblem

public abstract class AbstractIntegerDoubleProblem<S> extends AbstractGenericProblem<S> implements IntegerDoubleProblem<S>
Methods
getLowerBound
public Number getLowerBound(int index)
getNumberOfDoubleVariables
public int getNumberOfDoubleVariables()
getNumberOfIntegerVariables
public int getNumberOfIntegerVariables()
getUpperBound
public Number getUpperBound(int index)
setLowerLimit
protected void setLowerLimit(List<Number> lowerLimit)
setNumberOfDoubleVariables
protected void setNumberOfDoubleVariables(int numberOfDoubleVariables)
setNumberOfIntegerVariables
protected void setNumberOfIntegerVariables(int numberOfIntegerVariables)
setUpperLimit
protected void setUpperLimit(List<Number> upperLimit)

AbstractIntegerPermutationProblem

public abstract class AbstractIntegerPermutationProblem extends AbstractGenericProblem<PermutationSolution<Integer>> implements PermutationProblem<PermutationSolution<Integer>>
Methods
createSolution
public PermutationSolution<Integer> createSolution()

AbstractIntegerProblem

public abstract class AbstractIntegerProblem extends AbstractGenericProblem<IntegerSolution> implements IntegerProblem
Methods
createSolution
public IntegerSolution createSolution()
getLowerBound
public Integer getLowerBound(int index)
getUpperBound
public Integer getUpperBound(int index)
setLowerLimit
protected void setLowerLimit(List<Integer> lowerLimit)
setUpperLimit
protected void setUpperLimit(List<Integer> upperLimit)

org.uma.jmetal.problem.multiobjective

Binh2

public class Binh2 extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Binh2

Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
Binh2
public Binh2()

Constructor Creates a default instance of the Binh2 problem

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

ConstrEx

public class ConstrEx extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem ConstrEx

Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
ConstrEx
public ConstrEx()

Constructor Creates a default instance of the ConstrEx problem

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

Fonseca

public class Fonseca extends AbstractDoubleProblem

Class representing problem Fonseca

Constructors
Fonseca
public Fonseca()

Constructor

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

FourBarTruss

public class FourBarTruss extends AbstractDoubleProblem

Class representing problem FourBarTruss Measures: f = 10kN e = 200000 kN/cm2 l = 200 cm sigma = 10kN/cm2

Constructors
FourBarTruss
public FourBarTruss()

Constructor Creates a default instance of the FourBarTruss problem

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

Golinski

public class Golinski extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Golinski.

Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
Golinski
public Golinski()

Constructor. Creates a default instance of the Golinski problem.

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

Kursawe

public class Kursawe extends AbstractDoubleProblem

Class representing problem Kursawe

Constructors
Kursawe
public Kursawe()

Constructor. Creates a default instance (3 variables) of the Kursawe problem

Kursawe
public Kursawe(Integer numberOfVariables)

Constructor. Creates a new instance of the Kursawe problem.

Parameters:
  • numberOfVariables – Number of variables of the problem
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

MultiobjectiveTSP

public class MultiobjectiveTSP extends AbstractIntegerPermutationProblem

Class representing a bi-objective TSP (Traveling Salesman Problem) problem. It accepts data files from TSPLIB: http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/tsp/

Fields
costMatrix
protected double[][] costMatrix
distanceMatrix
protected double[][] distanceMatrix
numberOfCities
protected int numberOfCities
Constructors
MultiobjectiveTSP
public MultiobjectiveTSP(String distanceFile, String costFile)

Creates a new MultiobjectiveTSP problem instance

Methods
evaluate
public void evaluate(PermutationSolution<Integer> solution)

Evaluate() method

getPermutationLength
public int getPermutationLength()

NMMin

public class NMMin extends AbstractIntegerProblem

Created by Antonio J. Nebro on 03/07/14. Bi-objective problem for testing integer encoding. Objective 1: minimizing the distance to value N Objective 2: minimizing the distance to value M

Constructors
NMMin
public NMMin()
NMMin
public NMMin(int numberOfVariables, int n, int m, int lowerBound, int upperBound)

Constructor

Methods
evaluate
public void evaluate(IntegerSolution solution)

Evaluate() method

NMMin2

public class NMMin2 extends AbstractIntegerDoubleProblem<IntegerDoubleSolution>

Created by Antonio J. Nebro on 18/09/14. Bi-objective problem for testing integer/double encoding. Objective 1: minimizing the distance to value N Objective 2: minimizing the distance to value M

Constructors
NMMin2
public NMMin2()
NMMin2
public NMMin2(int numberOfIntegerVariables, int numberOfDoubleVariables, int n, int m, int lowerBound, int upperBound)

Constructor

Methods
createSolution
public IntegerDoubleSolution createSolution()
evaluate
public void evaluate(IntegerDoubleSolution solution)

Evaluate() method

NMMinTest

public class NMMinTest

Created by Antonio J. Nebro on 17/09/14.

Fields
problem
Problem<IntegerSolution> problem
Methods
evaluateSimpleSolutions
public void evaluateSimpleSolutions()

OneZeroMax

public class OneZeroMax extends AbstractBinaryProblem

Class representing problem OneZeroMax. The problem consist of maximizing the number of ‘1’s and ‘0’s in a binary string.

Constructors
OneZeroMax
public OneZeroMax()

Constructor

OneZeroMax
public OneZeroMax(Integer numberOfBits)

Constructor

Methods
createSolution
public BinarySolution createSolution()
evaluate
public void evaluate(BinarySolution solution)

Evaluate() method

getBitsPerVariable
protected int getBitsPerVariable(int index)

Osyczka2

public class Osyczka2 extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Oyczka2

Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
Osyczka2
public Osyczka2()

Constructor. Creates a default instance of the Osyczka2 problem.

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

Schaffer

public class Schaffer extends AbstractDoubleProblem

Class representing problem Schaffer

Constructors
Schaffer
public Schaffer()

Constructor. Creates a default instance of problem Schaffer

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

Srinivas

public class Srinivas extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Srinivas

Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
Srinivas
public Srinivas()

Constructor

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

Tanaka

public class Tanaka extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Tanaka

Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
Tanaka
public Tanaka()

Constructor. Creates a default instance of the problem Tanaka

Methods
evaluate
public void evaluate(DoubleSolution solution)
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

Viennet2

public class Viennet2 extends AbstractDoubleProblem

Class representing problem Viennet2

Constructors
Viennet2
public Viennet2()

Constructor. Creates a default instance of the Viennet2 problem

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

Viennet3

public class Viennet3 extends AbstractDoubleProblem

Class representing problem Viennet3

Constructors
Viennet3
public Viennet3()

Constructor. Creates a default instance of the Viennet3 problem.

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

Viennet4

public class Viennet4 extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Viennet4

Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
Viennet4
public Viennet4()

Constructor. Creates a default instance of the Viennet4 problem.

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

Water

public class Water extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Water

Fields
LOWERLIMIT
public static final Double[] LOWERLIMIT
UPPERLIMIT
public static final Double[] UPPERLIMIT
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
Water
public Water()

Constructor. Creates a default instance of the Water problem.

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

EvaluateConstraints() method

org.uma.jmetal.problem.multiobjective.UF

UF1

public class UF1 extends AbstractDoubleProblem

Class representing problem CEC2009_UF1

Constructors
UF1
public UF1()

Constructor. Creates a default instance of problem CEC2009_UF1 (30 decision variables)

UF1
public UF1(int numberOfVariables)

Creates a new instance of problem CEC2009_UF1.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF10

public class UF10 extends AbstractDoubleProblem

Class representing problem CEC2009_UF10

Constructors
UF10
public UF10()

Constructor. Creates a default instance of problem CEC2009_UF10 (30 decision variables)

UF10
public UF10(int numberOfVariables)

Creates a new instance of problem CEC2009_UF10.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF2

public class UF2 extends AbstractDoubleProblem

Class representing problem CEC2009_UF2

Constructors
UF2
public UF2()

Constructor. Creates a default instance of problem CEC2009_UF2 (30 decision variables)

UF2
public UF2(int numberOfVariables)

Creates a new instance of problem CEC2009_UF2.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF3

public class UF3 extends AbstractDoubleProblem

Class representing problem CEC2009_UF3

Constructors
UF3
public UF3()

Constructor. Creates a default instance of problem CEC2009_UF3 (30 decision variables)

UF3
public UF3(int numberOfVariables)

Creates a new instance of problem CEC2009_UF3.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF4

public class UF4 extends AbstractDoubleProblem

Class representing problem CEC2009_UF4

Constructors
UF4
public UF4()

Constructor. Creates a default instance of problem CEC2009_UF4 (30 decision variables)

UF4
public UF4(Integer numberOfVariables)

Creates a new instance of problem CEC2009_UF4.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF5

public class UF5 extends AbstractDoubleProblem

Class representing problem CEC2009_UF5

Fields
epsilon
double epsilon
n
int n
Constructors
UF5
public UF5()

Constructor. Creates a default instance of problem CEC2009_UF5 (30 decision variables)

UF5
public UF5(int numberOfVariables, int N, double epsilon)

Creates a new instance of problem CEC2009_UF5.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF6

public class UF6 extends AbstractDoubleProblem

Class representing problem CEC2009_UF5

Fields
epsilon
double epsilon
n
int n
Constructors
UF6
public UF6()

Constructor. Creates a default instance of problem CEC2009_UF6 (30 decision variables, N =10, epsilon = 0.1)

UF6
public UF6(Integer numberOfVariables, int N, double epsilon)

Creates a new instance of problem CEC2009_UF6.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF7

public class UF7 extends AbstractDoubleProblem

Class representing problem CEC2009_UF7

Constructors
UF7
public UF7()

Constructor. Creates a default instance of problem CEC2009_UF7 (30 decision variables)

UF7
public UF7(int numberOfVariables)

Creates a new instance of problem CEC2009_UF7.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF8

public class UF8 extends AbstractDoubleProblem

Class representing problem CEC2009_UF8

Constructors
UF8
public UF8()

Constructor. Creates a default instance of problem CEC2009_UF8 (30 decision variables)

UF8
public UF8(int numberOfVariables)

Creates a new instance of problem CEC2009_UF8.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

UF9

public class UF9 extends AbstractDoubleProblem

Class representing problem CEC2009_UF9

Fields
epsilon
double epsilon
Constructors
UF9
public UF9()

Constructor. Creates a default instance of problem CEC2009_UF9 (30 decision variables, epsilon = 0.1)

UF9
public UF9(int numberOfVariables, double epsilon)

Creates a new instance of problem CEC2009_UF9.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

org.uma.jmetal.problem.multiobjective.cdtlz

C1_DTLZ1

public class C1_DTLZ1 extends DTLZ1 implements ConstrainedProblem<DoubleSolution>

Problem C1-DTLZ1, defined in: Jain, H. and K. Deb. “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach.” EEE Transactions on Evolutionary Computation, 18(4):602-622, 2014.

Author:Antonio J. Nebro
Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
C1_DTLZ1
public C1_DTLZ1(int numberOfVariables, int numberOfObjectives)

Constructor

Parameters:
  • numberOfVariables
  • numberOfObjectives
Methods
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

C1_DTLZ3

public class C1_DTLZ3 extends DTLZ3 implements ConstrainedProblem<DoubleSolution>

Problem C1-DTLZ3, defined in: Jain, H. and K. Deb. “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach.” EEE Transactions on Evolutionary Computation, 18(4):602-622, 2014.

Author:Antonio J. Nebro
Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
C1_DTLZ3
public C1_DTLZ3(int numberOfVariables, int numberOfObjectives)

Constructor

Parameters:
  • numberOfVariables
  • numberOfObjectives
Methods
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

C2_DTLZ2

public class C2_DTLZ2 extends DTLZ2 implements ConstrainedProblem<DoubleSolution>

Problem C2-DTLZ2, defined in: Jain, H. and K. Deb. “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach.” EEE Transactions on Evolutionary Computation, 18(4):602-622, 2014.

Author:Antonio J. Nebro
Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
C2_DTLZ2
public C2_DTLZ2(int numberOfVariables, int numberOfObjectives)

Constructor

Parameters:
  • numberOfVariables
  • numberOfObjectives
Methods
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

C3_DTLZ1

public class C3_DTLZ1 extends DTLZ1 implements ConstrainedProblem<DoubleSolution>

Problem C3-DTLZ1, defined in: Jain, H. and K. Deb. “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach.” EEE Transactions on Evolutionary Computation, 18(4):602-622, 2014.

Author:Antonio J. Nebro
Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
C3_DTLZ1
public C3_DTLZ1(int numberOfVariables, int numberOfObjectives, int numberOfConstraints)

Constructor

Parameters:
  • numberOfVariables
  • numberOfObjectives
Methods
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

C3_DTLZ4

public class C3_DTLZ4 extends DTLZ4 implements ConstrainedProblem<DoubleSolution>

Problem C3-DTLZ4, defined in: Jain, H. and K. Deb. “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach.” EEE Transactions on Evolutionary Computation, 18(4):602-622, 2014.

Author:Antonio J. Nebro
Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
C3_DTLZ4
public C3_DTLZ4(int numberOfVariables, int numberOfObjectives, int numberOfConstraints)

Constructor

Parameters:
  • numberOfVariables
  • numberOfObjectives
Methods
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

ConvexC2_DTLZ2

public class ConvexC2_DTLZ2 extends DTLZ2 implements ConstrainedProblem<DoubleSolution>

Problem ConvexC2-DTLZ2, defined in: Jain, H. and K. Deb. “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach.” EEE Transactions on Evolutionary Computation, 18(4):602-622, 2014.

Author:Antonio J. Nebro
Fields
numberOfViolatedConstraints
public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints
overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
Constructors
ConvexC2_DTLZ2
public ConvexC2_DTLZ2(int numberOfVariables, int numberOfObjectives)

Constructor

Parameters:
  • numberOfVariables
  • numberOfObjectives
Methods
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

org.uma.jmetal.problem.multiobjective.cec2015OptBigDataCompetition

BigOpt2015

public class BigOpt2015 extends AbstractDoubleProblem

Created by ajnebro on 14/1/15.

Fields
dTypeG
int dTypeG
f1max
double f1max
f1min
double f1min
f2max
double f2max
f2min
double f2min
scaling
boolean scaling
Constructors
BigOpt2015
public BigOpt2015(String instanceName)

Constructor

Methods
correlation
List<List<Double>> correlation(List<List<Double>> list1, List<List<Double>> list2)
diagonal1
double diagonal1(List<List<Double>> list)
diagonal2
double diagonal2(List<List<Double>> list)
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

multiplyWithOutAMP
List<List<Double>> multiplyWithOutAMP(List<List<Double>> list1, List<List<Double>> list2)
newMeanStandardDeviation
List<Double> newMeanStandardDeviation(List<Double> list)
vectorCorrelation
double vectorCorrelation(List<Double> list1, List<Double> list2)

org.uma.jmetal.problem.multiobjective.dtlz

DTLZ1

public class DTLZ1 extends AbstractDoubleProblem

Class representing problem DTLZ1

Constructors
DTLZ1
public DTLZ1()

Creates a default DTLZ1 problem (7 variables and 3 objectives)

DTLZ1
public DTLZ1(Integer numberOfVariables, Integer numberOfObjectives)

Creates a DTLZ1 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

DTLZ2

public class DTLZ2 extends AbstractDoubleProblem

Class representing problem DTLZ1

Constructors
DTLZ2
public DTLZ2()

Creates a default DTLZ2 problem (12 variables and 3 objectives)

DTLZ2
public DTLZ2(Integer numberOfVariables, Integer numberOfObjectives)

Creates a DTLZ2 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

DTLZ3

public class DTLZ3 extends AbstractDoubleProblem

Class representing problem DTLZ3

Constructors
DTLZ3
public DTLZ3()

Creates a default DTLZ3 problem (12 variables and 3 objectives)

DTLZ3
public DTLZ3(Integer numberOfVariables, Integer numberOfObjectives)

Creates a DTLZ3 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

DTLZ4

public class DTLZ4 extends AbstractDoubleProblem

Class representing problem DTLZ4

Constructors
DTLZ4
public DTLZ4()

Creates a default DTLZ4 problem (12 variables and 3 objectives)

DTLZ4
public DTLZ4(Integer numberOfVariables, Integer numberOfObjectives)

Creates a DTLZ4 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

DTLZ5

public class DTLZ5 extends AbstractDoubleProblem

Class representing problem DTLZ5

Constructors
DTLZ5
public DTLZ5()

Creates a default DTLZ5 problem (12 variables and 3 objectives)

DTLZ5
public DTLZ5(Integer numberOfVariables, Integer numberOfObjectives)

Creates a DTLZ5 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

DTLZ6

public class DTLZ6 extends AbstractDoubleProblem

Class representing problem DTLZ6

Constructors
DTLZ6
public DTLZ6()

Creates a default DTLZ6 problem (12 variables and 3 objectives)

DTLZ6
public DTLZ6(Integer numberOfVariables, Integer numberOfObjectives)

Creates a DTLZ6 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

DTLZ7

public class DTLZ7 extends AbstractDoubleProblem

Class representing problem DTLZ7

Constructors
DTLZ7
public DTLZ7()

Creates a default DTLZ7 problem (22 variables and 3 objectives)

DTLZ7
public DTLZ7(Integer numberOfVariables, Integer numberOfObjectives)

Creates a DTLZ7 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

org.uma.jmetal.problem.multiobjective.ebes

Ebes

public class Ebes extends AbstractDoubleProblem implements ConstrainedProblem<DoubleSolution>

Class representing problem Ebes Spatial Bars Structure (Estructuras de Barras Espaciales)

Fields
AREA
int AREA
ART_ART
int ART_ART
ART_RIG
int ART_RIG
AxialForcei_
protected double[] AxialForcei_

Stores the Axial force in node i

AxialForcej_
protected double[] AxialForcej_

Stores the Axial force in node j

Ay_
int Ay_
Az_
int Az_
BETA
int BETA
BLijY
int BLijY_
BLijZ
int BLijZ_
CARGA_MOMENTO_DISTRIBUIDO
int CARGA_MOMENTO_DISTRIBUIDO
CARGA_MOMENTO_PUNTUAL
int CARGA_MOMENTO_PUNTUAL
CARGA_PARABOLICA
int CARGA_PARABOLICA
CARGA_PUNTUAL
int CARGA_PUNTUAL
CARGA_TEMPERATURA
int CARGA_TEMPERATURA
CARGA_TRIANGULAR_I
int CARGA_TRIANGULAR_I
CARGA_UNIFORME_PARCIAL
int CARGA_UNIFORME_PARCIAL
CARGA_UNIFORME_TOTAL
int CARGA_UNIFORME_TOTAL
CARGA__TRIANGULAR_J
int CARGA__TRIANGULAR_J
CIRCLE
public static final int CIRCLE
COMPRESSION
int COMPRESSION
CONSTRAINT
int CONSTRAINT
DESCRIPTION
int DESCRIPTION
DisplacementNodes_
protected double[][] DisplacementNodes_

Stores the k displacement

ELONGATION_NEG
int ELONGATION_NEG
ELONGATION_POS
int ELONGATION_POS
E
int E_
Efforti_
protected double[][][] Efforti_

Stores the Effort in node i

Effortj_
protected double[][][] Effortj_

Stores the Effort in node j

Ei
int Ei_
Ej
int Ej_
Element
protected double[][] Element_

Stores the Element

Fyz
int Fyz_
GROUP
int GROUP_
G_
int G_
GravitationalAxis
String GravitationalAxis_
Groups
protected double[][] Groups_

Stores the Groups

HOLE_CIRCLE
public static final int HOLE_CIRCLE
HOLE_RECTANGLE
public static final int HOLE_RECTANGLE
H_DOUBLE
public static final int H_DOUBLE
H_SINGLE
public static final int H_SINGLE
INDEX
int INDEX_
I_DOUBLE
public static final int I_DOUBLE
I_SINGLE
public static final int I_SINGLE
It
int It_
Iw
int Iw_
Iy
int Iy_
Iz
int Iz_
KGii
double[][] KGii
KGij
double[][] KGij
KGji
double[][] KGji
KGjj
double[][] KGjj
Kii
double[][] Kii
KiiSOG
double[][] KiiSOG
Kij
double[][] Kij
KijSOG
double[][] KijSOG
Kji
double[][] Kji
KjiSOG
double[][] KjiSOG
Kjj
double[][] Kjj
KjjSOG
double[][] KjjSOG
L
int L_
L_DOUBLE
public static final int L_DOUBLE
L_SINGLE
public static final int L_SINGLE
Li
int Li_
Lj
int Lj_
MAX_COLUMN
int MAX_COLUMN
MatrixStiffness_
protected double[] MatrixStiffness_

Stores the k

MxyMax
protected double[][] MxyMax_

Stores the max Mxy for groups

MxyMin
protected double[][] MxyMin_

Stores the min Mxy for groups

MxzMax
protected double[][] MxzMax_

Stores the max Mxz for groups

MxzMin
protected double[][] MxzMin_

Stores the max Mxz for groups

NodeRestrict
protected double[][] NodeRestrict_

Stores the NodeRestrict

Node
protected double[][] Node_

Stores the Node

NxxMax
protected double[][] NxxMax_

Stores the max Nxx for groups

NxxMin
protected double[][] NxxMin_

Stores the min Nxx for groups

OF
String[] OF_
OldStrainMax
protected double[][] OldStrainMax_

Stores the max Strain for elements

OldStrainMin
protected double[][] OldStrainMin_
OverloadInElement
protected double[][] OverloadInElement_

Stores the OverLoad on Elements

PQ
double[][] PQ
QAx
int QAx_
QAy
int QAy_
QAz
int QAz_
QE
int QE_
QH
int QH_
QT
int QT_
Qa
int Qa_
Qb
int Qb_
Qi
double[] Qi
Qj
double[] Qj
RATIO_YZ
int RATIO_YZ
RECTANGLE
public static final int RECTANGLE
RIG_ART
int RIG_ART
RIG_RIG
int RIG_RIG
RTij
double[][] RTij
RTji
double[][] RTji
Reaction
double Reaction_
Rij
double[][] Rij
Rji
double[][] Rji
RpTij
double[][] RpTij
RpTji
double[][] RpTji
Rpij
double[][] Rpij
Rpji
double[][] Rpji
SHAPE
int SHAPE
SPECIFIC_WEIGHT
int SPECIFIC_WEIGHT
STRAIN_COMPRESS
int STRAIN_COMPRESS
STRAIN_CUT
int STRAIN_CUT
STRAIN_TRACTION
int STRAIN_TRACTION
STRESS
int STRESS
STRESS_CUT
int STRESS_CUT
StrainCutMax
protected double[][] StrainCutMax_

Stores the max Strain for elements

StrainMax
protected double[][] StrainMax_

Stores the max Strain for elements

StrainMin
protected double[][] StrainMin_
StrainMxyMax
protected double[][] StrainMxyMax_

Stores the max Mxz Strain for groups

StrainMxyMin
protected double[][] StrainMxyMin_

Stores the max Mxz Strain for groups

StrainMxzMax
protected double[][] StrainMxzMax_

Stores the max Mxz Strain for groups

StrainMxzMin
protected double[][] StrainMxzMin_

Stores the max Mxz Strain for groups

StrainNxxMax
protected double[][] StrainNxxMax_

Stores the max Nxx Strain for groups

StrainNxxMin
protected double[][] StrainNxxMin_
StrainResidualCut
protected double[] StrainResidualCut_

Stores the Cut Strain Residual for elements

StrainResidualMax
protected double[] StrainResidualMax_

Stores the max Strain for elements

StrainResidualMin
protected double[] StrainResidualMin_

Stores the min Strain for elements

Straini_
protected double[][][] Straini_

Stores the Strain in node i

Strainj
protected double[][][] Strainj_

Stores the Strain in node j

T_DOUBLE
public static final int T_DOUBLE
T_SINGLE
public static final int T_SINGLE
TypeMaterial
int TypeMaterial_
VARIABLES
int VARIABLES
VAR_POSITION
int VAR_POSITION
VAR_Y_LOWER_LIMIT
int VAR_Y_LOWER_LIMIT
VAR_Y_UPPER_LIMIT
int VAR_Y_UPPER_LIMIT
VAR_Z_LOWER_LIMIT
int VAR_Z_LOWER_LIMIT
VAR_Z_UPPER_LIMIT
int VAR_Z_UPPER_LIMIT
VAR_eY_LOWER_LIMIT
int VAR_eY_LOWER_LIMIT
VAR_eY_UPPER_LIMIT
int VAR_eY_UPPER_LIMIT
VAR_eZ_LOWER_LIMIT
int VAR_eZ_LOWER_LIMIT
VAR_eZ_UPPER_LIMIT
int VAR_eZ_UPPER_LIMIT
Vij
int Vij_
WeightElement
protected double[][] WeightElement_

Stores the Load on Elements Itself

WeightNode
protected double[][] WeightNode_

Stores the Load on Nodes

Y
int Y_
Z
int Z_
aX
int aX_
aY_
int aY_
aZ_
int aZ_
cbi
double[][][] cbi
cbj
double[][][] cbj
dY
int dY_
eY
int eY_
eZ
int eZ_
elementsBetweenDiffGreat
protected int elementsBetweenDiffGreat_

Stores the Elements Between Difference Greatest

gX
int gX_
gY
int gY_
gZ
int gZ_
g_
double g_
geometryCheck_
protected int[][] geometryCheck_
i
int i_
j
int j_
lBuckling
public boolean lBuckling
lLoadsOwnWeight
public boolean lLoadsOwnWeight
lSecondOrderGeometric
public boolean lSecondOrderGeometric
lZ
int lZ_
matrixWidthBand
protected int matrixWidthBand_

Stores the number a wide the diagonal matrix

nodeCheck_
protected double[][] nodeCheck_

Stores the number of Nodes of the problem

numberOfConstraintsGeometric
public int numberOfConstraintsGeometric_
numberOfConstraintsNodes
protected int numberOfConstraintsNodes_
numberOfElements
protected int numberOfElements_

Stores the number of Bar of the problem

numberOfEval
protected int numberOfEval_

Stores the number of Bar Groups

numberOfGroupElements
protected int numberOfGroupElements_

Stores the number of Bar Groups

numberOfGroupsToCheckGeometry
protected int numberOfGroupsToCheckGeometry_
numberOfLibertyDegree
protected int numberOfLibertyDegree_

Stores the number of Nodes of the problem

numberOfNodes
protected int numberOfNodes
numberOfNodesRestricts_
protected int numberOfNodesRestricts_
numberOfWeigthHypothesis
protected int numberOfWeigthHypothesis_
numberOfWeigthsElements
protected int numberOfWeigthsElements_

Stores the number of Load in ElementsNodes of the problem

numberOfWeigthsNodes
protected int numberOfWeigthsNodes_

Stores the number of Load in Nodes of the problem

omegaMax
protected double[][] omegaMax_

Stores the max omega for groups

overallConstraintViolationDegree
public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree
pi
double[] pi
pj
double[] pj
rZ
int rZ_
selectedOF
int selectedOF
strainAdmissibleCut
protected int strainAdmissibleCut_
uY
int uY_
Constructors
Ebes
public Ebes()
Ebes
public Ebes(String ebesFileName, String[] objectiveList)

Constructor

Throws:
  • FileNotFoundException
Methods
AxialForcei_
public double AxialForcei_(int element)
AxialForcej_
public double AxialForcej_(int element)
BucklingOmega
public double BucklingOmega(double Nxx, double[] G, double[] B)
DisplacementNodes
public double DisplacementNodes(int node, int hi)
EBEsAssignAxialForces
public void EBEsAssignAxialForces(int hi)
EBEsCalculus
public void EBEsCalculus()
EBEsEcuationSolution
public void EBEsEcuationSolution(int hi)
EBEsEffortsElements3D
public void EBEsEffortsElements3D(int hi, int countIter, double[][] Slip)
EBEsEffortsTotal3D
public void EBEsEffortsTotal3D(int hi)
EBEsElementsTopology
public void EBEsElementsTopology(DoubleSolution solution)
EBEsInitialize
public void EBEsInitialize(String file)
EBEsMat3DG
public void EBEsMat3DG(int e)
EBEsMat3DGij
public void EBEsMat3DGij()
EBEsMat3DL_SOG
public void EBEsMat3DL_SOG(int e)
EBEsMat3DL_iArt_jArt
public void EBEsMat3DL_iArt_jArt(int e)
EBEsMat3DL_iArt_jRig
public void EBEsMat3DL_iArt_jRig(int e)
EBEsMat3DL_iRig_jArt
public void EBEsMat3DL_iRig_jArt(int e)
EBEsMat3DL_iRig_jRig
public void EBEsMat3DL_iRig_jRig(int e)
EBEsMatRot3DLaG
public void EBEsMatRot3DLaG(int e)
EBEsMatRot3DLpSaL
public void EBEsMatRot3DLpSaL(int e)
EBEsMatrixAdd
public double[][] EBEsMatrixAdd(double[][] s, double[][] t)
EBEsMatrixGlobalFactory
public void EBEsMatrixGlobalFactory(int countIter)
EBEsMatrixGlobalPenalization
public void EBEsMatrixGlobalPenalization()
EBEsMatrixSubtractions
public double[][] EBEsMatrixSubtractions(double[][] s, double[][] t)
EBEsMatrixWeight
public void EBEsMatrixWeight(int hi)
EBEsMatrizMultiplicar
public double[][] EBEsMatrizMultiplicar(double[][] s, double[][] t)
EBEsMatrizTraspuesta
public double[][] EBEsMatrizTraspuesta(double[][] m)
EBEsMatrizVectorMultiplicar
public double[] EBEsMatrizVectorMultiplicar(double[][] s, double[] t)
EBEsNodesEquilibrium3D
public void EBEsNodesEquilibrium3D(int hi)
EBEsOverloadWeightElement
public void EBEsOverloadWeightElement()
EBEsPrintArchTxtDesp
public void EBEsPrintArchTxtDesp(int hi)
EBEsPrintArchTxtEfforts
public void EBEsPrintArchTxtEfforts(int hi)
EBEsPrintArchTxtElements
public void EBEsPrintArchTxtElements()
EBEsPrintArchTxtMKG
public void EBEsPrintArchTxtMKG(String s, int hi)
EBEsPrintArchTxtMKLB
public void EBEsPrintArchTxtMKLB(int e)
EBEsPrintArchTxtReaction
public void EBEsPrintArchTxtReaction(int hi)
EBEsPrintArchTxtStrain
public void EBEsPrintArchTxtStrain()
EBEsReactions3D
public void EBEsReactions3D(int hi)
EBEsReadDataFile
public final void EBEsReadDataFile(String fileName)
EBEsReadProblems
public String EBEsReadProblems()
EBEsSteelingResults
public void EBEsSteelingResults(int hi)
EBEsStrainMaxWhitElement
public void EBEsStrainMaxWhitElement()
EBEsStrainMaxWhitGroup
public void EBEsStrainMaxWhitGroup()
EBEsStrainMinWhitElement
public void EBEsStrainMinWhitElement()
EBEsStrainMinWhitGroup
public void EBEsStrainMinWhitGroup()
EBEsStrainNode
public double[][][] EBEsStrainNode(double[][][] E)
EBEsStrainResidualVerication
public void EBEsStrainResidualVerication()
EBEsTransversalSectionCircular
public void EBEsTransversalSectionCircular(int gr, double d)
EBEsTransversalSectionHoleCircular
public void EBEsTransversalSectionHoleCircular(int gr, double D, double e)
EBEsTransversalSectionHoleRectangle
public void EBEsTransversalSectionHoleRectangle(int gr, double y, double z, double ey, double ez)
EBEsTransversalSectionRectangle
public void EBEsTransversalSectionRectangle(int gr, double y, double z)
EBEsTransversalSection_H_Double
public void EBEsTransversalSection_H_Double(int gr, double y, double z, double ey, double ez)
EBEsTransversalSection_H_Single
public void EBEsTransversalSection_H_Single(int gr, double y, double z, double ey, double ez)
EBEsTransversalSection_I_Double
public void EBEsTransversalSection_I_Double(int gr, double y, double z, double ey, double ez)
EBEsTransversalSection_I_Single
public void EBEsTransversalSection_I_Single(int gr, double y, double z, double ey, double ez)
EBEsTransversalSection_L_Double
public void EBEsTransversalSection_L_Double(int gr, double y, double z, double ey, double ez)
EBEsTransversalSection_L_Single
public void EBEsTransversalSection_L_Single(int gr, double y, double z, double ey, double ez)
EBEsTransversalSection_T_Double
public void EBEsTransversalSection_T_Double(int ba, double y, double z, double ey, double ez)
EBEsTransversalSection_T_Single
public void EBEsTransversalSection_T_Single(int ba, double y, double z, double ey, double ez)
EBEsWeightDistributedUniformly
public void EBEsWeightDistributedUniformly(int el, double[] LoadInElement_)
EBEsWeightNodes
public void EBEsWeightNodes()
EBEsWeigthElement
public void EBEsWeigthElement()
Efforti
public double Efforti(int i, int element, int hypothesis)
Effortj
public double Effortj(int i, int element, int hypothesis)
FunctionENS
public double FunctionENS(int hi)
FunctionsMahalanobis_Distance_With_Variance
public double FunctionsMahalanobis_Distance_With_Variance(int hi)
Interpolation_I_Single_Y_func_Area
public double Interpolation_I_Single_Y_func_Area_(double A)
Interpolation_I_Single_Y_func_Wxy
public double Interpolation_I_Single_Y_func_Wxy_(double Wxy)
Interpolation_I_Single_Y_func_Wxz
public double Interpolation_I_Single_Y_func_Wxz_(double Wxz)
Interpolation_I_Single_Z_func_Y
public double Interpolation_I_Single_Z_func_Y_(double Y)
Interpolation_I_Single_ey_func_Y
public double Interpolation_I_Single_ey_func_Y_(double Y)
Interpolation_I_Single_ez_func_Y
public double Interpolation_I_Single_ez_func_Y_(double Y)
MatrixStiffness
public double MatrixStiffness(int i)
Straini
public double Straini(int i, int element, int hypothesis)
Variable_Position
public int Variable_Position()
createSolution
public DoubleSolution createSolution()
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate
evaluateConstraints
public void evaluateConstraints(DoubleSolution solution)

Evaluates the constraint overhead of a solution

Parameters:
  • solution – The solution
Throws:
geometryCheck
public int geometryCheck(int i, int j)
getElement
public double getElement(int i, int j)
getElementsBetweenDiffGreat
public int getElementsBetweenDiffGreat()
getGroupShape
public int getGroupShape(int groupId)
getGroups
public double getGroups(int i)
getMatrixWidthBand
public int getMatrixWidthBand()
getMxyMax
public double getMxyMax(int group, int hypothesis)
getMxyMin
public double getMxyMin(int group, int hypothesis)
getMxzMax
public double getMxzMax(int group, int hypothesis)
getMxzMin
public double getMxzMin(int group, int hypothesis)
getNode
public double getNode(int i, int j)
getNodeRestrict
public double getNodeRestrict(int i, int j)
getNumberOfConstraintsNodes
public int getNumberOfConstraintsNodes()
getNumberOfElements
public int getNumberOfElements()
getNumberOfNodes
public int getNumberOfNodes()
getNumberOfNodesRestricts
public int getNumberOfNodesRestricts()
getNumberOfWeigthHypothesis
public int getNumberOfWeigthHypothesis()
getNumberOfWeigthsElements
public int getNumberOfWeigthsElements()
getNumberOfWeigthsNodes
public int getNumberOfWeigthsNodes()
getNxxMax
public double getNxxMax(int group, int hypothesis)
getNxxMin
public double getNxxMin(int group, int hypothesis)
getOldStrainMax
public double getOldStrainMax(int group, int hypothesis)
getOldStrainMin
public double getOldStrainMin(int group, int hypothesis)
getOmegaMax
public double getOmegaMax(int group, int hypothesis)
getStrainAdmissibleCut
public int getStrainAdmissibleCut()
getStrainCutMax
public double getStrainCutMax(int group, int hypothesis)
getStrainMax
public double getStrainMax(int group, int hypothesis)
getStrainMin
public double getStrainMin(int group, int hypothesis)
getStrainMxyMax
public double getStrainMxyMax(int group, int hypothesis)
getStrainMxyMin
public double getStrainMxyMin(int group, int hypothesis)
getStrainMxzMax
public double getStrainMxzMax(int group, int hypothesis)
getStrainMxzMin
public double getStrainMxzMin(int group, int hypothesis)
getStrainNxxMax
public double getStrainNxxMax(int group, int hypothesis)
getStrainNxxMin
public double getStrainNxxMin(int group, int hypothesis)
getStrainResidualCut
public double getStrainResidualCut(int hypothesis)
getStrainResidualMax
public double getStrainResidualMax(int hypothesis)
getStrainResidualMin
public double getStrainResidualMin(int hypothesis)
getStrainj
public double getStrainj(int i, int element, int hypothesis)
getVariablePosition
public int getVariablePosition(int groupId)
getWeightElement
public double getWeightElement(int i, int j)
getWeightElementItself
public double getWeightElementItself(int i, int j)
getWeightNode
public double getWeightNode(int i, int j)
getnumberOfConstraintsGeometric
public int getnumberOfConstraintsGeometric()
getnumberOfGroupElements
public int getnumberOfGroupElements()
nodeCheck
public double nodeCheck(int i, int j)
numberOfNodesRestricts
public void numberOfNodesRestricts(int numberOfNodesRestricts)
setElementsBetweenDiffGreat
public void setElementsBetweenDiffGreat(int elementsBetweenDiffGreat)
setMatrixWidthBand
public void setMatrixWidthBand(int matrixWidthBand)
setNumberOfConstraintsNodes
public void setNumberOfConstraintsNodes(int numberOfConstraintsNodes)
setNumberOfElements
public void setNumberOfElements(int numberOfElements)
setNumberOfNodes
public void setNumberOfNodes(int numberOfNodes)
setNumberOfWeigthHypothesis
public void setNumberOfWeigthHypothesis(int numberOfWeigthHypothesis)
setNumberOfWeigthsElements
public void setNumberOfWeigthsElements(int numberOfWeigthsElements)
setNumberOfWeigthsNodes
public void setNumberOfWeigthsNodes(int numberOfWeigthsNodes)
setStrainAdmissibleCut
public void setStrainAdmissibleCut(int strainAdmissibleCut)
setnumberOfConstraintsGeometric
public void setnumberOfConstraintsGeometric(int i)
setnumberOfGroupElements
public void setnumberOfGroupElements(int i)

org.uma.jmetal.problem.multiobjective.glt

GLT1

public class GLT1 extends AbstractDoubleProblem

Problem GLT1. Defined in F. Gu, H.-L. Liu, and K. C. Tan, “A multiobjective evolutionary algorithm using dynamic weight design method,” International Journal of Innovative Computing, Information and Control, vol. 8, no. 5B, pp. 3677–3688, 2012.

Author:Antonio J. Nebro
Constructors
GLT1
public GLT1()

Default constructor

GLT1
public GLT1(int numberOfVariables)

Constructor

Parameters:
  • numberOfVariables
Methods
evaluate
public void evaluate(DoubleSolution solution)

GLT2

public class GLT2 extends AbstractDoubleProblem

Problem GLT2. Defined in F. Gu, H.-L. Liu, and K. C. Tan, “A multiobjective evolutionary algorithm using dynamic weight design method,” International Journal of Innovative Computing, Information and Control, vol. 8, no. 5B, pp. 3677–3688, 2012.

Author:Antonio J. Nebro
Constructors
GLT2
public GLT2()

Default constructor

GLT2
public GLT2(int numberOfVariables)

Constructor

Parameters:
  • numberOfVariables
Methods
evaluate
public void evaluate(DoubleSolution solution)

GLT3

public class GLT3 extends AbstractDoubleProblem

Problem GLT3. Defined in F. Gu, H.-L. Liu, and K. C. Tan, “A multiobjective evolutionary algorithm using dynamic weight design method,” International Journal of Innovative Computing, Information and Control, vol. 8, no. 5B, pp. 3677–3688, 2012.

Author:Antonio J. Nebro
Constructors
GLT3
public GLT3()

Default constructor

GLT3
public GLT3(int numberOfVariables)

Constructor

Parameters:
  • numberOfVariables
Methods
evaluate
public void evaluate(DoubleSolution solution)

GLT4

public class GLT4 extends AbstractDoubleProblem

Problem GLT4. Defined in F. Gu, H.-L. Liu, and K. C. Tan, “A multiobjective evolutionary algorithm using dynamic weight design method,” International Journal of Innovative Computing, Information and Control, vol. 8, no. 5B, pp. 3677–3688, 2012.

Author:Antonio J. Nebro
Constructors
GLT4
public GLT4()

Default constructor

GLT4
public GLT4(int numberOfVariables)

Constructor

Parameters:
  • numberOfVariables
Methods
evaluate
public void evaluate(DoubleSolution solution)

GLT5

public class GLT5 extends AbstractDoubleProblem

Problem GLT5. Defined in F. Gu, H.-L. Liu, and K. C. Tan, “A multiobjective evolutionary algorithm using dynamic weight design method,” International Journal of Innovative Computing, Information and Control, vol. 8, no. 5B, pp. 3677–3688, 2012.

Author:Antonio J. Nebro
Constructors
GLT5
public GLT5()

Default constructor

GLT5
public GLT5(int numberOfVariables)

Constructor

Parameters:
  • numberOfVariables
Methods
evaluate
public void evaluate(DoubleSolution solution)

GLT6

public class GLT6 extends AbstractDoubleProblem

Problem GLT6. Defined in F. Gu, H.-L. Liu, and K. C. Tan, “A multiobjective evolutionary algorithm using dynamic weight design method,” International Journal of Innovative Computing, Information and Control, vol. 8, no. 5B, pp. 3677–3688, 2012.

Author:Antonio J. Nebro
Constructors
GLT6
public GLT6()

Default constructor

GLT6
public GLT6(int numberOfVariables)

Constructor

Parameters:
  • numberOfVariables
Methods
evaluate
public void evaluate(DoubleSolution solution)

org.uma.jmetal.problem.multiobjective.lz09

LZ09

public class LZ09

Base class to implement the problem of the lz09 benchmark, which is defined in: H. Li and Q. Zhang. Multiobjective optimization problem with complicated pareto sets, MOEA/D and NSGA-II. IEEE Transactions on Evolutionary Computation, 12(2):284-302, April 2009.

Fields
dtype
int dtype
ltype
int ltype
nobj
int nobj
nvar
int nvar
ptype
int ptype
Constructors
LZ09
public LZ09(int nvar, int nobj, int ptype, int dtype, int ltype)
Methods
alphaFunction
void alphaFunction(double[] alpha, List<Double> x, int dim, int type)
betaFunction
double betaFunction(List<Double> x, int type)
objective
void objective(List<Double> xVar, List<Double> yObj)
psfunc2
double psfunc2(double x, double t1, int dim, int type, int css)
psfunc3
double psfunc3(double x, double t1, double t2, int dim, int type)

LZ09F1

public class LZ09F1 extends AbstractDoubleProblem

Class representing problem LZ09F1

Constructors
LZ09F1
public LZ09F1()

Creates a default LZ09F1 problem (10 variables and 2 objectives)

LZ09F1
public LZ09F1(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F1 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F2

public class LZ09F2 extends AbstractDoubleProblem

Class representing problem LZ09F2

Constructors
LZ09F2
public LZ09F2()

Creates a default LZ09F2 problem (30 variables and 3 objectives)

LZ09F2
public LZ09F2(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F2 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F3

public class LZ09F3 extends AbstractDoubleProblem

Class representing problem LZ09F3

Constructors
LZ09F3
public LZ09F3()

Creates a default LZ09F3 problem (30 variables and 2 objectives)

LZ09F3
public LZ09F3(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F3 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F4

public class LZ09F4 extends AbstractDoubleProblem

Class representing problem LZ09F4

Constructors
LZ09F4
public LZ09F4()

Creates a default LZ09F4 problem (30 variables and 2 objectives)

LZ09F4
public LZ09F4(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F4 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F5

public class LZ09F5 extends AbstractDoubleProblem

Class representing problem LZ09F5

Constructors
LZ09F5
public LZ09F5()

Creates a default LZ09F5 problem (30 variables and 2 objectives)

LZ09F5
public LZ09F5(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F5 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F6

public class LZ09F6 extends AbstractDoubleProblem

Class representing problem LZ09F6

Constructors
LZ09F6
public LZ09F6()

Creates a default LZ09F6 problem (30 variables and 2 objectives)

LZ09F6
public LZ09F6(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F6 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F7

public class LZ09F7 extends AbstractDoubleProblem

Class representing problem LZ09F7

Constructors
LZ09F7
public LZ09F7()

Creates a default LZ09F7 problem (10 variables and 2 objectives)

LZ09F7
public LZ09F7(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F7 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F8

public class LZ09F8 extends AbstractDoubleProblem

Class representing problem LZ09F8

Constructors
LZ09F8
public LZ09F8()

Creates a default LZ09F8 problem (10 variables and 2 objectives)

LZ09F8
public LZ09F8(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F8 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

LZ09F9

public class LZ09F9 extends AbstractDoubleProblem

Class representing problem LZ09F9

Constructors
LZ09F9
public LZ09F9()

Creates a default LZ09F9 problem (30 variables and 2 objectives)

LZ09F9
public LZ09F9(Integer ptype, Integer dtype, Integer ltype)

Creates a LZ09F9 problem instance

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

org.uma.jmetal.problem.multiobjective.maf

MaF01

public class MaF01 extends AbstractDoubleProblem

Class representing problem MaF01

Constructors
MaF01
public MaF01()

Default constructor

MaF01
public MaF01(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF01 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF02

public class MaF02 extends AbstractDoubleProblem

Class representing problem MaF02, DTLZ2BZ

Fields
const2
public static int const2
Constructors
MaF02
public MaF02()

Default constructor

MaF02
public MaF02(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF02 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF03

public class MaF03 extends AbstractDoubleProblem

Class representing problem MaF03, convex DTLZ3

Constructors
MaF03
public MaF03()

Default constructor

MaF03
public MaF03(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF03 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF04

public class MaF04 extends AbstractDoubleProblem

Class representing problem MaF04

Fields
const4
public static double const4
Constructors
MaF04
public MaF04()

Default constructor

MaF04
public MaF04(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF04 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF05

public class MaF05 extends AbstractDoubleProblem

Class representing problem MaF05

Fields
const5
public static double const5
Constructors
MaF05
public MaF05()

Default constructor

MaF05
public MaF05(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF05 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF06

public class MaF06 extends AbstractDoubleProblem

Class representing problem MaF06

Constructors
MaF06
public MaF06()

Default constructor

MaF06
public MaF06(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF06 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF07

public class MaF07 extends AbstractDoubleProblem

Class representing problem MaF07

Constructors
MaF07
public MaF07()

Default constructor

MaF07
public MaF07(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF07 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF08

public class MaF08 extends AbstractDoubleProblem

Class representing problem MaF08

Fields
const8
public static double const8
Constructors
MaF08
public MaF08()

Default constructor

MaF08
public MaF08(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF03 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate
nextPoint
public static double[] nextPoint(double arc, double[] startp, double r)
polygonpoints
public static double[][] polygonpoints(int m, double r)

MaF09

public class MaF09 extends AbstractDoubleProblem

Class representing problem MaF05

Fields
M9
public static int M9
maxinter9
public static int maxinter9
pindex9
public static int pindex9
points9
public static double points9
Constructors
MaF09
public MaF09()

Default constructor

MaF09
public MaF09(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF09 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
checkWithJdkGeneralPath
public static boolean checkWithJdkGeneralPath(Point2D.Double point, List<Point2D.Double> polygon)
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate
generV
public static double generV(double lb, double ub)
if_infeasible
public static boolean if_infeasible(double[] x)
if_inside_polygon
public static boolean if_inside_polygon(double[] p1, double[][] points)
intersection
public static double[] intersection(double[] kb1, double[] kb2)
line_of_twoP
public static double[] line_of_twoP(double[] p1, double[] p2)
lines_of_polygon
public double[][] lines_of_polygon(double[][] p)
polygonpoints
public static double[][] polygonpoints(int m, double r)

MaF10

public class MaF10 extends AbstractDoubleProblem

Class representing problem MaF10

Fields
K10
public static int K10
Constructors
MaF10
public MaF10()

Default constructor

MaF10
public MaF10(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF10 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF11

public class MaF11 extends AbstractDoubleProblem

Class representing problem MaF11

Fields
K11
public static int K11
Constructors
MaF11
public MaF11()

Default constructor

MaF11
public MaF11(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF11 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF12

public class MaF12 extends AbstractDoubleProblem

Class representing problem MaF12

Fields
K12
public static int K12
Constructors
MaF12
public MaF12()

Default constructor

MaF12
public MaF12(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF12 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF13

public class MaF13 extends AbstractDoubleProblem

Class representing problem MaF13

Constructors
MaF13
public MaF13()

Default constructor

MaF13
public MaF13(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF13 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

MaF14

public class MaF14 extends AbstractDoubleProblem

Class representing problem MaF14

Fields
nk14
public static int nk14
sublen14
public static int sublen14
Constructors
MaF14
public MaF14()

Default constructor

MaF14
public MaF14(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF14 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
Rastrigin
public static double Rastrigin(double[] x)
Rosenbrock
public static double Rosenbrock(double[] x)
evaluate
public void evaluate(DoubleSolution solution)

MaF15

public class MaF15 extends AbstractDoubleProblem

Class representing problem MaF15

Fields
nk15
public static int nk15
sublen15
public static int sublen15
Constructors
MaF15
public MaF15()

Default constructor

MaF15
public MaF15(Integer numberOfVariables, Integer numberOfObjectives)

Creates a MaF15 problem instance

Parameters:
  • numberOfVariables – Number of variables
  • numberOfObjectives – Number of objective functions
Methods
Griewank
public static double Griewank(double[] x)
Sphere
public static double Sphere(double[] x)
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to evaluate

org.uma.jmetal.problem.multiobjective.mop

MOP1

public class MOP1 extends AbstractDoubleProblem

Problem MOP1. Defined in H. L. Liu, F. Gu and Q. Zhang, “Decomposition of a Multiobjective Optimization Problem Into a Number of Simple Multiobjective Subproblems,” in IEEE Transactions on Evolutionary Computation, vol. 18, no. 3, pp. 450-455, June 2014.

Author:Mastermay
Constructors
MOP1
public MOP1()

Constructor. Creates default instance of problem MOP1 (10 decision variables)

MOP1
public MOP1(Integer numberOfVariables)

Creates a new instance of problem MOP1.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

MOP2

public class MOP2 extends AbstractDoubleProblem

Problem MOP2. Defined in H. L. Liu, F. Gu and Q. Zhang, “Decomposition of a Multiobjective Optimization Problem Into a Number of Simple Multiobjective Subproblems,” in IEEE Transactions on Evolutionary Computation, vol. 18, no. 3, pp. 450-455, June 2014.

Author:Mastermay
Constructors
MOP2
public MOP2()

Constructor. Creates default instance of problem MOP2 (10 decision variables)

MOP2
public MOP2(Integer numberOfVariables)

Creates a new instance of problem MOP2.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

MOP3

public class MOP3 extends AbstractDoubleProblem

Problem MOP3. Defined in H. L. Liu, F. Gu and Q. Zhang, “Decomposition of a Multiobjective Optimization Problem Into a Number of Simple Multiobjective Subproblems,” in IEEE Transactions on Evolutionary Computation, vol. 18, no. 3, pp. 450-455, June 2014.

Author:Mastermay
Constructors
MOP3
public MOP3()

Constructor. Creates default instance of problem MOP3 (10 decision variables)

MOP3
public MOP3(Integer numberOfVariables)

Creates a new instance of problem MOP3.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

MOP4

public class MOP4 extends AbstractDoubleProblem

Problem MOP4. Defined in H. L. Liu, F. Gu and Q. Zhang, “Decomposition of a Multiobjective Optimization Problem Into a Number of Simple Multiobjective Subproblems,” in IEEE Transactions on Evolutionary Computation, vol. 18, no. 3, pp. 450-455, June 2014.

Author:Mastermay
Constructors
MOP4
public MOP4()

Constructor. Creates default instance of problem MOP4 (10 decision variables)

MOP4
public MOP4(Integer numberOfVariables)

Creates a new instance of problem MOP4.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

MOP5

public class MOP5 extends AbstractDoubleProblem

Problem MOP5. Defined in H. L. Liu, F. Gu and Q. Zhang, “Decomposition of a Multiobjective Optimization Problem Into a Number of Simple Multiobjective Subproblems,” in IEEE Transactions on Evolutionary Computation, vol. 18, no. 3, pp. 450-455, June 2014.

Author:Mastermay
Constructors
MOP5
public MOP5()

Constructor. Creates default instance of problem MOP5 (10 decision variables)

MOP5
public MOP5(Integer numberOfVariables)

Creates a new instance of problem MOP5.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

MOP6

public class MOP6 extends AbstractDoubleProblem

Problem MOP6. Defined in H. L. Liu, F. Gu and Q. Zhang, “Decomposition of a Multiobjective Optimization Problem Into a Number of Simple Multiobjective Subproblems,” in IEEE Transactions on Evolutionary Computation, vol. 18, no. 3, pp. 450-455, June 2014.

Author:Mastermay
Constructors
MOP6
public MOP6()

Constructor. Creates default instance of problem MOP6 (10 decision variables)

MOP6
public MOP6(Integer numberOfVariables)

Creates a new instance of problem MOP6.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

MOP7

public class MOP7 extends AbstractDoubleProblem

Problem MOP7. Defined in H. L. Liu, F. Gu and Q. Zhang, “Decomposition of a Multiobjective Optimization Problem Into a Number of Simple Multiobjective Subproblems,” in IEEE Transactions on Evolutionary Computation, vol. 18, no. 3, pp. 450-455, June 2014.

Author:Mastermay
Constructors
MOP7
public MOP7()

Constructor. Creates default instance of problem MOP7 (10 decision variables)

MOP7
public MOP7(Integer numberOfVariables)

Creates a new instance of problem MOP7.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

org.uma.jmetal.problem.multiobjective.wfg

Shapes

public class Shapes

Class implementing shape functions for wfg benchmark Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Methods
concave
public float concave(float[] x, int m)

Calculate a concave shape

convex
public float convex(float[] x, int m)

Calculate a convex shape

disc
public float disc(float[] x, int A, float alpha, float beta)

Calculate a disc shape

linear
public float linear(float[] x, int m)

Calculate a linear shape

mixed
public float mixed(float[] x, int A, float alpha)

Calculate a mixed shape

Transformations

public class Transformations

Class implementing the basics transformations for wfg

Methods
bFlat
public float bFlat(float y, float A, float B, float C)

bFlat transformation

bParam
public float bParam(float y, float u, float A, float B, float C)

bParam transformation

bPoly
public float bPoly(float y, float alpha)

bPoly transformation

Throws:
correctTo01
float correctTo01(float a)
rNonsep
public float rNonsep(float[] y, int A)

rNonsep transformation

rSum
public float rSum(float[] y, float[] w)

rSum transformation

sDecept
public float sDecept(float y, float A, float B, float C)

sDecept transformation

sLinear
public float sLinear(float y, float A)

sLinear transformation

sMulti
public float sMulti(float y, int A, int B, float C)

sMulti transformation

WFG

public abstract class WFG extends AbstractDoubleProblem

Implements a reference abstract class for all wfg org.uma.test problem Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Fields
a
protected int[] a
d
protected int d
k
protected int k
l
protected int l
m
protected int m
random
protected Random random
s
protected int[] s
Constructors
WFG
public WFG(Integer k, Integer l, Integer M)

Constructor Creates a wfg problem

Parameters:
  • k – position-related parameters
  • l – distance-related parameters
  • M – Number of objectives
Methods
calculateX
public float[] calculateX(float[] t)

Gets the x vector

correctTo01
public float correctTo01(float a)
createSolution
public DoubleSolution createSolution()
evaluate
public abstract float[] evaluate(float[] variables)

Evaluates a solution

Parameters:
  • variables – The solution to evaluate
Returns:

a double [] with the evaluation results

normalise
public float[] normalise(float[] z)

Normalizes a vector (consulte wfg toolkit reference)

subVector
public float[] subVector(float[] z, int head, int tail)

Gets a subvector of a given vector (Head inclusive and tail inclusive)

Parameters:
  • z – the vector
Returns:

the subvector

WFG1

public class WFG1 extends WFG

This class implements the WFG1 problem Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Constructors
WFG1
public WFG1()

Constructor Creates a default WFG1 instance with 2 position-related parameters 4 distance-related parameters and 2 objectives

WFG1
public WFG1(Integer k, Integer l, Integer m)

Creates a WFG1 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)

Evaluate

evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
Throws:
t1
public float[] t1(float[] z, int k)

WFG1 t1 transformation

t2
public float[] t2(float[] z, int k)

WFG1 t2 transformation

t3
public float[] t3(float[] z)

WFG1 t3 transformation

Throws:
t4
public float[] t4(float[] z, int k, int M)

WFG1 t4 transformation

WFG2

public class WFG2 extends WFG

This class implements the WFG2 problem Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Constructors
WFG2
public WFG2()

Creates a default WFG2 instance with 2 position-related parameters 4 distance-related parameters and 2 objectives

WFG2
public WFG2(Integer k, Integer l, Integer m)

Creates a WFG2 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
t1
public float[] t1(float[] z, int k)

WFG2 t1 transformation

t2
public float[] t2(float[] z, int k)

WFG2 t2 transformation

t3
public float[] t3(float[] z, int k, int M)

WFG2 t3 transformation

WFG3

public class WFG3 extends WFG

This class implements the WFG3 problem Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Constructors
WFG3
public WFG3()

Creates a default WFG3 instances with 2 position-related parameters 4 distance-related parameters and 2 objectives

WFG3
public WFG3(Integer k, Integer l, Integer m)

Creates a WFG3 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)
evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
Throws:
t1
public float[] t1(float[] z, int k)

WFG3 t1 transformation

t2
public float[] t2(float[] z, int k)

WFG3 t2 transformation

t3
public float[] t3(float[] z, int k, int M)

WFG3 t3 transformation

WFG4

public class WFG4 extends WFG

This class implements the WFG4 problem Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Constructors
WFG4
public WFG4()

Creates a default WFG4 with 2 position-related parameter, 4 distance-related parameter and 2 objectives

WFG4
public WFG4(Integer k, Integer l, Integer m)

Creates a WFG4 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)

Evaluate() method

evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
Throws:
t1
public float[] t1(float[] z, int k)

WFG4 t1 transformation

t2
public float[] t2(float[] z, int k, int M)

WFG4 t2 transformation

WFG5

public class WFG5 extends WFG

This class implements the WFG5 problem Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Constructors
WFG5
public WFG5()

Creates a default WFG5 instance with 2 position-related parameters 4 distance-related parameters and 2 objectives

WFG5
public WFG5(Integer k, Integer l, Integer m)

Creates a WFG5 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)

Evaluate() method

evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
Throws:
t1
public float[] t1(float[] z, int k)

WFG5 t1 transformation

t2
public float[] t2(float[] z, int k, int M)

WFG5 t2 transformation

WFG6

public class WFG6 extends WFG

This class implements the WFG6 problem Reference: Simon Huband, Luigi Barone, Lyndon While, Phil Hingston A Scalable Multi-objective Test Problem Toolkit. Evolutionary Multi-Criterion Optimization: Third International Conference, EMO 2005. Proceedings, volume 3410 of Lecture Notes in Computer Science

Constructors
WFG6
public WFG6()

Creates a default WFG6 with 2 position-related parameters, 4 distance-related parameters, and 2 objectives

WFG6
public WFG6(Integer k, Integer l, Integer m)

Creates a WFG6 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)

Evaluate() method

evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
Throws:
t1
public float[] t1(float[] z, int k)

WFG6 t1 transformation

t2
public float[] t2(float[] z, int k, int M)

WFG6 t2 transformation

WFG7

public class WFG7 extends WFG
Constructors
WFG7
public WFG7()

Creates a default WFG7 problem with 2 position-related parameters, 4 distance-related parameters, and 2 objectives

WFG7
public WFG7(Integer k, Integer l, Integer m)

Creates a WFG7 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)

Evaluate() method

evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

t1
public float[] t1(float[] z, int k)

WFG7 t1 transformation

t2
public float[] t2(float[] z, int k)

WFG7 t2 transformation

t3
public float[] t3(float[] z, int k, int M)

WFG7 t3 transformation

WFG8

public class WFG8 extends WFG

Creates a default WFG8 problem with 2 position-related parameters, 4 distance-related parameters, and 2 objectives

Constructors
WFG8
public WFG8()

Creates a default WFG8 with 2 position-related parameters, 4 distance-related parameters, and 2 objectives

WFG8
public WFG8(Integer k, Integer l, Integer m)

Creates a WFG8 problem instance

Parameters:
  • k – Number of position parameters
  • l – Number of distance parameters
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)

Evaluate() method

evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
Throws:
t1
public float[] t1(float[] z, int k)

WFG8 t1 transformation

t2
public float[] t2(float[] z, int k)

WFG8 t2 transformation

t3
public float[] t3(float[] z, int k, int M)

WFG8 t3 transformation

WFG9

public class WFG9 extends WFG

Creates a default WFG9 problem with 2 position-related parameters, 4 distance-related parameters, and 2 objectives

Constructors
WFG9
public WFG9()

Creates a default WFG9 with 2 position-related parameters, 4 distance-related parameters, and 2 objectives

WFG9
public WFG9(Integer k, Integer l, Integer m)

Creates a WFG9 problem instance

Parameters:
  • k – Number of position variables
  • l – Number of distance variables
  • m – Number of objective functions
Methods
evaluate
public float[] evaluate(float[] z)

Evaluate() method

evaluate
public void evaluate(DoubleSolution solution)

Evaluates a solution

Parameters:
  • solution – The solution to runAlgorithm
Throws:
t1
public float[] t1(float[] z, int k)

WFG9 t1 transformation

t2
public float[] t2(float[] z, int k)

WFG9 t2 transformation

t3
public float[] t3(float[] z, int k, int M)

WFG9 t3 transformation

org.uma.jmetal.problem.multiobjective.zdt

ZDT1

public class ZDT1 extends AbstractDoubleProblem

Class representing problem ZDT1

Constructors
ZDT1
public ZDT1()

Constructor. Creates default instance of problem ZDT1 (30 decision variables)

ZDT1
public ZDT1(Integer numberOfVariables)

Creates a new instance of problem ZDT1.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evalH
public double evalH(double f, double g)

Returns the value of the ZDT1 function H.

Parameters:
  • f – First argument of the function H.
  • g – Second argument of the function H.
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

ZDT2

public class ZDT2 extends AbstractDoubleProblem

Class representing problem ZDT2

Constructors
ZDT2
public ZDT2()

Constructor. Creates default instance of problem ZDT2 (30 decision variables)

ZDT2
public ZDT2(Integer numberOfVariables)

Constructor. Creates a new ZDT2 problem instance.

Parameters:
  • numberOfVariables – Number of variables
Methods
evalH
public double evalH(double f, double g)

Returns the value of the ZDT2 function H.

Parameters:
  • f – First argument of the function H.
  • g – Second argument of the function H.
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

ZDT3

public class ZDT3 extends AbstractDoubleProblem

Class representing problem ZDT3

Constructors
ZDT3
public ZDT3()

Constructor. Creates default instance of problem ZDT3 (30 decision variables)

ZDT3
public ZDT3(Integer numberOfVariables)

Constructor. Creates a instance of ZDT3 problem.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evalH
public double evalH(double f, double g)

Returns the value of the ZDT3 function H.

Parameters:
  • f – First argument of the function H.
  • g – Second argument of the function H.
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

ZDT4

public class ZDT4 extends AbstractDoubleProblem

Class representing problem ZDT4

Constructors
ZDT4
public ZDT4()

Constructor. Creates a default instance of problem ZDT4 (10 decision variables

ZDT4
public ZDT4(Integer numberOfVariables)

Creates a instance of problem ZDT4.

Parameters:
  • numberOfVariables – Number of variables.
Methods
evalG
public double evalG(DoubleSolution solution)

Returns the value of the ZDT4 function G.

Parameters:
  • solution – Solution
evalH
public double evalH(double f, double g)

Returns the value of the ZDT4 function H.

Parameters:
  • f – First argument of the function H.
  • g – Second argument of the function H.
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

ZDT5

public class ZDT5 extends AbstractBinaryProblem

Class representing problem ZDT5

Constructors
ZDT5
public ZDT5()

Creates a default instance of problem ZDT5 (11 decision variables)

ZDT5
public ZDT5(Integer numberOfVariables)

Creates a instance of problem ZDT5

Parameters:
  • numberOfVariables – Number of variables.
Methods
evalG
public double evalG(BinarySolution solution)

Returns the value of the ZDT5 function G.

Parameters:
  • solution – The solution.
evalH
public double evalH(double f, double g)

Returns the value of the ZDT5 function H.

Parameters:
  • f – First argument of the function H.
  • g – Second argument of the function H.
evalV
public double evalV(double value)

Returns the value of the ZDT5 function V.

Parameters:
  • value – The parameter of V function.
evaluate
public void evaluate(BinarySolution solution)

Evaluate() method

getBitsPerVariable
protected int getBitsPerVariable(int index)

ZDT6

public class ZDT6 extends AbstractDoubleProblem

Class representing problem ZDT6

Constructors
ZDT6
public ZDT6()

Constructor. Creates a default instance of problem ZDT6 (10 decision variables)

ZDT6
public ZDT6(Integer numberOfVariables)

Creates a instance of problem ZDT6

Parameters:
  • numberOfVariables – Number of variables
Methods
evalG
public double evalG(DoubleSolution solution)

Returns the value of the ZDT6 function G.

Parameters:
  • solution – Solution
evalH
public double evalH(double f, double g)

Returns the value of the ZDT6 function H.

Parameters:
  • f – First argument of the function H.
  • g – Second argument of the function H.
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

org.uma.jmetal.problem.singleobjective

CEC2005Problem

public class CEC2005Problem extends AbstractDoubleProblem

Class representing for solving the CEC2005 competition problems.

Fields
testFunction
TestFunc testFunction
Constructors
CEC2005Problem
public CEC2005Problem(int problemID, int numberOfVariables)

Constructor

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

Griewank

public class Griewank extends AbstractDoubleProblem

Class representing problem Griewank

Constructors
Griewank
public Griewank(Integer numberOfVariables)

Constructor Creates a default instance of the Griewank problem

Parameters:
  • numberOfVariables – Number of variables of the problem
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

NIntegerMin

public class NIntegerMin extends AbstractIntegerProblem

Created by Antonio J. Nebro on 03/07/14. Single objective problem for testing integer encoding. Objective: minimizing the distance to value N

Constructors
NIntegerMin
public NIntegerMin()
NIntegerMin
public NIntegerMin(int numberOfVariables, int n, int lowerBound, int upperBound)

Constructor

Methods
evaluate
public void evaluate(IntegerSolution solution)

Evaluate() method

OneMax

public class OneMax extends AbstractBinaryProblem

Class representing problem OneMax. The problem consist of maximizing the number of ‘1’s in a binary string.

Constructors
OneMax
public OneMax()

Constructor

OneMax
public OneMax(Integer numberOfBits)

Constructor

Methods
createSolution
public BinarySolution createSolution()
evaluate
public void evaluate(BinarySolution solution)

Evaluate() method

getBitsPerVariable
protected int getBitsPerVariable(int index)

Rastrigin

public class Rastrigin extends AbstractDoubleProblem
Constructors
Rastrigin
public Rastrigin(Integer numberOfVariables)

Constructor Creates a default instance of the Rastrigin problem

Parameters:
  • numberOfVariables – Number of variables of the problem
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

Rosenbrock

public class Rosenbrock extends AbstractDoubleProblem
Constructors
Rosenbrock
public Rosenbrock(Integer numberOfVariables)

Constructor Creates a default instance of the Rosenbrock problem

Parameters:
  • numberOfVariables – Number of variables of the problem
Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

Sphere

public class Sphere extends AbstractDoubleProblem

Class representing a Sphere problem.

Constructors
Sphere
public Sphere()

Constructor

Sphere
public Sphere(Integer numberOfVariables)

Constructor

Methods
evaluate
public void evaluate(DoubleSolution solution)

Evaluate() method

TSP

public class TSP extends AbstractIntegerPermutationProblem

Class representing a single-objective TSP (Traveling Salesman Problem) problem. It accepts data files from TSPLIB: http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/tsp/

Constructors
TSP
public TSP(String distanceFile)

Creates a new TSP problem instance

Methods
evaluate
public void evaluate(PermutationSolution<Integer> solution)

Evaluate() method

getPermutationLength
public int getPermutationLength()

org.uma.jmetal.problem.singleobjective.cec2005competitioncode

Benchmark

public class Benchmark
Fields
CEC2005SUPPORTDATADIRECTORY
public static final String CEC2005SUPPORTDATADIRECTORY
DEFAULT_FILE_BIAS
public static final String DEFAULT_FILE_BIAS
MAX_SUPPORT_DIM
public static final int MAX_SUPPORT_DIM
NUM_TEST_FUNC
public static final int NUM_TEST_FUNC
PIx2
public static final double PIx2
loader
public static final ClassLoader loader
numberFormatter
public static final DecimalFormat numberFormatter
percentageFormatter
public static final DecimalFormat percentageFormatter
random
public static final Random random
scientificFormatter
public static final DecimalFormat scientificFormatter
test_func_arg_types
static final Class<?>[] test_func_arg_types
test_func_class_names
public static final String[] test_func_class_names
Constructors
Benchmark
public Benchmark()
Benchmark
public Benchmark(String file_bias)
Methods
Ax
public static void Ax(double[] result, double[][] A, double[] x)
EScafferF6
public static double EScafferF6(double[] x)
EScafferF6NonCont
public static double EScafferF6NonCont(double[] x)
F2
public static double F2(double x, double y)
F8
public static double F8(double x)
F8F2
public static double F8F2(double[] x)
ScafferF6
public static double ScafferF6(double x, double y)
ackley
public static double ackley(double[] x)
elliptic
public static double elliptic(double[] x)
griewank
public static double griewank(double[] x)
hybrid_composition
public static double hybrid_composition(double[] x, HCJob job)
loadColumnVector
public static void loadColumnVector(BufferedReader brSrc, int rows, double[] column)
loadColumnVectorFromFile
public static void loadColumnVectorFromFile(String file, int rows, double[] column)
loadMatrix
public static void loadMatrix(BufferedReader brSrc, int rows, int columns, double[][] matrix)
loadMatrixFromFile
public static void loadMatrixFromFile(String file, int rows, int columns, double[][] matrix)
loadNMatrixFromFile
public static void loadNMatrixFromFile(String file, int N, int rows, int columns, double[][][] matrix)
loadRowVector
public static void loadRowVector(BufferedReader brSrc, int columns, double[] row)
loadRowVectorFromFile
public static void loadRowVectorFromFile(String file, int columns, double[] row)
loadTestDataFromFile
public static void loadTestDataFromFile(String file, int num_test_points, int test_dimension, double[][] x, double[] f)
main
public static void main(String[] args)
myRound
public static double myRound(double x)
myXRound
public static double myXRound(double x, double o)
myXRound
public static double myXRound(double x)
rastrigin
public static double rastrigin(double[] x)
rastriginNonCont
public static double rastriginNonCont(double[] x)
rosenbrock
public static double rosenbrock(double[] x)
rotate
public static void rotate(double[] results, double[] x, double[][] matrix)
runTest
public void runTest()
runTest
public void runTest(int func_num)
schwefel_102
public static double schwefel_102(double[] x)
shift
public static void shift(double[] results, double[] x, double[] o)
sphere
public static double sphere(double[] x)
sphere_noise
public static double sphere_noise(double[] x)
testFunctionFactory
public TestFunc testFunctionFactory(int func_num, int dimension)
weierstrass
public static double weierstrass(double[] x)
weierstrass
public static double weierstrass(double[] x, double a, double b, int Kmax)
xA
public static void xA(double[] result, double[] x, double[][] A)
xy
public static double xy(double[] x, double[] y)

F01ShiftedSphere

public class F01ShiftedSphere extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F01ShiftedSphere
public F01ShiftedSphere(int dimension, double bias)
F01ShiftedSphere
public F01ShiftedSphere(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F02ShiftedSchwefel

public class F02ShiftedSchwefel extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F02ShiftedSchwefel
public F02ShiftedSchwefel(int dimension, double bias)
F02ShiftedSchwefel
public F02ShiftedSchwefel(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F03ShiftedRotatedHighCondElliptic

public class F03ShiftedRotatedHighCondElliptic extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F03ShiftedRotatedHighCondElliptic
public F03ShiftedRotatedHighCondElliptic(int dimension, double bias)
F03ShiftedRotatedHighCondElliptic
public F03ShiftedRotatedHighCondElliptic(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F04ShiftedSchwefelNoise

public class F04ShiftedSchwefelNoise extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F04ShiftedSchwefelNoise
public F04ShiftedSchwefelNoise(int dimension, double bias)
F04ShiftedSchwefelNoise
public F04ShiftedSchwefelNoise(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F05SchwefelGlobalOptBound

public class F05SchwefelGlobalOptBound extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F05SchwefelGlobalOptBound
public F05SchwefelGlobalOptBound(int dimension, double bias)
F05SchwefelGlobalOptBound
public F05SchwefelGlobalOptBound(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F06ShiftedRosenbrock

public class F06ShiftedRosenbrock extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F06ShiftedRosenbrock
public F06ShiftedRosenbrock(int dimension, double bias)
F06ShiftedRosenbrock
public F06ShiftedRosenbrock(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F07ShiftedRotatedGriewank

public class F07ShiftedRotatedGriewank extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F07ShiftedRotatedGriewank
public F07ShiftedRotatedGriewank(int dimension, double bias)
F07ShiftedRotatedGriewank
public F07ShiftedRotatedGriewank(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F08ShiftedRotatedAckleyGlobalOptBound

public class F08ShiftedRotatedAckleyGlobalOptBound extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F08ShiftedRotatedAckleyGlobalOptBound
public F08ShiftedRotatedAckleyGlobalOptBound(int dimension, double bias)
F08ShiftedRotatedAckleyGlobalOptBound
public F08ShiftedRotatedAckleyGlobalOptBound(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F09ShiftedRastrigin

public class F09ShiftedRastrigin extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F09ShiftedRastrigin
public F09ShiftedRastrigin(int dimension, double bias)
F09ShiftedRastrigin
public F09ShiftedRastrigin(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F10ShiftedRotatedRastrigin

public class F10ShiftedRotatedRastrigin extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F10ShiftedRotatedRastrigin
public F10ShiftedRotatedRastrigin(int dimension, double bias)
F10ShiftedRotatedRastrigin
public F10ShiftedRotatedRastrigin(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F11ShiftedRotatedWeierstrass

public class F11ShiftedRotatedWeierstrass extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
Kmax
public static final int Kmax
PIx2
public static final double PIx2
a
public static final double a
b
public static final double b
Constructors
F11ShiftedRotatedWeierstrass
public F11ShiftedRotatedWeierstrass(int dimension, double bias)
F11ShiftedRotatedWeierstrass
public F11ShiftedRotatedWeierstrass(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F12Schwefel

public class F12Schwefel extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F12Schwefel
public F12Schwefel(int dimension, double bias)
F12Schwefel
public F12Schwefel(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F13ShiftedExpandedGriewankRosenbrock

public class F13ShiftedExpandedGriewankRosenbrock extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F13ShiftedExpandedGriewankRosenbrock
public F13ShiftedExpandedGriewankRosenbrock(int dimension, double bias)
F13ShiftedExpandedGriewankRosenbrock
public F13ShiftedExpandedGriewankRosenbrock(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F14ShiftedRotatedExpandedScaffer

public class F14ShiftedRotatedExpandedScaffer extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
Constructors
F14ShiftedRotatedExpandedScaffer
public F14ShiftedRotatedExpandedScaffer(int dimension, double bias)
F14ShiftedRotatedExpandedScaffer
public F14ShiftedRotatedExpandedScaffer(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F15HybridComposition1

public class F15HybridComposition1 extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F15HybridComposition1
public F15HybridComposition1(int dimension, double bias)
F15HybridComposition1
public F15HybridComposition1(int dimension, double bias, String file_data)
Methods
f
public double f(double[] x)

F16RotatedHybridComposition1

public class F16RotatedHybridComposition1 extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F16RotatedHybridComposition1
public F16RotatedHybridComposition1(int dimension, double bias)
F16RotatedHybridComposition1
public F16RotatedHybridComposition1(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F17RotatedHybridComposition1Noise

public class F17RotatedHybridComposition1Noise extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F17RotatedHybridComposition1Noise
public F17RotatedHybridComposition1Noise(int dimension, double bias)
F17RotatedHybridComposition1Noise
public F17RotatedHybridComposition1Noise(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F18RotatedHybridComposition2

public class F18RotatedHybridComposition2 extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F18RotatedHybridComposition2
public F18RotatedHybridComposition2(int dimension, double bias)
F18RotatedHybridComposition2
public F18RotatedHybridComposition2(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F19RotatedHybridComposition2NarrowBasinGlobalOpt

public class F19RotatedHybridComposition2NarrowBasinGlobalOpt extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F19RotatedHybridComposition2NarrowBasinGlobalOpt
public F19RotatedHybridComposition2NarrowBasinGlobalOpt(int dimension, double bias)
F19RotatedHybridComposition2NarrowBasinGlobalOpt
public F19RotatedHybridComposition2NarrowBasinGlobalOpt(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F20RotatedHybridComposition2GlobalOptBound

public class F20RotatedHybridComposition2GlobalOptBound extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F20RotatedHybridComposition2GlobalOptBound
public F20RotatedHybridComposition2GlobalOptBound(int dimension, double bias)
F20RotatedHybridComposition2GlobalOptBound
public F20RotatedHybridComposition2GlobalOptBound(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F21RotatedHybridComposition3

public class F21RotatedHybridComposition3 extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F21RotatedHybridComposition3
public F21RotatedHybridComposition3(int dimension, double bias)
F21RotatedHybridComposition3
public F21RotatedHybridComposition3(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F22RotatedHybridComposition3HighCondNumMatrix

public class F22RotatedHybridComposition3HighCondNumMatrix extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F22RotatedHybridComposition3HighCondNumMatrix
public F22RotatedHybridComposition3HighCondNumMatrix(int dimension, double bias)
F22RotatedHybridComposition3HighCondNumMatrix
public F22RotatedHybridComposition3HighCondNumMatrix(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F23NoncontinuousRotatedHybridComposition3

public class F23NoncontinuousRotatedHybridComposition3 extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F23NoncontinuousRotatedHybridComposition3
public F23NoncontinuousRotatedHybridComposition3(int dimension, double bias)
F23NoncontinuousRotatedHybridComposition3
public F23NoncontinuousRotatedHybridComposition3(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F24RotatedHybridComposition4

public class F24RotatedHybridComposition4 extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F24RotatedHybridComposition4
public F24RotatedHybridComposition4(int dimension, double bias)
F24RotatedHybridComposition4
public F24RotatedHybridComposition4(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

F25RotatedHybridComposition4Bound

public class F25RotatedHybridComposition4Bound extends TestFunc
Fields
DEFAULT_FILE_DATA
public static final String DEFAULT_FILE_DATA
DEFAULT_FILE_MX_PREFIX
public static final String DEFAULT_FILE_MX_PREFIX
DEFAULT_FILE_MX_SUFFIX
public static final String DEFAULT_FILE_MX_SUFFIX
FUNCTION_NAME
public static final String FUNCTION_NAME
NUM_FUNC
public static final int NUM_FUNC
Constructors
F25RotatedHybridComposition4Bound
public F25RotatedHybridComposition4Bound(int dimension, double bias)
F25RotatedHybridComposition4Bound
public F25RotatedHybridComposition4Bound(int dimension, double bias, String file_data, String file_m)
Methods
f
public double f(double[] x)

HCJob

public abstract class HCJob
Fields
C
public double C
biases
public double[] biases
fmax
public double[] fmax
lambda
public double[] lambda
linearTransformationMatrix
public double[][][] linearTransformationMatrix
numberOfBasicFunctions
public int numberOfBasicFunctions
numberOfDimensions
public int numberOfDimensions
shiftGlobalOptimum
public double[][] shiftGlobalOptimum
sigma
public double[] sigma
w
public double[] w
z
public double[][] z
zM
public double[][] zM
Constructors
HCJob
public HCJob()
Methods
basicFunc
public abstract double basicFunc(int func_no, double[] x)

TestFunc

public abstract class TestFunc
Fields
mBias
protected double mBias
mDimension
protected int mDimension
mFuncName
protected String mFuncName
Constructors
TestFunc
public TestFunc(int dimension, double bias)
TestFunc
public TestFunc(int dimension, double bias, String funcName)
Methods
bias
public double bias()
dimension
public int dimension()
f
public abstract double f(double[] x)
name
public String name()

org.uma.jmetal.qualityIndicator

CommandLineIndicatorRunner

public class CommandLineIndicatorRunner

Class for executing quality indicators from the command line. An optional argument allows to indicate whether the fronts are to be normalized by the quality indicators. Invoking command: mvn -pl jmetal-exec exec:java -Dexec.mainClass=”org.uma.jmetal.qualityIndicator.CommandLineIndicatorRunner” -Dexec.args=”indicator referenceFront front normalize”

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

org.uma.jmetal.qualityindicator

QualityIndicator

public interface QualityIndicator<Evaluate, Result> extends DescribedEntity, Serializable
Author:

Antonio J. Nebro

Parameters:
  • <Evaluate> – Entity to runAlgorithm
  • <Result> – Result of the evaluation
Methods
evaluate
public Result evaluate(Evaluate evaluate)

org.uma.jmetal.qualityindicator.impl

Epsilon

public class Epsilon<S extends Solution<?>> extends GenericIndicator<S>

This class implements the unary epsilon additive indicator as proposed in E. Zitzler, E. Thiele, L. Laummanns, M., Fonseca, C., and Grunert da Fonseca. V (2003): Performance Assessment of Multiobjective Optimizers: An Analysis and Review. The code is the a Java version of the original metric implementation by Eckart Zitzler. It can be used also as a command line program just by typing $java org.uma.jmetal.qualityindicator.impl.Epsilon

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
Epsilon
public Epsilon()

Default constructor

Epsilon
public Epsilon(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
Epsilon
public Epsilon(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Methods
evaluate
public Double evaluate(List<S> solutionList)

Evaluate() method

Parameters:
  • solutionList
getDescription
public String getDescription()
getName
public String getName()
isTheLowerTheIndicatorValueTheBetter
public boolean isTheLowerTheIndicatorValueTheBetter()

EpsilonTest

public class EpsilonTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull
public void shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull()
shouldExecuteRaiseAnExceptionIfTheFrontApproximationListIsNull
public void shouldExecuteRaiseAnExceptionIfTheFrontApproximationListIsNull()
shouldExecuteReturnTheCorrectValueCaseA
public void shouldExecuteReturnTheCorrectValueCaseA()

Given a front with points [1.5,4.0], [2.0,3.0],[3.0,2.0] and a Pareto front with points [1.0,3.0], [1.5,2.0], [2.0, 1.5], the value of the epsilon indicator is 1

shouldExecuteReturnTheCorrectValueCaseB
public void shouldExecuteReturnTheCorrectValueCaseB()

Given a front with points [1.5,4.0], [1.5,2.0],[2.0,1.5] and a Pareto front with points [1.0,3.0], [1.5,2.0], [2.0, 1.5], the value of the epsilon indicator is 0.5

shouldExecuteReturnTheRightValueIfTheFrontsContainOnePointWhichIsNotTheSame
public void shouldExecuteReturnTheRightValueIfTheFrontsContainOnePointWhichIsNotTheSame()

Given a front with point [2,3] and a Pareto front with point [1,2], the value of the epsilon indicator is 1

shouldExecuteReturnZeroIfTheFrontsContainOnePointWhichIsTheSame
public void shouldExecuteReturnZeroIfTheFrontsContainOnePointWhichIsTheSame()
shouldGetNameReturnTheCorrectValue
public void shouldGetNameReturnTheCorrectValue()

The same case as shouldExecuteReturnTheCorrectValueCaseB() but using list of solutions

ErrorRatio

public class ErrorRatio<Evaluate extends List<? extends Solution<?>>> extends SimpleDescribedEntity implements QualityIndicator<Evaluate, Double>

The Error Ratio (ER) quality indicator reports the ratio of solutions in a front of points that are not members of the true Pareto front. NOTE: the indicator merely checks if the solutions in the front are not members of the second front. No assumption is made about the second front is a true Pareto front, i.e, the front could contain solutions that dominate some of those of the supposed Pareto front. It is a responsibility of the caller to ensure that this does not happen.

Author:Antonio J. Nebro TODO: using an epsilon value
Constructors
ErrorRatio
public ErrorRatio(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
ErrorRatio
public ErrorRatio(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Methods
evaluate
public Double evaluate(Evaluate solutionList)

Evaluate() method

Parameters:
  • solutionList
getName
public String getName()

ErrorRatioTest

public class ErrorRatioTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull
public void shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull()
shouldExecuteRaiseAnExceptionIfTheParetoFrontApproximationListIsNull
public void shouldExecuteRaiseAnExceptionIfTheParetoFrontApproximationListIsNull()
shouldExecuteReturnOneIfTheFrontsContainADifferentPoint
public void shouldExecuteReturnOneIfTheFrontsContainADifferentPoint()
shouldExecuteReturnTheCorrectValueCaseA
public void shouldExecuteReturnTheCorrectValueCaseA()

Given a front with points [1.5,4.0], [1.5,2.0],[2.0,1.5] and a Pareto front with points [1.0,3.0], [1.5,2.0], [2.0, 1.5], the value of the epsilon indicator is 2/3

shouldExecuteReturnTheCorrectValueCaseB
public void shouldExecuteReturnTheCorrectValueCaseB()

Given a list with solutions [1.5,3.0], [4.0,2.0] and another lists with solutions [-1.0,-1.0], [0.0,0.0], the value of the epsilon indicator is 1

shouldExecuteReturnZeroIfTheFrontsContainOnePointWhichIsTheSame
public void shouldExecuteReturnZeroIfTheFrontsContainOnePointWhichIsTheSame()
shouldGetNameReturnTheCorrectValue
public void shouldGetNameReturnTheCorrectValue()

GeneralizedSpread

public class GeneralizedSpread<S extends Solution<?>> extends GenericIndicator<S>

This class implements the generalized spread metric for two or more dimensions. Reference: A. Zhou, Y. Jin, Q. Zhang, B. Sendhoff, and E. Tsang Combining model-based and genetics-based offspring generation for multi-objective optimization using a convergence criterion, 2006 IEEE Congress on Evolutionary Computation, 2006, pp. 3234-3241.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
GeneralizedSpread
public GeneralizedSpread()

Default constructor

GeneralizedSpread
public GeneralizedSpread(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
GeneralizedSpread
public GeneralizedSpread(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Throws:
  • FileNotFoundException
Methods
evaluate
public Double evaluate(List<S> solutionList)

Evaluate() method

Parameters:
  • solutionList
generalizedSpread
public double generalizedSpread(Front front, Front referenceFront)

Calculates the generalized spread metric. Given the pareto front, the true pareto front as double [] and the number of objectives, the method return the value for the metric.

Parameters:
  • front – The front.
  • referenceFront – The reference pareto front.
Returns:

the value of the generalized spread metric

getDescription
public String getDescription()
getName
public String getName()
isTheLowerTheIndicatorValueTheBetter
public boolean isTheLowerTheIndicatorValueTheBetter()

GenerationalDistance

public class GenerationalDistance<S extends Solution<?>> extends GenericIndicator<S>

This class implements the generational distance indicator. Reference: Van Veldhuizen, D.A., Lamont, G.B.: Multiobjective Evolutionary Algorithm Research: A History and Analysis. Technical Report TR-98-03, Dept. Elec. Comput. Eng., Air Force Inst. Technol. (1998)

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
GenerationalDistance
public GenerationalDistance()

Default constructor

GenerationalDistance
public GenerationalDistance(String referenceParetoFrontFile, double p)

Constructor

Parameters:
  • referenceParetoFrontFile
  • p
Throws:
  • FileNotFoundException
GenerationalDistance
public GenerationalDistance(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
GenerationalDistance
public GenerationalDistance(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Methods
evaluate
public Double evaluate(List<S> solutionList)

Evaluate() method

Parameters:
  • solutionList
generationalDistance
public double generationalDistance(Front front, Front referenceFront)

Returns the generational distance value for a given front

Parameters:
  • front – The front
  • referenceFront – The reference pareto front
getDescription
public String getDescription()
getName
public String getName()
isTheLowerTheIndicatorValueTheBetter
public boolean isTheLowerTheIndicatorValueTheBetter()

GenerationalDistanceTest

public class GenerationalDistanceTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull
public void shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull()
shouldExecuteRaiseAnExceptionIfTheParetoFrontIsNull
public void shouldExecuteRaiseAnExceptionIfTheParetoFrontIsNull()
shouldGetNameReturnTheCorrectValue
public void shouldGetNameReturnTheCorrectValue()

GenericIndicator

public abstract class GenericIndicator<S> extends SimpleDescribedEntity implements QualityIndicator<List<S>, Double>

Abstract class representing quality indicators that need a reference front to be computed

Author:Antonio J. Nebro
Fields
referenceParetoFront
protected Front referenceParetoFront
Constructors
GenericIndicator
public GenericIndicator()

Default constructor

GenericIndicator
public GenericIndicator(String referenceParetoFrontFile)
GenericIndicator
public GenericIndicator(Front referenceParetoFront)
Methods
isTheLowerTheIndicatorValueTheBetter
public abstract boolean isTheLowerTheIndicatorValueTheBetter()

This method returns true if lower indicator values are preferred and false otherwise

setReferenceParetoFront
public void setReferenceParetoFront(String referenceParetoFrontFile)
setReferenceParetoFront
public void setReferenceParetoFront(Front referenceFront)

Hypervolume

public abstract class Hypervolume<S> extends GenericIndicator<S>

This interface represents implementations of the Hypervolume quality indicator

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
Hypervolume
public Hypervolume()
Hypervolume
public Hypervolume(String referenceParetoFrontFile)
Hypervolume
public Hypervolume(Front referenceParetoFront)
Methods
computeHypervolumeContribution
public abstract List<S> computeHypervolumeContribution(List<S> solutionList, List<S> referenceFrontList)
getName
public String getName()
getOffset
public abstract double getOffset()
isTheLowerTheIndicatorValueTheBetter
public boolean isTheLowerTheIndicatorValueTheBetter()
setOffset
public abstract void setOffset(double offset)

HypervolumeTest

public class HypervolumeTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull
public void shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull()
shouldExecuteRaiseAnExceptionIfTheParetoFrontIsNull
public void shouldExecuteRaiseAnExceptionIfTheParetoFrontIsNull()

InvertedGenerationalDistance

public class InvertedGenerationalDistance<S extends Solution<?>> extends GenericIndicator<S>

This class implements the inverted generational distance metric. Reference: Van Veldhuizen, D.A., Lamont, G.B.: Multiobjective Evolutionary Algorithm Research: A History and Analysis. Technical Report TR-98-03, Dept. Elec. Comput. Eng., Air Force Inst. Technol. (1998)

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
InvertedGenerationalDistance
public InvertedGenerationalDistance()

Default constructor

InvertedGenerationalDistance
public InvertedGenerationalDistance(String referenceParetoFrontFile, double p)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
InvertedGenerationalDistance
public InvertedGenerationalDistance(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
InvertedGenerationalDistance
public InvertedGenerationalDistance(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Throws:
  • FileNotFoundException
Methods
evaluate
public Double evaluate(List<S> solutionList)

Evaluate() method

Parameters:
  • solutionList
getDescription
public String getDescription()
getName
public String getName()
invertedGenerationalDistance
public double invertedGenerationalDistance(Front front, Front referenceFront)

Returns the inverted generational distance value for a given front

Parameters:
  • front – The front
  • referenceFront – The reference pareto front
isTheLowerTheIndicatorValueTheBetter
public boolean isTheLowerTheIndicatorValueTheBetter()

InvertedGenerationalDistancePlus

public class InvertedGenerationalDistancePlus<S extends Solution<?>> extends GenericIndicator<S>

This class implements the inverted generational distance metric plust (IGD+) Reference: Ishibuchi et al 2015, “A Study on Performance Evaluation Ability of a Modified Inverted Generational Distance Indicator”, GECCO 2015

Author:Antonio J. Nebro
Constructors
InvertedGenerationalDistancePlus
public InvertedGenerationalDistancePlus()

Default constructor

InvertedGenerationalDistancePlus
public InvertedGenerationalDistancePlus(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
InvertedGenerationalDistancePlus
public InvertedGenerationalDistancePlus(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Throws:
  • FileNotFoundException
Methods
evaluate
public Double evaluate(List<S> solutionList)

Evaluate() method

Parameters:
  • solutionList
getDescription
public String getDescription()
getName
public String getName()
invertedGenerationalDistancePlus
public double invertedGenerationalDistancePlus(Front front, Front referenceFront)

Returns the inverted generational distance plus value for a given front

Parameters:
  • front – The front
  • referenceFront – The reference pareto front
isTheLowerTheIndicatorValueTheBetter
public boolean isTheLowerTheIndicatorValueTheBetter()

InvertedGenerationalDistancePlusTest

public class InvertedGenerationalDistancePlusTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldConstructorRaiseAnExceptionIfFileNameIsNull
public void shouldConstructorRaiseAnExceptionIfFileNameIsNull()
shouldConstructorRaiseAnExceptionIfTheParetoFrontIsNull
public void shouldConstructorRaiseAnExceptionIfTheParetoFrontIsNull()
shouldEvaluateRaiseAnExceptionIfTheFrontApproximationIsNull
public void shouldEvaluateRaiseAnExceptionIfTheFrontApproximationIsNull()
shouldEvaluateReturnTheCorrectValueCaseA
public void shouldEvaluateReturnTheCorrectValueCaseA()
shouldEvaluateReturnTheCorrectValueCaseB
public void shouldEvaluateReturnTheCorrectValueCaseB()
shouldEvaluateReturnZeroIfTheFrontAndTheReferenceFrontContainsTheSamePoints
public void shouldEvaluateReturnZeroIfTheFrontAndTheReferenceFrontContainsTheSamePoints()

R2

public class R2<Evaluate extends List<? extends Solution<?>>> extends SimpleDescribedEntity implements QualityIndicator<Evaluate, Double>

TODO: Add comments here

Constructors
R2
public R2(Front referenceParetoFront)

Creates a new instance of the R2 indicator for a problem with two objectives and 100 lambda vectors

R2
public R2()

Creates a new instance of the R2 indicator for a problem with two objectives and 100 lambda vectors

R2
public R2(int nVectors)

Creates a new instance of the R2 indicator for a problem with two objectives and N lambda vectors

R2
public R2(String file, Front referenceParetoFront)

Constructor Creates a new instance of the R2 indicator for nDimensiosn It loads the weight vectors from the file fileName

R2
public R2(int nVectors, Front referenceParetoFront)

Creates a new instance of the R2 indicator for a problem with two objectives and N lambda vectors

R2
public R2(String file)

Constructor Creates a new instance of the R2 indicator for nDimensiosn It loads the weight vectors from the file fileName

Methods
evaluate
public Double evaluate(Evaluate solutionList)
getName
public String getName()
r2
public double r2(Front front)

R2Test

public class R2Test
Fields
description
String description
name
String name
Methods
testR2HasProperNameAndDescriptionWithEmptyConstructor
public void testR2HasProperNameAndDescriptionWithEmptyConstructor()
testR2HasProperNameAndDescriptionWithFileConstructor
public void testR2HasProperNameAndDescriptionWithFileConstructor()
testR2HasProperNameAndDescriptionWithFileFrontConstructor
public void testR2HasProperNameAndDescriptionWithFileFrontConstructor()
testR2HasProperNameAndDescriptionWithFrontConstructor
public void testR2HasProperNameAndDescriptionWithFrontConstructor()
testR2HasProperNameAndDescriptionWithVectorConstructor
public void testR2HasProperNameAndDescriptionWithVectorConstructor()
testR2HasProperNameAndDescriptionWithVectorFrontConstructor
public void testR2HasProperNameAndDescriptionWithVectorFrontConstructor()

SetCoverage

public class SetCoverage extends SimpleDescribedEntity implements QualityIndicator<Pair<List<? extends Solution<?>>, List<? extends Solution<?>>>, Pair<Double, Double>>

Set coverage metric

Author:Antonio J. Nebro
Constructors
SetCoverage
public SetCoverage()

Constructor

Methods
evaluate
public Pair<Double, Double> evaluate(Pair<List<? extends Solution<?>>, List<? extends Solution<?>>> pairOfSolutionLists)
evaluate
public double evaluate(List<? extends Solution<?>> set1, List<? extends Solution<?>> set2)

Calculates the set coverage of set1 over set2

Parameters:
  • set1
  • set2
Returns:

The value of the set coverage

getName
public String getName()

SetCoverageTest

public class SetCoverageTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
setup
public void setup()
shouldExecuteRaiseAnExceptionIfTheFirstFrontIsNull
public void shouldExecuteRaiseAnExceptionIfTheFirstFrontIsNull()
shouldExecuteRaiseAnExceptionIfTheParetoFrontIsNull
public void shouldExecuteRaiseAnExceptionIfTheParetoFrontIsNull()
shouldExecuteReturnOneIfTheSecondFrontIsEmpty
public void shouldExecuteReturnOneIfTheSecondFrontIsEmpty()
shouldExecuteReturnTheCorrectValueCaseA
public void shouldExecuteReturnTheCorrectValueCaseA()

Given a frontA with points [0.0,6.0], [2.0,3.0],[4.0,2.0] and a frontB with points [1.0,7.0], [2.0,3.0], [3.5, 1.0], the value of setCoverage(frontA, frontB) == 1/3 and setCoverage(frontB, frontA) == 1/3

shouldExecuteReturnTheCorrectValueCaseB
public void shouldExecuteReturnTheCorrectValueCaseB()

Given a frontA with points [0.0,6.0], [2.0,3.0],[4.0,2.0] and a frontB with points [1.0,7.0], [2.5,3.0], [5.0, 2.5], the value of setCoverage(frontA, frontB) == 1 and setCoverage(frontB, frontA) == 0

shouldExecuteReturnTheRightValueIfTheFrontsContainOnePointWhichIsNotTheSame
public void shouldExecuteReturnTheRightValueIfTheFrontsContainOnePointWhichIsNotTheSame()

Given a frontA with point [2,3] and a frontB with point [1,2], the value of the setCoverage(frontA, frontB) == 0 and setCoverage(frontB, frontA) == 1

shouldExecuteReturnZeroIfBothFrontsAreEmpty
public void shouldExecuteReturnZeroIfBothFrontsAreEmpty()
shouldExecuteReturnZeroIfTheFrontsContainOnePointWhichIsTheSame
public void shouldExecuteReturnZeroIfTheFrontsContainOnePointWhichIsTheSame()
shouldGetNameReturnTheCorrectValue
public void shouldGetNameReturnTheCorrectValue()

The same case as shouldExecuteReturnTheCorrectValueCaseB() but using solution lists

Spread

public class Spread<S extends Solution<?>> extends GenericIndicator<S>

This class implements the spread quality indicator. It must be only to two bi-objective problem. Reference: Deb, K., Pratap, A., Agarwal, S., Meyarivan, T.: A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE Trans. on Evol. Computation 6 (2002) 182-197

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
Spread
public Spread()

Default constructor

Spread
public Spread(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
Spread
public Spread(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Throws:
  • FileNotFoundException
Methods
evaluate
public Double evaluate(List<S> solutionList)

Evaluate() method

Parameters:
  • solutionList
getDescription
public String getDescription()
getName
public String getName()
isTheLowerTheIndicatorValueTheBetter
public boolean isTheLowerTheIndicatorValueTheBetter()
spread
public double spread(Front front, Front referenceFront)

Calculates the Spread metric.

Parameters:
  • front – The front.
  • referenceFront – The true pareto front.

org.uma.jmetal.qualityindicator.impl.hypervolume

PISAHypervolume

public class PISAHypervolume<S extends Solution<?>> extends Hypervolume<S>

This class implements the hypervolume indicator. The code is the a Java version of the original metric implementation by Eckart Zitzler. Reference: E. Zitzler and L. Thiele Multiobjective Evolutionary Algorithms: A Comparative Case Study and the Strength Pareto Approach, IEEE Transactions on Evolutionary Computation, vol. 3, no. 4, pp. 257-271, 1999.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
PISAHypervolume
public PISAHypervolume()

Default constructor

PISAHypervolume
public PISAHypervolume(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
PISAHypervolume
public PISAHypervolume(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Throws:
  • FileNotFoundException
Methods
calculateHypervolume
public double calculateHypervolume(double[][] front, int noPoints, int noObjectives)
computeHypervolumeContribution
public List<S> computeHypervolumeContribution(List<S> solutionList, List<S> referenceFrontList)
evaluate
public Double evaluate(List<S> paretoFrontApproximation)

Evaluate() method

Parameters:
  • paretoFrontApproximation
getDescription
public String getDescription()
getOffset
public double getOffset()
setOffset
public void setOffset(double offset)

PISAHypervolumeTest

public class PISAHypervolumeTest
Methods
shouldEvaluateWorkProperlyCase1
public void shouldEvaluateWorkProperlyCase1()

CASE 1: solution set -> front obtained from the ZDT1.rf file. Reference front: [0,1], [1,0]

Throws:
  • FileNotFoundException

WFGHypervolume

public class WFGHypervolume<S extends Solution<?>> extends Hypervolume<S>

Created by ajnebro on 2/2/15.

Constructors
WFGHypervolume
public WFGHypervolume()

Default constructor

WFGHypervolume
public WFGHypervolume(String referenceParetoFrontFile)

Constructor

Parameters:
  • referenceParetoFrontFile
Throws:
  • FileNotFoundException
WFGHypervolume
public WFGHypervolume(Front referenceParetoFront)

Constructor

Parameters:
  • referenceParetoFront
Throws:
  • FileNotFoundException
Methods
computeHypervolume
public double computeHypervolume(List<S> solutionList, Point referencePoint)
computeHypervolumeContribution
public List<S> computeHypervolumeContribution(List<S> solutionList, List<S> referenceFrontList)
evaluate
public Double evaluate(List<S> solutionList)
get2DHV
public double get2DHV(List<? extends Solution<?>> solutionSet)

Computes the HV of a solution list. REQUIRES: The problem is bi-objective REQUIRES: The setArchive is ordered in descending order by the second objective

getDescription
public String getDescription()
getOffset
public double getOffset()
setOffset
public void setOffset(double offset)

WFGHypervolumeTest

public class WFGHypervolumeTest

Created by ajnebro on 17/12/15.

Methods
setup
public void setup()
shouldEvaluateWorkProperlyCase1
public void shouldEvaluateWorkProperlyCase1()

CASE 1: solution set -> front composed of the points [0.25, 0.75] and [0.75, 0.25]. Reference point: [1.0, 1.0]

shouldEvaluateWorkProperlyCase2
public void shouldEvaluateWorkProperlyCase2()

CASE 2: solution set -> front composed of the points [0.25, 0.75], [0.75, 0.25] and [0.5, 0.5]. Reference point: [1.0, 1.0]

shouldEvaluateWorkProperlyCase3
public void shouldEvaluateWorkProperlyCase3()

CASE 3: solution set -> front composed of the points [0.25, 0.75], [0.75, 0.25] and [0.5, 0.5]. Reference point: [1.5, 1.5]

shouldEvaluateWorkProperlyCase4
public void shouldEvaluateWorkProperlyCase4()

CASE 4: solution set -> front obtained from the ZDT1.rf file. Reference point: [1.0, 1,0]

Throws:
  • FileNotFoundException
simpleTest
public void simpleTest()

org.uma.jmetal.qualityindicator.impl.hypervolume.util

WfgHypervolumeFront

public class WfgHypervolumeFront extends ArrayFront

Created by ajnebro on 3/2/15.

Constructors
WfgHypervolumeFront
public WfgHypervolumeFront()
WfgHypervolumeFront
public WfgHypervolumeFront(List<? extends Solution<?>> solutionList)
WfgHypervolumeFront
public WfgHypervolumeFront(int numberOfPoints, int dimensions)
Methods
getNumberOfPoints
public int getNumberOfPoints()
getPoint
public Point getPoint(int index)
setNumberOfPoints
public void setNumberOfPoints(int numberOfPoints)
setPoint
public void setPoint(int index, Point point)

WfgHypervolumeVersion

public class WfgHypervolumeVersion

Created by ajnebro on 2/2/15.

Fields
OPT
static final int OPT
maximizing
boolean maximizing
Constructors
WfgHypervolumeVersion
public WfgHypervolumeVersion(int dimension, int maxNumberOfPoints)
WfgHypervolumeVersion
public WfgHypervolumeVersion(int dimension, int maxNumberOfPoints, Point referencePoint)
Methods
dominates2way
int dominates2way(Point p, Point q)
get2DHV
public double get2DHV(WfgHypervolumeFront front)
getExclusiveHV
public double getExclusiveHV(WfgHypervolumeFront front, int point)
getHV
public double getHV(WfgHypervolumeFront front)
getInclusiveHV
public double getInclusiveHV(Point point)
getLessContributorHV
public int getLessContributorHV(List<Solution<?>> solutionList)
main
public static void main(String[] args)
makeDominatedBit
public void makeDominatedBit(WfgHypervolumeFront front, int p)

org.uma.jmetal.runner.multiobjective

ABYSSRunner

public class ABYSSRunner extends AbstractAlgorithmRunner

This class is the main program used to configure and run AbYSS, a multiobjective scatter search metaheuristics, which is described in: A.J. Nebro, F. Luna, E. Alba, B. Dorronsoro, J.J. Durillo, A. Beham “AbYSS: Adapting Scatter Search to Multiobjective Optimization.” IEEE Transactions on Evolutionary Computation. Vol. 12, No. 4 (August 2008), pp. 439-457

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.AbYSSRunner problemName [referenceFront]

CDGRunner

public class CDGRunner extends AbstractAlgorithmRunner

Class for configuring and running the CDG algorithm The paper and Matlab code can be download at http://xinyecai.github.io/

Author:Feng Zhang
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

CellDERunner

public class CellDERunner extends AbstractAlgorithmRunner

Class to configure and run the MOCell algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOCellRunner problemName [referenceFront]

DMOPSOMeasuresRunner

public class DMOPSOMeasuresRunner extends AbstractAlgorithmRunner

Class for configuring and running the DMOPSO algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.DMOPSORunner problemName [referenceFront]

DMOPSORunner

public class DMOPSORunner extends AbstractAlgorithmRunner

Class for configuring and running the DMOPSO algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

ESPEARunner

public class ESPEARunner extends AbstractAlgorithmRunner

Class to configure and run the ESPEA algorithm

Author:Marlon Braun
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.ESPEARunner problemName [referenceFront]

GDE3BigDataRunner

public class GDE3BigDataRunner

Class for configuring and running the GDE3 algorithm for solving a problem of the Big Optimization competition at CEC2015

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: mvn -pl jmetal-exec exec:java -Dexec.mainClass=”org.uma.jmetal.runner.multiobjective.GDE3BigDataRunner” -Dexec.args=”[problemName]”

GDE3Runner

public class GDE3Runner extends AbstractAlgorithmRunner

Class for configuring and running the GDE3 algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.GDE3Runner problemName [referenceFront]

GNSGAIIMeasuresWithChartsRunner

public class GNSGAIIMeasuresWithChartsRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm (variant with measures) with the G-Dominance Comparator.

Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIMeasuresRunner problemName [referenceFront]

GWASGFARunner

public class GWASGFARunner extends AbstractAlgorithmRunner
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.GWASGFARunner problemName [referenceFront]

IBEARunner

public class IBEARunner extends AbstractAlgorithmRunner

Class for configuring and running the IBEA algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

MOCHC45Runner

public class MOCHC45Runner extends AbstractAlgorithmRunner

This class executes the algorithm described in: A.J. Nebro, E. Alba, G. Molina, F. Chicano, F. Luna, J.J. Durillo “Optimal antenna placement using a new multi-objective chc algorithm”. GECCO ‘07: Proceedings of the 9th annual conference on Genetic and evolutionary computation. London, England. July 2007.

Methods
main
public static void main(String[] args)

MOCHCRunner

public class MOCHCRunner extends AbstractAlgorithmRunner

This class executes the algorithm described in: A.J. Nebro, E. Alba, G. Molina, F. Chicano, F. Luna, J.J. Durillo “Optimal antenna placement using a new multi-objective chc algorithm”. GECCO ‘07: Proceedings of the 9th annual conference on Genetic and evolutionary computation. London, England. July 2007.

Methods
main
public static void main(String[] args)

MOCellHVRunner

public class MOCellHVRunner extends AbstractAlgorithmRunner

Class to configure and run the MOCell algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOCellRunner problemName [referenceFront]

MOCellRunner

public class MOCellRunner extends AbstractAlgorithmRunner

Class to configure and run the MOCell algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOCellRunner problemName [referenceFront]

MOEADDRunner

public class MOEADDRunner extends AbstractAlgorithmRunner

Class for configuring and running the MOEA/DD algorithm

Author:
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOEADRunner problemName [referenceFront]

MOEADRunner

public class MOEADRunner extends AbstractAlgorithmRunner

Class for configuring and running the MOEA/D algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOEADRunner problemName [referenceFront]

MOEADSTMRunner

public class MOEADSTMRunner extends AbstractAlgorithmRunner

Class for configuring and running the MOEA/D algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOEADRunner problemName [referenceFront]

MOMBI2Runner

public class MOMBI2Runner extends AbstractAlgorithmRunner

Class to configure and run the MOMBI2 algorithm

Author:Juan J. Durillo Reference: Improved Metaheuristic Based on the R2 Indicator for Many-Objective Optimization. R. Hernández Gómez, C.A. Coello Coello. Proceeding GECCO ‘15 Proceedings of the 2015 on Genetic and Evolutionary Computation Conference. Pages 679-686 DOI: 10.1145/2739480.2754776
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOMBIRunner problemName [referenceFront]

MOMBIRunner

public class MOMBIRunner extends AbstractAlgorithmRunner

Class to configure and run the MOMBI algorithm

Author:Juan J. Durillo
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.MOMBIRunner problemName [referenceFront]

NSGAII45Runner

public class NSGAII45Runner extends AbstractAlgorithmRunner

Class to configure and run the implementation of the NSGA-II algorithm included in NSGAII45

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAII45Runner problemName [referenceFront]

NSGAIIBigDataRunner

public class NSGAIIBigDataRunner extends AbstractAlgorithmRunner

Class for configuring and running the NSGA-II algorithm to solve a problem of the CEC 2015 Big Optimization competition

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

NSGAIIBinaryRunner

public class NSGAIIBinaryRunner extends AbstractAlgorithmRunner

Class for configuring and running the NSGA-II algorithm (binary encoding)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

NSGAIIEbesRunner

public class NSGAIIEbesRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm to solve the Ebes problem

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIRunner problemName [referenceFront]

NSGAIIIRunner

public class NSGAIIIRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-III algorithm

Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • java.io.IOException
  • SecurityException
  • ClassNotFoundException – Usage: three options - org.uma.jmetal.runner.multiobjective.NSGAIIIRunner - org.uma.jmetal.runner.multiobjective.NSGAIIIRunner problemName - org.uma.jmetal.runner.multiobjective.NSGAIIIRunner problemName paretoFrontFile

NSGAIIIntegerRunner

public class NSGAIIIntegerRunner extends AbstractAlgorithmRunner

Class for configuring and running the NSGA-II algorithm (integer encoding)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

NSGAIIMeasuresRunner

public class NSGAIIMeasuresRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm (variant with measures)

Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIMeasuresRunner problemName [referenceFront]

NSGAIIMeasuresWithChartsRunner

public class NSGAIIMeasuresWithChartsRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm (variant with measures)

Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIMeasuresRunner problemName [referenceFront]

NSGAIIMeasuresWithHypervolumeRunner

public class NSGAIIMeasuresWithHypervolumeRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm (variant with measures)

Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIMeasuresRunner problemName [referenceFront]

NSGAIIRunner

public class NSGAIIRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIRunner problemName [referenceFront]

NSGAIIStoppingByTimeRunner

public class NSGAIIStoppingByTimeRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm (version NSGAIIStoppingByTime)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIRunner problemName [referenceFront]

NSGAIITSPRunner

public class NSGAIITSPRunner extends AbstractAlgorithmRunner

Class for configuring and running the NSGA-II algorithm to solve the bi-objective TSP

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

OMOPSORunner

public class OMOPSORunner extends AbstractAlgorithmRunner

Class for configuring and running the OMOPSO algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

PAESRunner

public class PAESRunner extends AbstractAlgorithmRunner

Class for configuring and running the PAES algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.PAESRunner problemName [referenceFront]

PESA2Runner

public class PESA2Runner extends AbstractAlgorithmRunner

Class for configuring and running the PESA2 algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.PESA2Runner problemName [referenceFront]

ParallelGDE3Runner

public class ParallelGDE3Runner extends AbstractAlgorithmRunner

Class for configuring and running the GDE3 algorithm (parallel version)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.ParallelGDE3Runner problemName [referenceFront]

ParallelNSGAIIRunner

public class ParallelNSGAIIRunner extends AbstractAlgorithmRunner

Class for configuring and running the NSGA-II algorithm (parallel version)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.ParallelNSGAIIRunner problemName [referenceFront]

ParallelPESA2Runner

public class ParallelPESA2Runner extends AbstractAlgorithmRunner

Class for configuring and running the PESA2 algorithm (parallel version)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.ParallelPESA2Runner problemName [referenceFront]

ParallelSMPSORunner

public class ParallelSMPSORunner extends AbstractAlgorithmRunner

Class for configuring and running the SMPSO algorithm (parallel version)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments. The first (optional) argument specifies the problem to solve.
Throws:

ParallelSPEA2Runner

public class ParallelSPEA2Runner extends AbstractAlgorithmRunner

/** Class for configuring and running the SPEA2 algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.ParallelSPEA2Runner problemName [referenceFront]

RNSGAIIConstraintRunner

public class RNSGAIIConstraintRunner extends AbstractAlgorithmRunner

Class to configure and run the R-NSGA-II algorithm

Author:Antonio J. Nebro , Cristobal Barba
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.RNSGAIIRunner problemName [referenceFront]

RNSGAIIRunner

public class RNSGAIIRunner extends AbstractAlgorithmRunner

Class to configure and run the R-NSGA-II algorithm

Author:Antonio J. Nebro , Cristobal Barba
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.RNSGAIIRunner problemName [referenceFront]

RandomSearchRunner

public class RandomSearchRunner extends AbstractAlgorithmRunner

Class for configuring and running the random search algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.RandomSearchRunner problemName [referenceFront]

SMPSOBigDataRunner

public class SMPSOBigDataRunner extends AbstractAlgorithmRunner

Class for configuring and running the SMPSO algorithm to solve a problem of the CEC2015 Big Optimization competition

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments. The first (optional) argument specifies the problem to solve.
Throws:

SMPSOHv2Runner

public class SMPSOHv2Runner extends AbstractAlgorithmRunner

Class for configuring and running the SMPSO algorithm using an HypervolumeArchive, i.e, the SMPSOhv algorithm described in: A.J Nebro, J.J. Durillo, C.A. Coello Coello. Analysis of Leader Selection Strategies in a Multi-Objective Particle Swarm Optimizer. 2013 IEEE Congress on Evolutionary Computation. June 2013 DOI: 10.1109/CEC.2013.6557955 This is a variant using the WFG Hypervolume implementation

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments. The first (optional) argument specifies the problem to solve.
Throws:

SMPSOHvRunner

public class SMPSOHvRunner extends AbstractAlgorithmRunner

Class for configuring and running the SMPSO algorithm using an HypervolumeArchive, i.e, the SMPSOhv algorithm described in: A.J Nebro, J.J. Durillo, C.A. Coello Coello. Analysis of Leader Selection Strategies in a Multi-Objective Particle Swarm Optimizer. 2013 IEEE Congress on Evolutionary Computation. June 2013 DOI: 10.1109/CEC.2013.6557955

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments. The first (optional) argument specifies the problem to solve.
Throws:

SMPSOMeasuresRunner

public class SMPSOMeasuresRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm (variant with measures)

Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIMeasuresRunner problemName [referenceFront]

SMPSOMeasuresWithChartsRunner

public class SMPSOMeasuresWithChartsRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II algorithm (variant with measures)

Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.NSGAIIMeasuresRunner problemName [referenceFront]

SMPSORPChangingTheReferencePointsAndChartsRunner

public class SMPSORPChangingTheReferencePointsAndChartsRunner
Methods
main
public static void main(String[] args)

Program to run the SMPSORP algorithm allowing to change a reference point interactively. SMPSORP is described in “Extending the Speed-constrained Multi-Objective PSO (SMPSO) With Reference Point Based Preference Articulation. Antonio J. Nebro, Juan J. Durillo, José García-Nieto, Cristóbal Barba-González, Javier Del Ser, Carlos A. Coello Coello, Antonio Benítez-Hidalgo, José F. Aldana-Montes. Parallel Problem Solving from Nature – PPSN XV. Lecture Notes In Computer Science, Vol. 11101, pp. 298-310. 2018.” This runner is the one used in the use case included in the paper. In the current implementation, only one reference point can be modified interactively.

Author:Antonio J. Nebro

SMPSORPWithMultipleReferencePointsAndChartsRunner

public class SMPSORPWithMultipleReferencePointsAndChartsRunner
Methods
main
public static void main(String[] args)

Program to run the SMPSORP algorithm with three reference points and plotting a graph during the algorithm execution. SMPSORP is described in “Extending the Speed-constrained Multi-Objective PSO (SMPSO) With Reference Point Based Preference Articulation. Antonio J. Nebro, Juan J. Durillo, José García-Nieto, Cristóbal Barba-González, Javier Del Ser, Carlos A. Coello Coello, Antonio Benítez-Hidalgo, José F. Aldana-Montes. Parallel Problem Solving from Nature – PPSN XV. Lecture Notes In Computer Science, Vol. 11101, pp. 298-310. 2018”.

Author:Antonio J. Nebro

SMPSORPWithMultipleReferencePointsRunner

public class SMPSORPWithMultipleReferencePointsRunner
Methods
main
public static void main(String[] args)

Program to run the SMPSORP algorithm with two reference points. SMPSORP is described in “Extending the Speed-constrained Multi-Objective PSO (SMPSO) With Reference Point Based Preference Articulation. Antonio J. Nebro, Juan J. Durillo, José García-Nieto, Cristóbal Barba-González, Javier Del Ser, Carlos A. Coello Coello, Antonio Benítez-Hidalgo, José F. Aldana-Montes. Parallel Problem Solving from Nature – PPSN XV. Lecture Notes In Computer Science, Vol. 11101, pp. 298-310. 2018”

Author:Antonio J. Nebro

SMPSORPWithOneReferencePointRunner

public class SMPSORPWithOneReferencePointRunner
Methods
main
public static void main(String[] args)

Program to run the SMPSORP algorithm with one reference point. SMPSORP is described in “Extending the Speed-constrained Multi-Objective PSO (SMPSO) With Reference Point Based Preference * Articulation. Antonio J. Nebro, Juan J. Durillo, José García-Nieto, Cristóbal Barba-González, * Javier Del Ser, Carlos A. Coello Coello, Antonio Benítez-Hidalgo, José F. Aldana-Montes. * Parallel Problem Solving from Nature – PPSN XV. Lecture Notes In Computer Science, Vol. 11101, * pp. 298-310. 2018

Author:Antonio J. Nebro

SMPSORunner

public class SMPSORunner extends AbstractAlgorithmRunner

Class for configuring and running the SMPSO algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments. The first (optional) argument specifies the problem to solve.
Throws:

SMSEMOARunner

public class SMSEMOARunner extends AbstractAlgorithmRunner

Class to configure and run the SMSEMOA algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.SMSEMOARunner problemName [referenceFront]

SPEA2BinaryRunner

public class SPEA2BinaryRunner extends AbstractAlgorithmRunner

Class for configuring and running the SPEA2 algorithm (binary encoding)

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • SecurityException – Invoking command: java org.uma.jmetal.runner.multiobjective.SPEA2BinaryRunner problemName [referenceFront]

SPEA2Runner

public class SPEA2Runner extends AbstractAlgorithmRunner

Class for configuring and running the SPEA2 algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

SteadyStateNSGAIIRunner

public class SteadyStateNSGAIIRunner extends AbstractAlgorithmRunner

Class to configure and run the NSGA-II (steady state version) algorithm

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.SteadyStateNSGAIIRunner problemName [referenceFront]

WASFGABinaryRunner

public class WASFGABinaryRunner extends AbstractAlgorithmRunner
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.WASFGARunner problemName [referenceFront]

WASFGAMeasuresRunner

public class WASFGAMeasuresRunner extends AbstractAlgorithmRunner
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

WASFGAMeasuresRunner3D

public class WASFGAMeasuresRunner3D extends AbstractAlgorithmRunner
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:

WASFGARunner

public class WASFGARunner extends AbstractAlgorithmRunner
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments.
Throws:
  • JMetalException
  • FileNotFoundException – Invoking command: java org.uma.jmetal.runner.multiobjective.WASFGABinaryRunner problemName [referenceFront]

org.uma.jmetal.runner.singleobjective

CoralReefsOptimizationRunner

public class CoralReefsOptimizationRunner

Class to configure and run a coral reefs optimization algorithm. The target problem is OneMax.

Author:Inacio Medeiros
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.CoralReefsOptimizationRunner

CovarianceMatrixAdaptationEvolutionStrategyRunner

public class CovarianceMatrixAdaptationEvolutionStrategyRunner
Methods
main
public static void main(String[] args)

DifferentialEvolutionRunner

public class DifferentialEvolutionRunner

Class to configure and run a differential evolution algorithm. The algorithm can be configured to use threads. The number of cores is specified as an optional parameter. The target problem is Sphere.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.DifferentialEvolutionRunner [cores]

ElitistEvolutionStrategyRunner

public class ElitistEvolutionStrategyRunner

Class to configure and run an elitist (mu + lambda) evolution strategy. The target problem is OneMax.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.ElitistEvolutionStrategyRunner

GenerationalGeneticAlgorithmBinaryEncodingRunner

public class GenerationalGeneticAlgorithmBinaryEncodingRunner

Class to configure and run a generational genetic algorithm. The target problem is OneMax.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.GenerationalGeneticAlgorithmBinaryEncodingRunner

GenerationalGeneticAlgorithmDoubleEncodingRunner

public class GenerationalGeneticAlgorithmDoubleEncodingRunner

Class to configure and run a generational genetic algorithm. The target problem is OneMax.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.GenerationalGeneticAlgorithmDoubleEncodingRunner

GenerationalGeneticAlgorithmTSPRunner

public class GenerationalGeneticAlgorithmTSPRunner

Class to configure and run a generational genetic algorithm. The target problem is TSP.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.BinaryGenerationalGeneticAlgorithmRunner

LocalSearchRunner

public class LocalSearchRunner

Class to configure and run a single objective local search. The target problem is OneMax.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.LocalSearchRunner

NonElitistEvolutionStrategyRunner

public class NonElitistEvolutionStrategyRunner

Class to configure and run a non elitist (mu,lamba) evolution strategy. The target problem is OneMax.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.NonElitistEvolutionStrategyRunner

ParallelGenerationalGeneticAlgorithmRunner

public class ParallelGenerationalGeneticAlgorithmRunner

Class to configure and run a parallel (multithreaded) generational genetic algorithm. The number of cores is specified as an optional parameter. A default value is used is the parameter is not provided. The target problem is OneMax

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.ParallelGenerationalGeneticAlgorithmRunner [cores]

SMPSORunner

public class SMPSORunner extends AbstractAlgorithmRunner

Class for configuring and running the SMPSO algorithm to solve a single-objective problem

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)
Parameters:
  • args – Command line arguments. The first (optional) argument specifies the problem to solve.
Throws:

StandardPSO2007Runner

public class StandardPSO2007Runner

Class to configure and run a StandardPSO2007. The algorithm can be configured to use threads. The number of cores is specified as an optional parameter. The target problem is Sphere.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.StandardPSO2007Runner [cores]

StandardPSO2011Runner

public class StandardPSO2011Runner

Class to configure and run a StandardPSO2007. The algorithm can be configured to use threads. The number of cores is specified as an optional parameter. The target problem is Sphere.

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.StandardPSO2007Runner [cores]

SteadyStateGeneticAlgorithmBinaryEncodingRunner

public class SteadyStateGeneticAlgorithmBinaryEncodingRunner

Class to configure and run a steady-state genetic algorithm. The target problem is TSP

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.SteadyStateGeneticAlgorithmBinaryEncodingRunner

SteadyStateGeneticAlgorithmRunner

public class SteadyStateGeneticAlgorithmRunner

Class to configure and run a steady-state genetic algorithm. The target problem is Sphere

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Usage: java org.uma.jmetal.runner.singleobjective.SteadyStateGeneticAlgorithmRunner

org.uma.jmetal.solution

BinarySolution

public interface BinarySolution extends Solution<BinarySet>

Interface representing a binary (bitset) solutions

Author:Antonio J. Nebro
Methods
getNumberOfBits
public int getNumberOfBits(int index)
getTotalNumberOfBits
public int getTotalNumberOfBits()

DoubleBinarySolution

public interface DoubleBinarySolution extends Solution<Object>

Interface representing a solution having an array of real values and a bitset

Author:Antonio J. Nebro
Methods
getLowerBound
public Double getLowerBound(int index)
getNumberOfBits
public int getNumberOfBits()
getNumberOfDoubleVariables
public int getNumberOfDoubleVariables()
getUpperBound
public Double getUpperBound(int index)

DoubleSolution

public interface DoubleSolution extends Solution<Double>

Interface representing a double solutions

Author:Antonio J. Nebro
Methods
getLowerBound
public Double getLowerBound(int index)
getUpperBound
public Double getUpperBound(int index)

IntegerDoubleSolution

public interface IntegerDoubleSolution extends Solution<Number>

Interface representing a solution composed of integers and real values

Author:Antonio J. Nebro
Methods
getLowerBound
public Number getLowerBound(int index)
getNumberOfDoubleVariables
public int getNumberOfDoubleVariables()
getNumberOfIntegerVariables
public int getNumberOfIntegerVariables()
getUpperBound
public Number getUpperBound(int index)

IntegerSolution

public interface IntegerSolution extends Solution<Integer>

Interface representing a integer solutions

Author:Antonio J. Nebro
Methods
getLowerBound
public Integer getLowerBound(int index)
getUpperBound
public Integer getUpperBound(int index)

PermutationSolution

public interface PermutationSolution<T> extends Solution<T>

Interface representing permutation based solutions

Author:Antonio J. Nebro

Solution

public interface Solution<T> extends Serializable

Interface representing a Solution

Author:

Antonio J. Nebro

Parameters:
  • <T> – Type (Double, Integer, etc.)
Methods
copy
Solution<T> copy()
getAttribute
Object getAttribute(Object id)
getNumberOfObjectives
int getNumberOfObjectives()
getNumberOfVariables
int getNumberOfVariables()
getObjective
double getObjective(int index)
getObjectives
double[] getObjectives()
getVariableValue
T getVariableValue(int index)
getVariableValueString
String getVariableValueString(int index)
setAttribute
void setAttribute(Object id, Object value)
setObjective
void setObjective(int index, double value)
setVariableValue
void setVariableValue(int index, T value)

SolutionBuilder

public interface SolutionBuilder<Solution>

A SolutionBuilder allows to generate a Solution by setting its fundamental information, in other words by providing the values of its Variables.

Author:

Matthieu Vergne

Parameters:
  • <Solution>
Methods
build
public Solution build()

This method generates a valid Solution based on all the Values prepared by calling prepare(Variable,Object). Usually, all the Variables should have been prepared before to be able to build a valid Solution, but it depends on the definition of the Solution (e.g. there could have Variables depending on each other, such that preparing one is equivalent to prepare others). Specific implementation could provide a method to know whether or not build() can be called, or other facilities to ensure that a Solution is properly prepared when build() is called.

Returns:a new Solution instance
getVariables
public Collection<Variable<Solution, ?>> getVariables()
Returns:the list of Variables managed by this SolutionBuilder
prepare
public <Value> void prepare(Variable<Solution, Value> variable, Value value)

This method tells which Value to assign to the next Solution, generated by build(), for a given Variable. Once all the required Variables are prepared, build() can be called to generate the Solution. If this method is called several time on the same Variable before to call build(), the last prepared Value should be considered.

Parameters:
  • variable – the Variable to consider
  • value – the Value to prepare for this Variable

SolutionBuilder.Variable

public static interface Variable<Solution, Value> extends DescribedEntity

A Variable represents the fundamental information of a set of homogeneous Solutions (e.g. a population of solutions returned by an Algorithm). For instance, an Algorithm used to solve a TSP problem would manage a whole population of Solutions, each representing a different path, and a Variable would represent a type of information which defines these Solutions, like the path they represent or something more fine grained like the ith city.

Author:

Matthieu Vergne

Parameters:
  • <Solution>
  • <Value>
Methods
get
public Value get(Solution solution)
Parameters:
Returns:

the Value of the Variable for this Solution

SolutionEvaluator

public interface SolutionEvaluator<Solution>

A SolutionEvaluator allows to evaluate a Solution on one or several dimensions, in other words to compute its Objective values.

Author:

Matthieu Vergne

Parameters:
  • <Solution>
Methods
getObjectives
public Collection<Objective<Solution, ?>> getObjectives()
Returns:the list of Objectives managed by this SolutionEvaluator

SolutionEvaluator.Objective

public static interface Objective<Solution, Value> extends DescribedEntity

An Objective represents the evaluation information of a set of homogeneous Solutions (e.g. a population of solutions returned by an Algorithm). For instance, an Algorithm used to solve a TSP problem would manage a whole population of Solutions, each representing a different path, and an Objective would represent a type of information which evaluates these Solutions, like the length of the path, the time needed to travel through this path, or the amount of fuel consumed.

Author:

Matthieu Vergne

Parameters:
  • <Solution>
  • <Value>
Methods
get
public Value get(Solution solution)
Parameters:
Returns:

the Value of the Objective for this Solution

org.uma.jmetal.solution.impl

AbstractGenericSolution

public abstract class AbstractGenericSolution<T, P extends Problem<?>> implements Solution<T>

Abstract class representing a generic solution

Author:Antonio J. Nebro
Fields
attributes
protected Map<Object, Object> attributes
problem
protected P problem
randomGenerator
protected final JMetalRandom randomGenerator
Constructors
AbstractGenericSolution
protected AbstractGenericSolution(P problem)

Constructor

Methods
equals
public boolean equals(Object o)
getAttribute
public Object getAttribute(Object id)
getNumberOfObjectives
public int getNumberOfObjectives()
getNumberOfVariables
public int getNumberOfVariables()
getObjective
public double getObjective(int index)
getObjectives
public double[] getObjectives()
getVariableValue
public T getVariableValue(int index)
hashCode
public int hashCode()
initializeObjectiveValues
protected void initializeObjectiveValues()
setAttribute
public void setAttribute(Object id, Object value)
setObjective
public void setObjective(int index, double value)
setVariableValue
public void setVariableValue(int index, T value)
toString
public String toString()

ArrayDoubleSolution

public class ArrayDoubleSolution implements DoubleSolution

Implementation of DoubleSolution using arrays.

Author:Antonio J. Nebro
Fields
attributes
protected Map<Object, Object> attributes
problem
protected DoubleProblem problem
randomGenerator
protected final JMetalRandom randomGenerator
Constructors
ArrayDoubleSolution
public ArrayDoubleSolution(DoubleProblem problem)

Constructor

ArrayDoubleSolution
public ArrayDoubleSolution(ArrayDoubleSolution solution)

Copy constructor

Parameters:
  • solution – to copy
Methods
copy
public Solution<Double> copy()
equals
public boolean equals(Object o)
getAttribute
public Object getAttribute(Object id)
getLowerBound
public Double getLowerBound(int index)
getNumberOfObjectives
public int getNumberOfObjectives()
getNumberOfVariables
public int getNumberOfVariables()
getObjective
public double getObjective(int index)
getObjectives
public double[] getObjectives()
getUpperBound
public Double getUpperBound(int index)
getVariableValue
public Double getVariableValue(int index)
getVariableValueString
public String getVariableValueString(int index)
hashCode
public int hashCode()
setAttribute
public void setAttribute(Object id, Object value)
setObjective
public void setObjective(int index, double value)
setVariableValue
public void setVariableValue(int index, Double value)

ArrayDoubleSolutionTest

public class ArrayDoubleSolutionTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldConstructorCreateAnObject
public void shouldConstructorCreateAnObject()
shouldCopyConstructorCreateAnIdenticalSolution
public void shouldCopyConstructorCreateAnIdenticalSolution()
shouldGetLowerBoundReturnTheRightValue
public void shouldGetLowerBoundReturnTheRightValue()
shouldGetUpperBoundReturnTheRightValue
public void shouldGetUpperBoundReturnTheRightValue()

DefaultBinarySolution

public class DefaultBinarySolution extends AbstractGenericSolution<BinarySet, BinaryProblem> implements BinarySolution

Defines an implementation of a binary solution

Author:Antonio J. Nebro
Constructors
DefaultBinarySolution
public DefaultBinarySolution(BinaryProblem problem)

Constructor

DefaultBinarySolution
public DefaultBinarySolution(DefaultBinarySolution solution)

Copy constructor

Methods
copy
public DefaultBinarySolution copy()
getNumberOfBits
public int getNumberOfBits(int index)
getTotalNumberOfBits
public int getTotalNumberOfBits()
getVariableValueString
public String getVariableValueString(int index)

DefaultBinarySolutionTest

public class DefaultBinarySolutionTest
Fields
problem
BinaryProblem problem
Methods
setUp
public void setUp()
shouldCopyReturnAnIdenticalVariable
public void shouldCopyReturnAnIdenticalVariable()
shouldGetNumberOfBitsBeEqualToTheNumberOfOfBitsPerVariable
public void shouldGetNumberOfBitsBeEqualToTheNumberOfOfBitsPerVariable()
shouldGetTotalNumberOfBitsBeEqualToTheSumOfBitsPerVariable
public void shouldGetTotalNumberOfBitsBeEqualToTheSumOfBitsPerVariable()
shouldGetVariableValueStringReturnARightStringRepresentation
public void shouldGetVariableValueStringReturnARightStringRepresentation()
shouldTheHashCodeOfTwoIdenticalSolutionsBeTheSame
public void shouldTheHashCodeOfTwoIdenticalSolutionsBeTheSame()
shouldTheSumOfGetNumberOfBitsBeEqualToTheSumOfBitsPerVariable
public void shouldTheSumOfGetNumberOfBitsBeEqualToTheSumOfBitsPerVariable()
tearDown
public void tearDown()

DefaultDoubleBinarySolution

public class DefaultDoubleBinarySolution extends AbstractGenericSolution<Object, DoubleBinaryProblem<?>> implements DoubleBinarySolution

Description: - this solution contains an array of double value + a binary string - getNumberOfVariables() returns the number of double values + 1 (the string) - getNumberOfDoubleVariables() returns the number of double values - getNumberOfVariables() = getNumberOfDoubleVariables() + 1 - the bitset is the last variable

Author:Antonio J. Nebro
Constructors
DefaultDoubleBinarySolution
public DefaultDoubleBinarySolution(DoubleBinaryProblem<?> problem)

Constructor

DefaultDoubleBinarySolution
public DefaultDoubleBinarySolution(DefaultDoubleBinarySolution solution)

Copy constructor

Methods
copy
public DefaultDoubleBinarySolution copy()
getLowerBound
public Double getLowerBound(int index)
getNumberOfBits
public int getNumberOfBits()
getNumberOfDoubleVariables
public int getNumberOfDoubleVariables()
getUpperBound
public Double getUpperBound(int index)
getVariableValueString
public String getVariableValueString(int index)

DefaultDoubleSolution

public class DefaultDoubleSolution extends AbstractGenericSolution<Double, DoubleProblem> implements DoubleSolution

Defines an implementation of a double solution

Author:Antonio J. Nebro
Constructors
DefaultDoubleSolution
public DefaultDoubleSolution(DoubleProblem problem)

Constructor

DefaultDoubleSolution
public DefaultDoubleSolution(DefaultDoubleSolution solution)

Copy constructor

Methods
copy
public DefaultDoubleSolution copy()
getLowerBound
public Double getLowerBound(int index)
getUpperBound
public Double getUpperBound(int index)
getVariableValueString
public String getVariableValueString(int index)

DefaultIntegerDoubleSolution

public class DefaultIntegerDoubleSolution extends AbstractGenericSolution<Number, IntegerDoubleProblem<?>> implements IntegerDoubleSolution

Defines an implementation of a class for solutions having integers and doubles

Author:Antonio J. Nebro
Constructors
DefaultIntegerDoubleSolution
public DefaultIntegerDoubleSolution(IntegerDoubleProblem<?> problem)

Constructor

DefaultIntegerDoubleSolution
public DefaultIntegerDoubleSolution(DefaultIntegerDoubleSolution solution)

Copy constructor

Methods
getLowerBound
public Number getLowerBound(int index)
getNumberOfDoubleVariables
public int getNumberOfDoubleVariables()
getNumberOfIntegerVariables
public int getNumberOfIntegerVariables()
getUpperBound
public Number getUpperBound(int index)
getVariableValueString
public String getVariableValueString(int index)

DefaultIntegerPermutationSolution

public class DefaultIntegerPermutationSolution extends AbstractGenericSolution<Integer, PermutationProblem<?>> implements PermutationSolution<Integer>

Defines an implementation of solution composed of a permuation of integers

Author:Antonio J. Nebro
Constructors
DefaultIntegerPermutationSolution
public DefaultIntegerPermutationSolution(PermutationProblem<?> problem)

Constructor

DefaultIntegerPermutationSolution
public DefaultIntegerPermutationSolution(DefaultIntegerPermutationSolution solution)

Copy Constructor

Methods
getVariableValueString
public String getVariableValueString(int index)

DefaultIntegerPermutationSolutionTest

public class DefaultIntegerPermutationSolutionTest
Author:Antonio J. Nebro
Methods
shouldConstructorCreateAValidSolution
public void shouldConstructorCreateAValidSolution()

DefaultIntegerSolution

public class DefaultIntegerSolution extends AbstractGenericSolution<Integer, IntegerProblem> implements IntegerSolution

Defines an implementation of an integer solution

Author:Antonio J. Nebro
Constructors
DefaultIntegerSolution
public DefaultIntegerSolution(IntegerProblem problem)

Constructor

DefaultIntegerSolution
public DefaultIntegerSolution(DefaultIntegerSolution solution)

Copy constructor

Methods
copy
public DefaultIntegerSolution copy()
getLowerBound
public Integer getLowerBound(int index)
getUpperBound
public Integer getUpperBound(int index)
getVariableValueString
public String getVariableValueString(int index)

DoubleSolutionComparisonIT

public class DoubleSolutionComparisonIT

Integration test to compare the performance of ArrayDoubleSolution against DefaultDoubleSolution

Author:Antonio J. Nebro
Methods
compareDoubleSolutionImplementationsWhenCreatingSolutions
public void compareDoubleSolutionImplementationsWhenCreatingSolutions()
compareDoubleSolutionImplementationsWhenEvaluatingSolutions
public void compareDoubleSolutionImplementationsWhenEvaluatingSolutions()

ObjectiveFactory

public class ObjectiveFactory

This factory provides facilities to generate Objectives from usual situations.

Author:Matthieu Vergne
Methods
createFromGetters
public <Solution> Collection<Objective<Solution, ?>> createFromGetters(Class<Solution> solutionClass)

This method retrieves all the values accessible through a getter ( getX() method) in order to build the corresponding set of Objectives. Notice that Objectives are supposed to represent evaluations of a Solution, so if the Solution has other kinds of information accessible through getters, they will also be retrieved as Objectives. In such a case, you should filter the returned Objectives, rely on more advanced methods, or generate the Objectives manually.

Parameters:
  • solutionClass – the Solution class to analyze
Returns:

the set of Objectives retrieved from this class

See also: .createFromLonelyGetters(Class)

createFromGettersWithoutSetters
public <Solution> Collection<Objective<Solution, ?>> createFromGettersWithoutSetters(Class<Solution> solutionClass)

This method retrieves all the values accessible through a getter ( getX() method) in order to build the corresponding set of Objectives. At the opposite of createFromGetters(Class), an additional filter is used: we build an Objective for each getter which does not correspond to a setter (setX() method with the same X than the getter). This method is adapted for Solution implementations which provide setters only for their fundamental values (e.g. the path of a TSP Solution) and use getters only for the computed values (e.g. the length of such a path). Notice that, if all the relevant getters are not present, the corresponding Objectives will not be retrieved. On the opposite, any additional getter which does not correspond to a relevant Objective will be mistakenly retrieved. So be sure that the relevant elements (and only these ones) have their getter (and no setter). Otherwise, you should use a different method or generate the Objectives manually.

Parameters:
  • solutionClass – the Solution class to analyze
Returns:

the set of Objectives retrieved from this class

ObjectiveFactoryTest

public class ObjectiveFactoryTest
Methods
testCreateFromGettersRetrievesAllGetters
public void testCreateFromGettersRetrievesAllGetters()
testCreateFromGettersWithoutSettersRetrievesOnlyGettersWithoutSetters
public void testCreateFromGettersWithoutSettersRetrievesOnlyGettersWithoutSetters()
testRetrieveObjectiveNames
public void testRetrieveObjectiveNames()

VariableFactory

public class VariableFactory

This factory provides facilities to generate Variables from usual situations.

Author:Matthieu Vergne
Methods
createFromGetters
public <Solution> Collection<Variable<Solution, ?>> createFromGetters(Class<Solution> solutionClass)

This method retrieves all the values accessible through a getter ( getX() method) in order to build the corresponding set of Variables. Notice that Variables are supposed to represent the fundamental description of a Solution, so if the Solution has computation or other additional methods which are named as getters, they will also be retrieved as Variables. In such a case, you should filter the returned Variables, rely on more advanced methods, or generate the Variables manually.

Parameters:
  • solutionClass – the Solution class to analyze
Returns:

the set of Variables retrieved from this class

See also: .createFromGettersAndSetters(Class), .createFromGettersAndConstructors(Class)

createFromGettersAndConstructors
public <Solution> Collection<Variable<Solution, ?>> createFromGettersAndConstructors(Class<Solution> solutionClass)

This method retrieves all the values accessible through a getter ( getX() method) in order to build the corresponding set of Variables. At the opposite of createFromGetters(Class), an additional filter is used: we build a Variable for each getter which corresponds to a constructor argument (argument of the same type). This method is adapted for static Solution implementations, which usually have a constructor which takes all the relevant values and provide getters to retrieve them. Because Java reflection does not always provide the required information (e.g. names of constructor arguments), this method can be applied only on solution classes which meet strict constraints:

  • only one getter should return a given type
  • for each constructor and between constructors, only one argument should be of a given type (it can appear in several constructors, but it should be always the same argument)

If all the constraints are not met, an exception will be thrown.

Parameters:
  • solutionClass – the Solution class to analyze
Throws:
Returns:

the set of Variables retrieved from this class

createFromGettersAndSetters
public <Solution> Collection<Variable<Solution, ?>> createFromGettersAndSetters(Class<Solution> solutionClass)

This method retrieves all the values accessible through a getter ( getX() method) in order to build the corresponding set of Variables. At the opposite of createFromGetters(Class), an additional filter is used: we build a Variable for each getter which corresponds to a setter (setX() method with the same X than the getter). This method is adapted for dynamic Solution implementations, thus allowing to change the value of its Variables (e.g. change the path of a TSP Solution). Notice that, if all the relevant setters are not present (or they do not strictly respect the naming of the getter), the corresponding Variables will not be retrieved. On the opposite, any additional setter/getter couple which does not correspond to a relevant Variable will be mistakenly retrieved. So be sure that the relevant elements (and only these ones) have their setter and getter. Otherwise, you should use a different method or generate the Variables manually.

Parameters:
  • solutionClass – the Solution class to analyze
Returns:

the set of Variables retrieved from this class

VariableFactory.IsInterfaceException

public static class IsInterfaceException extends RuntimeException
Constructors
IsInterfaceException
public IsInterfaceException(Class<?> solutionClass)

VariableFactoryTest

public class VariableFactoryTest
Methods
testCreateFromGettersAndConstructorsRetrievesOnlyGettersWithConstructorArgument
public void testCreateFromGettersAndConstructorsRetrievesOnlyGettersWithConstructorArgument()
testCreateFromGettersAndConstructorsThrowExceptionIfInterface
public void testCreateFromGettersAndConstructorsThrowExceptionIfInterface()
testCreateFromGettersAndConstructorsThrowExceptionIfOverlappingTypes
public void testCreateFromGettersAndConstructorsThrowExceptionIfOverlappingTypes()
testCreateFromGettersAndSettersRetrievesOnlyGettersWithSetters
public void testCreateFromGettersAndSettersRetrievesOnlyGettersWithSetters()
testCreateFromGettersRetrievesAllGetters
public void testCreateFromGettersRetrievesAllGetters()
testRetrieveVariableNames
public void testRetrieveVariableNames()

org.uma.jmetal.solution.util

RepairDoubleSolution

public interface RepairDoubleSolution extends Serializable
Author:Antonio J. Nebro
Methods
repairSolutionVariableValue
public double repairSolutionVariableValue(double value, double lowerBound, double upperBound)

Checks if a given value is between its bounds and repairs it otherwise

Parameters:
  • value – The value to be checked
  • lowerBound
  • upperBound
Returns:

The same value if it is between the limits or a repaired value otherwise

RepairDoubleSolutionAtBounds

public class RepairDoubleSolutionAtBounds implements RepairDoubleSolution
Author:Antonio J. Nebro
Methods
repairSolutionVariableValue
public double repairSolutionVariableValue(double value, double lowerBound, double upperBound)

Checks if the value is between its bounds; if not, the lower or upper bound is returned

Parameters:
  • value – The value to be checked
  • lowerBound
  • upperBound
Returns:

The same value if it is in the limits or a repaired value otherwise

RepairDoubleSolutionAtBoundsTest

public class RepairDoubleSolutionAtBoundsTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldRRepairDoubleSolutionAtBoundsAssignTheLowerBoundIfValueIsLessThanIt
public void shouldRRepairDoubleSolutionAtBoundsAssignTheLowerBoundIfValueIsLessThanIt()
shouldRRepairDoubleSolutionAtBoundsAssignTheUpperBoundIfValueIsGreaterThanIt
public void shouldRRepairDoubleSolutionAtBoundsAssignTheUpperBoundIfValueIsGreaterThanIt()
shouldRRepairDoubleSolutionAtBoundsRaiseAnExceptionIfTheBoundsAreIncorrect
public void shouldRRepairDoubleSolutionAtBoundsRaiseAnExceptionIfTheBoundsAreIncorrect()

RepairDoubleSolutionAtRandom

public class RepairDoubleSolutionAtRandom implements RepairDoubleSolution
Author:Antonio J. Nebro
Constructors
RepairDoubleSolutionAtRandom
public RepairDoubleSolutionAtRandom()

Constructor

RepairDoubleSolutionAtRandom
public RepairDoubleSolutionAtRandom(BoundedRandomGenerator<Double> randomGenerator)

Constructor

Methods
repairSolutionVariableValue
public double repairSolutionVariableValue(double value, double lowerBound, double upperBound)

Checks if the value is between its bounds; if not, a random value between the limits is returned

Parameters:
  • value – The value to be checked
  • lowerBound
  • upperBound
Returns:

The same value if it is between the limits or a repaired value otherwise

RepairDoubleSolutionAtRandomTest

public class RepairDoubleSolutionAtRandomTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()
shouldRRepairDoubleSolutionAtRandomAssignARandomValueIfValueIsGreaterThanTheUpperBound
public void shouldRRepairDoubleSolutionAtRandomAssignARandomValueIfValueIsGreaterThanTheUpperBound()
shouldRRepairDoubleSolutionAtRandomAssignARandomValueIfValueIsLessThanTheLowerBound
public void shouldRRepairDoubleSolutionAtRandomAssignARandomValueIfValueIsLessThanTheLowerBound()
shouldRRepairDoubleSolutionAtRandomRaiseAnExceptionIfTheBoundsAreIncorrect
public void shouldRRepairDoubleSolutionAtRandomRaiseAnExceptionIfTheBoundsAreIncorrect()

org.uma.jmetal.util

AbstractAlgorithmRunner

public abstract class AbstractAlgorithmRunner

Abstract class for Runner classes

Author:Antonio J. Nebro
Methods
printFinalSolutionSet
public static void printFinalSolutionSet(List<? extends Solution<?>> population)

Write the population into two files and prints some data on screen

Parameters:
  • population
printQualityIndicators
public static <S extends Solution<?>> void printQualityIndicators(List<S> population, String paretoFrontFile)

Print all the available quality indicators

Parameters:
  • population
  • paretoFrontFile
Throws:
  • FileNotFoundException

AdaptiveGrid

public class AdaptiveGrid<S extends Solution<?>>

This class defines an adaptive grid over a list of solutions as the one used by algorithm PAES.

Author:Antonio J. Nebro, Juan J. Durillo
Constructors
AdaptiveGrid
public AdaptiveGrid(int bisections, int objectives)

Constructor. Creates an instance of AdaptiveGrid.

Parameters:
  • bisections – Number of bi-divisions of the objective space.
  • objectives – Number of numberOfObjectives of the problem.
Methods
addSolution
public void addSolution(int location)

Increases the number of solutions into a specific hypercube.

Parameters:
  • location – Number of hypercube.
calculateOccupied
public void calculateOccupied()

Calculates the number of hypercubes having one or more solutions. return the number of hypercubes with more than zero solutions.

getAverageOccupation
public double getAverageOccupation()

Return the average number of solutions in the occupied hypercubes

getBisections
public int getBisections()

Returns the number of bi-divisions performed in each objective.

Returns:the number of bi-divisions.
getHypercubes
public int[] getHypercubes()
getLocationDensity
public int getLocationDensity(int location)

Returns the number of solutions into a specific hypercube.

Parameters:
  • location – Number of the hypercube.
Returns:

The number of solutions into a specific hypercube.

getMostPopulatedHypercube
public int getMostPopulatedHypercube()

Returns the value of the most populated hypercube.

Returns:The hypercube with the maximum number of solutions.
location
public int location(S solution)

Calculates the hypercube of a solution

Parameters:
  • solution – The Solution.
occupiedHypercubes
public int occupiedHypercubes()

Returns the number of hypercubes with more than zero solutions.

Returns:the number of hypercubes with more than zero solutions.
randomOccupiedHypercube
public int randomOccupiedHypercube()

Returns a random hypercube that has more than zero solutions.

Returns:The hypercube.
randomOccupiedHypercube
public int randomOccupiedHypercube(BoundedRandomGenerator<Integer> randomGenerator)

Returns a random hypercube that has more than zero solutions.

Parameters:
Returns:

The hypercube.

removeSolution
public void removeSolution(int location)

Decreases the number of solutions into a specific hypercube.

Parameters:
  • location – Number of hypercube.
rouletteWheel
public int rouletteWheel()

Returns a random hypercube using a rouleteWheel method.

Returns:the number of the selected hypercube.
rouletteWheel
public int rouletteWheel(BoundedRandomGenerator<Double> randomGenerator)

Returns a random hypercube using a rouleteWheel method.

Parameters:
Returns:

the number of the selected hypercube.

toString
public String toString()

Returns a String representing the grid.

Returns:The String.
updateGrid
public void updateGrid(List<S> solutionList)

Updates the grid limits and the grid content adding the solutions contained in a specific solutionList.

Parameters:
  • solutionList – The solutionList.
updateGrid
public void updateGrid(S solution, List<S> solutionSet)

Updates the grid limits and the grid content adding a new Solution. If the solution falls out of the grid bounds, the limits and content of the grid must be re-calculated.

Parameters:
  • solutionSolution considered to update the grid.
  • solutionSetSolutionSet used to update the grid.

AdaptiveGridTest

public class AdaptiveGridTest

Created by ajnebro on 16/3/17.

Methods
shouldConstructorCreateAValidInstance
public void shouldConstructorCreateAValidInstance()
shouldGetAverageOccupationReturnTheRightValue
public void shouldGetAverageOccupationReturnTheRightValue()
shouldGetAverageOccupationReturnZeroIfThereAreNoOccupiedHypercubes
public void shouldGetAverageOccupationReturnZeroIfThereAreNoOccupiedHypercubes()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvidedInRandomOccupiedHypercube
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvidedInRandomOccupiedHypercube()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvidedInRouletteWheel
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvidedInRouletteWheel()
shouldOccupiedHypercubesReturnTheNumberOfOccupiedHypercubes
public void shouldOccupiedHypercubesReturnTheNumberOfOccupiedHypercubes()
shouldOccupiedHypercubesReturnZeroIfThereAreNotOccupiedHypercubes
public void shouldOccupiedHypercubesReturnZeroIfThereAreNotOccupiedHypercubes()

AlgorithmBuilder

public interface AlgorithmBuilder<A extends Algorithm<?>>

Interface representing algorithm builders

Author:Antonio J. Nebro
Methods
build
public A build()

AlgorithmRunner

public class AlgorithmRunner

Class for running algorithms in a concurrent thread

Author:Antonio J. Nebro
Methods
getComputingTime
public long getComputingTime()

AlgorithmRunner.Executor

public static class Executor

Executor class

Fields
algorithm
Algorithm<?> algorithm
computingTime
long computingTime
Constructors
Executor
public Executor(Algorithm<?> algorithm)
Methods
execute
public AlgorithmRunner execute()

JMetalException

public class JMetalException extends RuntimeException implements Serializable

jMetal exception class

Author:Antonio J. Nebro
Constructors
JMetalException
public JMetalException(String message)
JMetalException
public JMetalException(Exception e)
JMetalException
public JMetalException(String message, Exception e)

JMetalLogger

public class JMetalLogger implements Serializable

This class provides some facilities to manage loggers. One might use the static logger of this class or use its own, custom logger. Also, we provide the static method configureLoggers(File) for configuring the loggers easily. This method is automatically called before any use of the static logger, but if you want it to apply on other loggers it is preferable to call it explicitly at the beginning of your main() method.

Author:Antonio J. Nebro , Matthieu Vergne
Fields
logger
public static final Logger logger
Methods
configureLoggers
public static void configureLoggers(File propertyFile)

This method provides a single-call method to configure the Logger instances. A default configuration is considered, enriched with a custom property file for more convenient logging. The custom file is considered after the default configuration, so it can override it if necessary. The custom file might be provided as an argument of this method, otherwise we look for a file named “jMetal.log.ini”. If no custom file is provided, then only the default configuration is considered.

Parameters:
  • propertyFile – the property file to use for custom configuration, null to use only the default configuration
Throws:
  • IOException

ProblemUtils

public class ProblemUtils
Author:Antonio J. Nebro
Methods
loadProblem
public static <S> Problem<S> loadProblem(String problemName)

Create an instance of problem passed as argument

Parameters:
  • problemName – A full qualified problem name
Returns:

An instance of the problem

SolutionListUtils

public class SolutionListUtils

Created by Antonio J. Nebro on 04/10/14. Modified by Juanjo 13/03/15

Methods
distanceMatrix
public static <S extends Solution<?>> double[][] distanceMatrix(List<S> solutionSet)

Returns a matrix with the euclidean distance between each pair of solutions in the population. Distances are measured in the objective space

Parameters:
  • solutionSet
fillPopulationWithNewSolutions
public static <S> void fillPopulationWithNewSolutions(List<S> solutionList, Problem<S> problem, int maxListSize)

Fills a population with new solutions until its size is maxListSize

Parameters:
  • solutionList – The list of solutions
  • problem – The problem being solved
  • maxListSize – The target size of the list
  • <S> – The type of the solutions to be created
findBestSolution
public static <S> S findBestSolution(List<S> solutionList, Comparator<S> comparator)
findIndexOfBestSolution
public static <S> int findIndexOfBestSolution(List<S> solutionList, Comparator<S> comparator)

Finds the index of the best solution in the list according to a comparator

Parameters:
  • solutionList
  • comparator
Returns:

The index of the best solution

findIndexOfWorstSolution
public static <S> int findIndexOfWorstSolution(List<? extends S> solutionList, Comparator<S> comparator)

Finds the index of the worst solution in the list according to a comparator

Parameters:
  • solutionList
  • comparator
Returns:

The index of the best solution

findWorstSolution
public <S> S findWorstSolution(Collection<S> solutionList, Comparator<S> comparator)
getInvertedFront
public static <S extends Solution<?>> List<S> getInvertedFront(List<S> solutionSet)

This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem

Parameters:
  • solutionSet – The front to invert
Returns:

The inverted front

getNondominatedSolutions
public static <S extends Solution<?>> List<S> getNondominatedSolutions(List<S> solutionList)
getNormalizedFront
public static List<Solution<?>> getNormalizedFront(List<Solution<?>> solutionList, List<Double> maximumValue, List<Double> minimumValue)

This method receives a list of non-dominated solutions and maximum and minimum values of the objectives, and returns a the normalized set of solutions.

Parameters:
  • solutionList – A list of non-dominated solutions
  • maximumValue – The maximum values of the objectives
  • minimumValue – The minimum values of the objectives
Returns:

the normalized list of non-dominated solutions

getObjectiveArrayFromSolutionList
public static <S extends Solution<?>> double[] getObjectiveArrayFromSolutionList(List<S> solutionList, int objective)

Given a solution list and the identifier of an objective (0, 1, etc), returns an array with the values of that objective in all the solutions of the list

Parameters:
  • solutionList
  • objective
  • <S>
isSolutionDominatedBySolutionList
public static <S extends Solution<?>> boolean isSolutionDominatedBySolutionList(S solution, List<? extends S> solutionSet)
removeSolutionsFromList
public static <S> void removeSolutionsFromList(List<S> solutionList, int numberOfSolutionsToRemove)

Removes a number of solutions from a list

Parameters:
  • solutionList – The list of solutions
  • numberOfSolutionsToRemove
restart
public static <S> void restart(List<S> solutionList, Problem<S> problem, int percentageOfSolutionsToRemove)

This methods takes a list of solutions, removes a percentage of its solutions, and it is filled with new random generated solutions

Parameters:
  • solutionList
  • problem
  • percentageOfSolutionsToRemove
selectNRandomDifferentSolutions
public static <S> List<S> selectNRandomDifferentSolutions(int numberOfSolutionsToBeReturned, List<S> solutionList)

This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem

Parameters:
  • solutionList – The front to invert
Returns:

The inverted front

selectNRandomDifferentSolutions
public static <S> List<S> selectNRandomDifferentSolutions(int numberOfSolutionsToBeReturned, List<S> solutionList, BoundedRandomGenerator<Integer> randomGenerator)

This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem

Parameters:
  • solutionList – The front to invert
  • randomGenerator – The random generator to use
Returns:

The inverted front

solutionListsAreEquals
public static <S> boolean solutionListsAreEquals(List<S> solutionList, List<S> newSolutionList)

Compares two solution lists to determine if both are equals

Parameters:
  • solutionList – A Solution list
  • newSolutionList – A Solution list
Returns:

true if both are contains the same solutions, false in other case

writeObjectivesToMatrix
public static <S extends Solution<?>> double[][] writeObjectivesToMatrix(List<S> solutionList)

SolutionListUtilsTest

public class SolutionListUtilsTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldExecuteReturnTheSolutionInTheListIfTheListContainsASolution
public void shouldExecuteReturnTheSolutionInTheListIfTheListContainsASolution()
shouldFillPopulationWithNewSolutionsDoNothingIfTheMaxSizeIsLowerThanTheListSize
public void shouldFillPopulationWithNewSolutionsDoNothingIfTheMaxSizeIsLowerThanTheListSize()
shouldFillPopulationWithNewSolutionsIncreaseTheListLengthToTheIndicatedValue
public void shouldFillPopulationWithNewSolutionsIncreaseTheListLengthToTheIndicatedValue()
shouldFindBestSolutionRaiseAnExceptionIfTheComparatorIsNull
public void shouldFindBestSolutionRaiseAnExceptionIfTheComparatorIsNull()
shouldFindBestSolutionRaiseAnExceptionIfTheSolutionListIsEmpty
public void shouldFindBestSolutionRaiseAnExceptionIfTheSolutionListIsEmpty()
shouldFindBestSolutionRaiseAnExceptionIfTheSolutionListIsNull
public void shouldFindBestSolutionRaiseAnExceptionIfTheSolutionListIsNull()

** Unit tests to method findBestSolution ***

shouldFindBestSolutionReturnTheLastOneIfThisIsTheBestSolutionInALastInAListWithFiveSolutions
public void shouldFindBestSolutionReturnTheLastOneIfThisIsTheBestSolutionInALastInAListWithFiveSolutions()
shouldFindBestSolutionReturnTheSecondSolutionInTheListIfIsTheBestOufOfTwoSolutions
public void shouldFindBestSolutionReturnTheSecondSolutionInTheListIfIsTheBestOufOfTwoSolutions()
shouldFindBestSolutionReturnTheSolutionInTheListWhenItContainsOneSolution
public void shouldFindBestSolutionReturnTheSolutionInTheListWhenItContainsOneSolution()
shouldFindIndexOfBestSolutionRaiseAnExceptionIfTheComparatorIsNull
public void shouldFindIndexOfBestSolutionRaiseAnExceptionIfTheComparatorIsNull()
shouldFindIndexOfBestSolutionRaiseAnExceptionIfTheSolutionListIsEmpty
public void shouldFindIndexOfBestSolutionRaiseAnExceptionIfTheSolutionListIsEmpty()
shouldFindIndexOfBestSolutionRaiseAnExceptionIfTheSolutionListIsNull
public void shouldFindIndexOfBestSolutionRaiseAnExceptionIfTheSolutionListIsNull()

** Unit tests to method findIndexOfBestSolution ***

shouldFindIndexOfBestSolutionReturn4IfTheBestSolutionIsTheLastInAListWithFiveSolutions
public void shouldFindIndexOfBestSolutionReturn4IfTheBestSolutionIsTheLastInAListWithFiveSolutions()
shouldFindIndexOfBestSolutionReturnOneIfTheSecondSolutionItTheBestOutOfTwoSolutionInTheList
public void shouldFindIndexOfBestSolutionReturnOneIfTheSecondSolutionItTheBestOutOfTwoSolutionInTheList()
shouldFindIndexOfBestSolutionReturnZeroIfTheFirstSolutionItTheBestOutOfTwoSolutionsInTheList
public void shouldFindIndexOfBestSolutionReturnZeroIfTheFirstSolutionItTheBestOutOfTwoSolutionsInTheList()
shouldFindIndexOfBestSolutionReturnZeroIfTheListWhenItContainsOneSolution
public void shouldFindIndexOfBestSolutionReturnZeroIfTheListWhenItContainsOneSolution()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvidedInSelectNRandomDifferentSolutions
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvidedInSelectNRandomDifferentSolutions()
shouldRestartRemoveTheRequestedPercentageOfSolutions
public void shouldRestartRemoveTheRequestedPercentageOfSolutions()

TODO

shouldSelectNRandomDifferentSolutionsRaiseAnExceptionIfTheListSizeIsOneAndTwoSolutionsAreRequested
public void shouldSelectNRandomDifferentSolutionsRaiseAnExceptionIfTheListSizeIsOneAndTwoSolutionsAreRequested()
shouldSelectNRandomDifferentSolutionsRaiseAnExceptionIfTheSolutionListIsEmpty
public void shouldSelectNRandomDifferentSolutionsRaiseAnExceptionIfTheSolutionListIsEmpty()
shouldSelectNRandomDifferentSolutionsRaiseAnExceptionIfTheSolutionListIsNull
public void shouldSelectNRandomDifferentSolutionsRaiseAnExceptionIfTheSolutionListIsNull()

** Unit tests to method selectNRandomDifferentSolutions ***

shouldSelectNRandomDifferentSolutionsReturnASingleSolution
public void shouldSelectNRandomDifferentSolutionsReturnASingleSolution()
shouldSelectNRandomDifferentSolutionsReturnTheCorrectListOfSolutions
public void shouldSelectNRandomDifferentSolutionsReturnTheCorrectListOfSolutions()

If the list contains 4 solutions, the result list must return all of them

shouldSelectNRandomDifferentSolutionsReturnTheCorrectNumberOfSolutions
public void shouldSelectNRandomDifferentSolutionsReturnTheCorrectNumberOfSolutions()
shouldSelectNRandomDifferentSolutionsReturnTheSolutionSInTheListIfTheListContainsTwoSolutions
public void shouldSelectNRandomDifferentSolutionsReturnTheSolutionSInTheListIfTheListContainsTwoSolutions()
shouldSolutionListsAreEqualsReturnIfTwoIdenticalSolutionListsAreCompared
public void shouldSolutionListsAreEqualsReturnIfTwoIdenticalSolutionListsAreCompared()
shouldSolutionListsAreEqualsReturnIfTwoSolutionListsWithIdenticalSolutionsAreCompared
public void shouldSolutionListsAreEqualsReturnIfTwoSolutionListsWithIdenticalSolutionsAreCompared()
shouldelectNRandomDifferentSolutionsRaiseAnExceptionIfTheListSizeIsTwoAndFourSolutionsAreRequested
public void shouldelectNRandomDifferentSolutionsRaiseAnExceptionIfTheListSizeIsTwoAndFourSolutionsAreRequested()

SolutionUtils

public class SolutionUtils

Created by Antonio J. Nebro on 6/12/14.

Methods
averageDistanceToSolutionList
public static <S extends Solution<?>> double averageDistanceToSolutionList(S solution, List<S> solutionList)

Returns the average euclidean distance of a solution to the solutions of a list.

distanceBetweenObjectives
public static <S extends Solution<?>> double distanceBetweenObjectives(S firstSolution, S secondSolution)

Returns the euclidean distance between a pair of solutions in the objective space

distanceBetweenSolutionsInObjectiveSpace
public static double distanceBetweenSolutionsInObjectiveSpace(DoubleSolution solutionI, DoubleSolution solutionJ)

Returns the distance between two solutions in the search space.

Parameters:
  • solutionI – The first Solution.
  • solutionJ – The second Solution.
Returns:

the distance between solutions.

distanceToSolutionListInSolutionSpace
public static double distanceToSolutionListInSolutionSpace(DoubleSolution solution, List<DoubleSolution> solutionList)

Returns the minimum distance from a Solution to a SolutionSet according to the encodings.variable values.

Parameters:
  • solution – The Solution.
  • solutionList – The List>.
Returns:

The minimum distance between solution and the set.

getBestSolution
public static <S extends Solution<?>> S getBestSolution(S solution1, S solution2, Comparator<S> comparator)

Return the best solution between those passed as arguments. If they are equal or incomparable one of them is chosen randomly.

Returns:The best solution
getBestSolution
public static <S extends Solution<?>> S getBestSolution(S solution1, S solution2, Comparator<S> comparator, RandomGenerator<Double> randomGenerator)

Return the best solution between those passed as arguments. If they are equal or incomparable one of them is chosen randomly.

Parameters:
Returns:

The best solution

getBestSolution
public static <S extends Solution<?>> S getBestSolution(S solution1, S solution2, Comparator<S> comparator, BinaryOperator<S> equalityPolicy)

Return the best solution between those passed as arguments. If they are equal or incomparable one of them is chosen based on the given policy.

Returns:The best solution

SolutionUtilsTest

public class SolutionUtilsTest
Methods
shouldAverageDistanceToSolutionListWorkProperlyCaseA
public void shouldAverageDistanceToSolutionListWorkProperlyCaseA()

Case A. Solution = [1], solutionList = [1]]

shouldAverageDistanceToSolutionListWorkProperlyCaseB
public void shouldAverageDistanceToSolutionListWorkProperlyCaseB()

Case B. Solution = [1], solutionList = [[2]]

shouldAverageDistanceToSolutionListWorkProperlyCaseC
public void shouldAverageDistanceToSolutionListWorkProperlyCaseC()

Case C. Solution = [1], solutionList = [[1], [2]]

shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithOneObjectiveCaseA
public void shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithOneObjectiveCaseA()

Case A: the two solutions are the same

shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithOneObjectiveCaseB
public void shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithOneObjectiveCaseB()

Case B: the two solutions are not the same

shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithTwoObjectivesCaseA
public void shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithTwoObjectivesCaseA()

Case A: the two solutions are the same

shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithTwoObjectivesCaseB
public void shouldDistanceBetweenObjectivesWorkProperlyWithTwoSolutionsWithTwoObjectivesCaseB()

Case B: the two solutions are not the same

org.uma.jmetal.util.archive

Archive

public interface Archive<S> extends Serializable

Interface representing an archive of solutions

Author:Antonio J. Nebro
Methods
add
boolean add(S solution)
get
S get(int index)
getSolutionList
List<S> getSolutionList()
size
int size()

BoundedArchive

public interface BoundedArchive<S> extends Archive<S>

Interface representing a bounded archive of solutions

Author:Antonio J. Nebro
Methods
computeDensityEstimator
void computeDensityEstimator()
getComparator
Comparator<S> getComparator()
getMaxSize
int getMaxSize()
sortByDensityEstimator
void sortByDensityEstimator()

org.uma.jmetal.util.archive.impl

AbstractBoundedArchive

public abstract class AbstractBoundedArchive<S extends Solution<?>> implements BoundedArchive<S>
Author:

Antonio J. Nebro

Parameters:
  • <S>
Fields
archive
protected NonDominatedSolutionListArchive<S> archive
maxSize
protected int maxSize
Constructors
AbstractBoundedArchive
public AbstractBoundedArchive(int maxSize)
Methods
add
public boolean add(S solution)
get
public S get(int index)
getMaxSize
public int getMaxSize()
getSolutionList
public List<S> getSolutionList()
join
public Archive<S> join(Archive<S> archive)
prune
public abstract void prune()
size
public int size()

AdaptiveGridArchive

public class AdaptiveGridArchive<S extends Solution<?>> extends AbstractBoundedArchive<S>

This class implements an archive (solution list) based on an adaptive grid used in PAES

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
AdaptiveGridArchive
public AdaptiveGridArchive(int maxSize, int bisections, int objectives)

Constructor.

Parameters:
  • maxSize – The maximum size of the setArchive
  • bisections – The maximum number of bi-divisions for the adaptive grid.
  • objectives – The number of objectives.
Methods
add
public boolean add(S solution)

Adds a Solution to the setArchive. If the Solution is dominated by any member of the setArchive then it is discarded. If the Solution dominates some members of the setArchive, these are removed. If the setArchive is full and the Solution has to be inserted, one Solution of the most populated hypercube of the adaptive grid is removed.

Parameters:
  • solution – The Solution
Returns:

true if the Solution has been inserted, false otherwise.

computeDensityEstimator
public void computeDensityEstimator()
getComparator
public Comparator<S> getComparator()
getGrid
public AdaptiveGrid<S> getGrid()
prune
public void prune()
sortByDensityEstimator
public void sortByDensityEstimator()

AdaptiveGridArchiveTest

public class AdaptiveGridArchiveTest

Created by ajnebro on 16/11/16.

Methods
shouldConstructorCreateAnArchiveWithTheRightCapacity
public void shouldConstructorCreateAnArchiveWithTheRightCapacity()
shouldConstructorCreateAnEmptyArchive
public void shouldConstructorCreateAnEmptyArchive()
shouldProneDoNothingIfTheArchiveIsEmpty
public void shouldProneDoNothingIfTheArchiveIsEmpty()

CrowdingDistanceArchive

public class CrowdingDistanceArchive<S extends Solution<?>> extends AbstractBoundedArchive<S>

Created by Antonio J. Nebro on 24/09/14. Modified by Juanjo on 07/04/2015

Constructors
CrowdingDistanceArchive
public CrowdingDistanceArchive(int maxSize)
Methods
computeDensityEstimator
public void computeDensityEstimator()
getComparator
public Comparator<S> getComparator()
prune
public void prune()
sortByDensityEstimator
public void sortByDensityEstimator()

HypervolumeArchive

public class HypervolumeArchive<S extends Solution<?>> extends AbstractBoundedArchive<S>

Created by Antonio J. Nebro on 24/09/14.

Fields
hypervolume
Hypervolume<S> hypervolume
Constructors
HypervolumeArchive
public HypervolumeArchive(int maxSize, Hypervolume<S> hypervolume)
Methods
computeDensityEstimator
public void computeDensityEstimator()
getComparator
public Comparator<S> getComparator()
prune
public void prune()
sortByDensityEstimator
public void sortByDensityEstimator()

NonDominatedSolutionListArchive

public class NonDominatedSolutionListArchive<S extends Solution<?>> implements Archive<S>

This class implements an archive containing non-dominated solutions

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
NonDominatedSolutionListArchive
public NonDominatedSolutionListArchive()

Constructor

NonDominatedSolutionListArchive
public NonDominatedSolutionListArchive(DominanceComparator<S> comparator)

Constructor

Methods
add
public boolean add(S solution)

Inserts a solution in the list

Parameters:
  • solution – The solution to be inserted.
Returns:

true if the operation success, and false if the solution is dominated or if an identical individual exists. The decision variables can be null if the solution is read from a file; in that case, the domination tests are omitted

get
public S get(int index)
getSolutionList
public List<S> getSolutionList()
join
public Archive<S> join(Archive<S> archive)
main
public static void main(String[] args)
size
public int size()

NonDominatedSolutionListArchiveTest

public class NonDominatedSolutionListArchiveTest
Author:Antonio J. Nebro .
Methods
shouldAddADominantSolutionInAnArchiveOfSize1DiscardTheExistingSolution
public void shouldAddADominantSolutionInAnArchiveOfSize1DiscardTheExistingSolution()
shouldAddADominantSolutionInAnArchiveOfSize3DiscardTheRestOfSolutions
public void shouldAddADominantSolutionInAnArchiveOfSize3DiscardTheRestOfSolutions()
shouldAddADominatedSolutionInAnArchiveOfSize1DiscardTheNewSolution
public void shouldAddADominatedSolutionInAnArchiveOfSize1DiscardTheNewSolution()
shouldAddANonDominantSolutionInAnArchiveOfSize1IncorporateTheNewSolution
public void shouldAddANonDominantSolutionInAnArchiveOfSize1IncorporateTheNewSolution()
shouldAddASolutionEqualsToOneAlreadyInTheArchiveDoNothing
public void shouldAddASolutionEqualsToOneAlreadyInTheArchiveDoNothing()
shouldAddOnAnEmptyListHaveSizeOne
public void shouldAddOnAnEmptyListHaveSizeOne()
shouldAddOnAnEmptyListInsertTheElement
public void shouldAddOnAnEmptyListInsertTheElement()
shouldConstructorAssignThePassedComparator
public void shouldConstructorAssignThePassedComparator()
shouldConstructorCreateAnEmptyArchive
public void shouldConstructorCreateAnEmptyArchive()
shouldJoinAnEAnEmptyArchiveProduceAnArchiveWithTheSameSolutions
public void shouldJoinAnEAnEmptyArchiveProduceAnArchiveWithTheSameSolutions()
shouldJoinTwoEmptyArchivesReturnAnEmptyArchive
public void shouldJoinTwoEmptyArchivesReturnAnEmptyArchive()
shouldJoinWithAnEmptyArchivesRemainTheArchiveWithTheSameNumberOfSolutions
public void shouldJoinWithAnEmptyArchivesRemainTheArchiveWithTheSameNumberOfSolutions()

org.uma.jmetal.util.archivewithreferencepoint

ArchiveWithReferencePoint

public abstract class ArchiveWithReferencePoint<S extends Solution<?>> extends AbstractBoundedArchive<S>

This class defines a bounded archive that has associated a reference point as described in the paper “Extending the Speed-constrained Multi-Objective PSO (SMPSO) With Reference Point Based Preference Articulation Accepted in PPSN 2018.

Parameters:
  • <S>
Fields
comparator
protected Comparator<S> comparator
referencePoint
protected List<Double> referencePoint
referencePointSolution
protected S referencePointSolution
Constructors
ArchiveWithReferencePoint
public ArchiveWithReferencePoint(int maxSize, List<Double> referencePoint, Comparator<S> comparator)
Methods
add
public synchronized boolean add(S solution)
changeReferencePoint
public synchronized void changeReferencePoint(List<Double> newReferencePoint)
prune
public synchronized void prune()

org.uma.jmetal.util.archivewithreferencepoint.impl

CrowdingDistanceArchiveWithReferencePoint

public class CrowdingDistanceArchiveWithReferencePoint<S extends Solution<?>> extends ArchiveWithReferencePoint<S>

Class representing a ArchiveWithReferencePoint archive using a crowding distance based density estimator

Author:Antonio J. Nebro
Constructors
CrowdingDistanceArchiveWithReferencePoint
public CrowdingDistanceArchiveWithReferencePoint(int maxSize, List<Double> refPointDM)
Methods
computeDensityEstimator
public void computeDensityEstimator()
getComparator
public Comparator<S> getComparator()
sortByDensityEstimator
public void sortByDensityEstimator()

HypervolumeArchiveWithReferencePoint

public class HypervolumeArchiveWithReferencePoint<S extends Solution<?>> extends ArchiveWithReferencePoint<S>

Class representing a ArchiveWithReferencePoint archive using a hypervolume contribution based density estimator.

Author:Antonio J. Nebro
Constructors
HypervolumeArchiveWithReferencePoint
public HypervolumeArchiveWithReferencePoint(int maxSize, List<Double> refPointDM)
Methods
computeDensityEstimator
public void computeDensityEstimator()
getComparator
public Comparator<S> getComparator()
sortByDensityEstimator
public void sortByDensityEstimator()

org.uma.jmetal.util.artificialdecisionmaker

ArtificialDecisionMaker

public abstract class ArtificialDecisionMaker<S, R> implements Algorithm<R>
Fields
algorithm
protected InteractiveAlgorithm<S, R> algorithm
indexOfRelevantObjectiveFunctions
protected List<Integer> indexOfRelevantObjectiveFunctions
paretoOptimalSolutions
protected List<S> paretoOptimalSolutions
problem
protected Problem<S> problem
Constructors
ArtificialDecisionMaker
public ArtificialDecisionMaker(Problem<S> problem, InteractiveAlgorithm<S, R> algorithm)
Methods
calculateReferencePoints
protected abstract List<Double> calculateReferencePoints(List<Integer> indexOfRelevantObjectiveFunctions, R front, List<S> paretoOptimalSolutions)
generatePreferenceInformation
protected abstract List<Double> generatePreferenceInformation()
getDescription
public String getDescription()
getDistances
public abstract List<Double> getDistances()
getName
public String getName()
getReferencePoints
public abstract List<Double> getReferencePoints()
getResult
public R getResult()
initProgress
protected abstract void initProgress()
isStoppingConditionReached
protected abstract boolean isStoppingConditionReached()
relevantObjectiveFunctions
protected abstract List<Integer> relevantObjectiveFunctions(R front)
run
public void run()
updateParetoOptimal
protected abstract void updateParetoOptimal(R front, List<S> paretoOptimalSolutions)
updateProgress
protected abstract void updateProgress()

DecisionTreeEstimator

public class DecisionTreeEstimator<S extends Solution<?>>
Constructors
DecisionTreeEstimator
public DecisionTreeEstimator(List<S> solutionList)
Methods
doPrediction
public double doPrediction(int index, S testSolution)
doPredictionVariable
public double doPredictionVariable(int index, S testSolution)

org.uma.jmetal.util.artificialdecisionmaker.impl

ArtificialDecisionMakerDecisionTree

public class ArtificialDecisionMakerDecisionTree<S extends Solution<?>> extends ArtificialDecisionMaker<S, List<S>>

Class implementing the Towards automatic testing of reference point based interactive methods described in: Ojalehto, V., Podkopaev, D., & Miettinen, K. (2016, September). Towards automatic testing of reference point based interactive methods. In International Conference on Parallel Problem Solving from Nature (pp. 483-492). Springer, Cham.

Author:Cristobal Barba
Fields
allReferencePoints
protected List<Double> allReferencePoints
asp
protected List<Double> asp
considerationProbability
protected double considerationProbability
currentReferencePoint
protected List<Double> currentReferencePoint
distances
protected List<Double> distances
evaluations
protected int evaluations
idealOjectiveVector
protected List<Double> idealOjectiveVector
maxEvaluations
protected int maxEvaluations
nadirObjectiveVector
protected List<Double> nadirObjectiveVector
numberOfObjectives
protected int numberOfObjectives
random
protected JMetalRandom random
rankingCoeficient
protected List<Double> rankingCoeficient
tolerance
protected double tolerance
varyingProbability
protected double varyingProbability
Constructors
ArtificialDecisionMakerDecisionTree
public ArtificialDecisionMakerDecisionTree(Problem<S> problem, InteractiveAlgorithm<S, List<S>> algorithm, double considerationProbability, double tolerance, int maxEvaluations, List<Double> rankingCoeficient, List<Double> asp)
Methods
calculateReferencePoints
protected List<Double> calculateReferencePoints(List<Integer> indexOfRelevantObjectiveFunctions, List<S> front, List<S> paretoOptimalSolutions)
generatePreferenceInformation
protected List<Double> generatePreferenceInformation()
getDistances
public List<Double> getDistances()
getReferencePoints
public List<Double> getReferencePoints()
initProgress
protected void initProgress()
isStoppingConditionReached
protected boolean isStoppingConditionReached()
relevantObjectiveFunctions
protected List<Integer> relevantObjectiveFunctions(List<S> front)
updateParetoOptimal
protected void updateParetoOptimal(List<S> front, List<S> paretoOptimalSolutions)
updateProgress
protected void updateProgress()

ArtificiallDecisionMakerBuilder

public class ArtificiallDecisionMakerBuilder<S extends Solution<?>> implements AlgorithmBuilder<ArtificialDecisionMakerDecisionTree<S>>
Author:Antonio J. Nebro
Constructors
ArtificiallDecisionMakerBuilder
public ArtificiallDecisionMakerBuilder(Problem<S> problem, InteractiveAlgorithm<S, List<S>> algorithm)

ArtificiallDecisionMakerBuilder constructor

Methods
build
public ArtificialDecisionMakerDecisionTree<S> build()
getMaxIterations
public int getMaxIterations()
getProblem
public Problem<S> getProblem()
setAlgorithm
public ArtificiallDecisionMakerBuilder<S> setAlgorithm(InteractiveAlgorithm<S, List<S>> algorithm)
setAsp
public ArtificiallDecisionMakerBuilder<S> setAsp(List<Double> asp)
setConsiderationProbability
public ArtificiallDecisionMakerBuilder<S> setConsiderationProbability(double considerationProbability)
setMaxEvaluations
public ArtificiallDecisionMakerBuilder<S> setMaxEvaluations(int maxEvaluations)
setNumberReferencePoints
public ArtificiallDecisionMakerBuilder<S> setNumberReferencePoints(int numberReferencePoints)
setRankingCoeficient
public ArtificiallDecisionMakerBuilder<S> setRankingCoeficient(List<Double> rankingCoeficient)
setTolerance
public ArtificiallDecisionMakerBuilder<S> setTolerance(double tolerance)

org.uma.jmetal.util.binarySet

BinarySet

public class BinarySet extends BitSet

Class representing a bit set including a method to get the total number of bits

Author:Antonio J. Nebro
Constructors
BinarySet
public BinarySet(int numberOfBits)

Constructor

Parameters:
  • numberOfBits
Methods
getBinarySetLength
public int getBinarySetLength()

Returns the total number of bits

Returns:the number of bits of the binary set

org.uma.jmetal.util.chartcontainer

ChartContainer

public class ChartContainer

Class for configuring and displaying a XChart.

Author:Jorge Rodriguez Ordonez
Constructors
ChartContainer
public ChartContainer(String name)
ChartContainer
public ChartContainer(String name, int delay)
Methods
addIndicatorChart
public void addIndicatorChart(String indicator)
getChart
public XYChart getChart(String chartName)
getDelay
public int getDelay()
getFrontChart
public XYChart getFrontChart()
getName
public String getName()
getVarChart
public XYChart getVarChart()
initChart
public void initChart()
refreshCharts
public void refreshCharts()
refreshCharts
public void refreshCharts(int delay)
removeIndicator
public void removeIndicator(String indicator)
repaint
public void repaint()
saveChart
public void saveChart(String fileName, BitmapFormat format)
setDelay
public ChartContainer setDelay(int delay)
setFrontChart
public void setFrontChart(int objective1, int objective2)
setFrontChart
public void setFrontChart(int objective1, int objective2, String referenceFrontFileName)
setName
public ChartContainer setName(String name)
setReferencePoint
public void setReferencePoint(List<Double> referencePoint)
setVarChart
public void setVarChart(int variable1, int variable2)
updateFrontCharts
public void updateFrontCharts(List<DoubleSolution> solutionList)
updateIndicatorChart
public void updateIndicatorChart(String indicator, Double value)

ChartContainerWithReferencePoints

public class ChartContainerWithReferencePoints

Class for configuring and displaying a char with a number of subpopulations and reference points. Designed to be used with the SMPSORP.

Author:Antonio J. Nebro
Constructors
ChartContainerWithReferencePoints
public ChartContainerWithReferencePoints(String name)
ChartContainerWithReferencePoints
public ChartContainerWithReferencePoints(String name, int delay)
Methods
getChart
public XYChart getChart(String chartName)
getDelay
public int getDelay()
getFrontChart
public XYChart getFrontChart()
getName
public String getName()
getVarChart
public XYChart getVarChart()
initChart
public void initChart()
refreshCharts
public void refreshCharts()
refreshCharts
public void refreshCharts(int delay)
repaint
public void repaint()
saveChart
public void saveChart(String fileName, BitmapFormat format)
setDelay
public ChartContainerWithReferencePoints setDelay(int delay)
setFrontChart
public void setFrontChart(int objective1, int objective2)
setFrontChart
public void setFrontChart(int objective1, int objective2, String referenceFrontFileName)
setName
public ChartContainerWithReferencePoints setName(String name)
setReferencePoint
public synchronized void setReferencePoint(List<List<Double>> referencePoint)
updateFrontCharts
public void updateFrontCharts(List<DoubleSolution> solutionList)
updateReferencePoint
public synchronized void updateReferencePoint(List<List<Double>> referencePoint)

org.uma.jmetal.util.comparator

ConstraintViolationComparator

public interface ConstraintViolationComparator<S> extends Comparator<S>, Serializable
Methods
compare
public int compare(S solution1, S solution2)

CrowdingDistanceComparator

public class CrowdingDistanceComparator<S extends Solution<?>> implements Comparator<S>, Serializable

Compares two solutions according to the crowding distance attribute. The higher the distance the better

Author:Antonio J. Nebro
Methods
compare
public int compare(S solution1, S solution2)

Compare two solutions.

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if solution1 is has greater, equal, or less distance value than solution2, respectively.

CrowdingDistanceComparatorTest

public class CrowdingDistanceComparatorTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldCompareReturnMinusOneIfSolutionBHasHigherDistance
public void shouldCompareReturnMinusOneIfSolutionBHasHigherDistance()
shouldCompareReturnMinusOneIfTheSecondSolutionIsNull
public void shouldCompareReturnMinusOneIfTheSecondSolutionIsNull()
shouldCompareReturnOneIfSolutionAHasLessDistance
public void shouldCompareReturnOneIfSolutionAHasLessDistance()
shouldCompareReturnOneIfTheFirstSolutionIsNull
public void shouldCompareReturnOneIfTheFirstSolutionIsNull()
shouldCompareReturnZeroIfBothSolutionsAreNull
public void shouldCompareReturnZeroIfBothSolutionsAreNull()
shouldCompareReturnZeroIfBothSolutionsHaveNoCrowdingDistanceAttribute
public void shouldCompareReturnZeroIfBothSolutionsHaveNoCrowdingDistanceAttribute()
shouldCompareReturnZeroIfBothSolutionsHaveTheSameDistance
public void shouldCompareReturnZeroIfBothSolutionsHaveTheSameDistance()

DominanceComparator

public class DominanceComparator<S extends Solution<?>> implements Comparator<S>, Serializable

This class implements a solution comparator taking into account the violation constraints

Author:Antonio J. Nebro
Constructors
DominanceComparator
public DominanceComparator()

Constructor

DominanceComparator
public DominanceComparator(double epsilon)

Constructor

DominanceComparator
public DominanceComparator(ConstraintViolationComparator<S> constraintComparator)

Constructor

DominanceComparator
public DominanceComparator(ConstraintViolationComparator<S> constraintComparator, double epsilon)

Constructor

Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions.

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if solution1 dominates solution2, both are non-dominated, or solution1 is dominated by solution2, respectively.

DominanceComparatorTest

public class DominanceComparatorTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldCompareRaiseAnExceptionIfTheFirstSolutionIsNull
public void shouldCompareRaiseAnExceptionIfTheFirstSolutionIsNull()
shouldCompareRaiseAnExceptionIfTheSecondSolutionIsNull
public void shouldCompareRaiseAnExceptionIfTheSecondSolutionIsNull()
shouldCompareRaiseAnExceptionIfTheSolutionsHaveNotTheSameNumberOfObjectives
public void shouldCompareRaiseAnExceptionIfTheSolutionsHaveNotTheSameNumberOfObjectives()
shouldCompareReturnMinusOneIfTheFirstSolutionDominatesTheSecondOneCaseA
public void shouldCompareReturnMinusOneIfTheFirstSolutionDominatesTheSecondOneCaseA()

Case A: solution1 has objectives [-1.0, 5.0, 9.0] and solution2 has [2.0, 6.0, 15.0]

shouldCompareReturnMinusOneIfTheFirstSolutionDominatesTheSecondOneCaseB
public void shouldCompareReturnMinusOneIfTheFirstSolutionDominatesTheSecondOneCaseB()

Case B: solution1 has objectives [-1.0, 5.0, 9.0] and solution2 has [-1.0, 5.0, 10.0]

shouldCompareReturnMinusOneIfTheTwoSolutionsHasOneObjectiveAndTheFirstOneIsLower
public void shouldCompareReturnMinusOneIfTheTwoSolutionsHasOneObjectiveAndTheFirstOneIsLower()
shouldCompareReturnOneIfTheSecondSolutionDominatesTheFirstOneCaseC
public void shouldCompareReturnOneIfTheSecondSolutionDominatesTheFirstOneCaseC()

Case C: solution1 has objectives [-1.0, 5.0, 9.0] and solution2 has [-2.0, 5.0, 9.0]

shouldCompareReturnOneIfTheSecondSolutionDominatesTheFirstOneCaseD
public void shouldCompareReturnOneIfTheSecondSolutionDominatesTheFirstOneCaseD()

Case D: solution1 has objectives [-1.0, 5.0, 9.0] and solution2 has [-1.0, 5.0, 8.0]

shouldCompareReturnOneIfTheTwoSolutionsHasOneObjectiveAndTheSecondOneIsLower
public void shouldCompareReturnOneIfTheTwoSolutionsHasOneObjectiveAndTheSecondOneIsLower()
shouldCompareReturnTheValueReturnedByTheConstraintViolationComparator
public void shouldCompareReturnTheValueReturnedByTheConstraintViolationComparator()
shouldCompareReturnZeroIfTheTwoSolutionsHaveOneObjectiveWithTheSameValue
public void shouldCompareReturnZeroIfTheTwoSolutionsHaveOneObjectiveWithTheSameValue()

EqualSolutionsComparator

public class EqualSolutionsComparator<S extends Solution<?>> implements Comparator<S>, Serializable

This class implements a Comparator (a method for comparing Solution objects) based whether all the objective values are equal or not. A dominance test is applied to decide about what solution is the best.

Author:Antonio J. Nebro
Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions.

Parameters:
  • solution1 – First Solution.
  • solution2 – Second Solution.
Returns:

-1, or 0, or 1, or 2 if solution1 is dominates solution2, solution1 and solution2 are equals, or solution1 is greater than solution2, respectively.

FitnessComparator

public class FitnessComparator<S extends Solution<?>> implements Comparator<S>, Serializable

This class implements a Comparator (a method for comparing Solution objects) based on the fitness value returned by the method getFitness.

Author:Antonio J. Nebro
Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions.

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

GDominanceComparator

public class GDominanceComparator<S extends Solution<?>> implements Comparator<S>, Serializable

This class implements a solution comparator according to the concept of g-dominance (https://doi.org/10.1016/j.ejor.2008.07.015)

Author:Antonio J. Nebro
Constructors
GDominanceComparator
public GDominanceComparator(List<Double> referencePoint)

Constructor

Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions.

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if solution1 dominates solution2, both are non-dominated, or solution1 is dominated by solution2, respectively.

HypervolumeContributionComparator

public class HypervolumeContributionComparator<S extends Solution<?>> implements Comparator<S>, Serializable

Compares two solutions according to the crowding distance attribute. The higher the distance the better

Author:Antonio J. Nebro
Methods
compare
public int compare(S solution1, S solution2)

Compare two solutions.

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if solution1 is has lower, equal, or higher contribution value than solution2, respectively.

ObjectiveComparator

public class ObjectiveComparator<S extends Solution<?>> implements Comparator<S>, Serializable

This class implements a comparator based on a given objective

Author:Antonio J. Nebro
Constructors
ObjectiveComparator
public ObjectiveComparator(int objectiveId)

Constructor.

Parameters:
  • objectiveId – The index of the objective to compare
ObjectiveComparator
public ObjectiveComparator(int objectiveId, Ordering order)

Comparator.

Parameters:
  • objectiveId – The index of the objective to compare
  • order – Ascending or descending order
Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions according to a given objective.

Parameters:
  • solution1 – The first solution
  • solution2 – The second solution
Returns:

-1, or 0, or 1 if solution1 is less than, equal, or greater than solution2, respectively, according to the established order

ObjectiveComparator.Ordering

public enum Ordering
Enum Constants
ASCENDING
public static final ObjectiveComparator.Ordering ASCENDING
DESCENDING
public static final ObjectiveComparator.Ordering DESCENDING

ObjectiveComparatorTest

public class ObjectiveComparatorTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldCompareRaiseAnExceptionIfSolution1HasLessObjectivesThanTheOneRequested
public void shouldCompareRaiseAnExceptionIfSolution1HasLessObjectivesThanTheOneRequested()
shouldCompareRaiseAnExceptionIfSolution2HasLessObjectivesThanTheOneRequested
public void shouldCompareRaiseAnExceptionIfSolution2HasLessObjectivesThanTheOneRequested()
shouldCompareReturnMinusOneIfTheObjectiveOfSolution1IsGreaterInDescendingOrder
public void shouldCompareReturnMinusOneIfTheObjectiveOfSolution1IsGreaterInDescendingOrder()
shouldCompareReturnMinusOneIfTheObjectiveOfSolution1IsLower
public void shouldCompareReturnMinusOneIfTheObjectiveOfSolution1IsLower()
shouldCompareReturnMinusOneIfTheSecondSolutionIsNull
public void shouldCompareReturnMinusOneIfTheSecondSolutionIsNull()
shouldCompareReturnOneIfTheFirstSolutionIsNull
public void shouldCompareReturnOneIfTheFirstSolutionIsNull()
shouldCompareReturnOneIfTheObjectiveOfSolution2IsGreaterInDescendingOrder
public void shouldCompareReturnOneIfTheObjectiveOfSolution2IsGreaterInDescendingOrder()
shouldCompareReturnOneIfTheObjectiveOfSolution2IsLower
public void shouldCompareReturnOneIfTheObjectiveOfSolution2IsLower()
shouldCompareReturnZeroIfBothSolutionsAreNull
public void shouldCompareReturnZeroIfBothSolutionsAreNull()
shouldCompareReturnZeroIfTheObjectiveOfTheSolutionsIsTheSame
public void shouldCompareReturnZeroIfTheObjectiveOfTheSolutionsIsTheSame()

RankingAndCrowdingDistanceComparator

public class RankingAndCrowdingDistanceComparator<S extends Solution<?>> implements Comparator<S>, Serializable
Author:Antonio J. Nebro
Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions.

Parameters:
  • solution1 – Object representing the first solution
  • solution2 – Object representing the second solution.
Returns:

-1, or 0, or 1 if solution1 is less than, equal, or greater than solution2, respectively.

RankingAndCrowdingDistanceComparatorTest

public class RankingAndCrowdingDistanceComparatorTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldCompareTwoNullSolutionsReturnZero
public void shouldCompareTwoNullSolutionsReturnZero()
shouldCompareWhenRankingYieldingAZeroReturnTheCrowdingDistanceValue
public void shouldCompareWhenRankingYieldingAZeroReturnTheCrowdingDistanceValue()
shouldCompareWithANullSolutionAsFirstArgumentReturnOne
public void shouldCompareWithANullSolutionAsFirstArgumentReturnOne()
shouldCompareWithANullSolutionAsSecondArgumentReturnMinusOne
public void shouldCompareWithANullSolutionAsSecondArgumentReturnMinusOne()
shouldCompareWithNullRankingAttributeSolutionAsFirstArgumentReturnOne
public void shouldCompareWithNullRankingAttributeSolutionAsFirstArgumentReturnOne()
shouldCompareWithRankingYieldingANonZeroValueReturnThatValue
public void shouldCompareWithRankingYieldingANonZeroValueReturnThatValue()
teardown
public void teardown()

RankingComparator

public class RankingComparator<S extends Solution<?>> implements Comparator<S>, Serializable
Author:Antonio J. Nebro This class implements a comparator based on the rank of the solutions.
Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions according to the ranking attribute. The lower the ranking the better

Parameters:
  • solution1 – Object representing the first solution.
  • solution2 – Object representing the second solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

RankingComparatorTest

public class RankingComparatorTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldCompareReturnMinusOneIfSolutionAHasLessRanking
public void shouldCompareReturnMinusOneIfSolutionAHasLessRanking()
shouldCompareReturnMinusOneIfTheSecondSolutionIsNull
public void shouldCompareReturnMinusOneIfTheSecondSolutionIsNull()
shouldCompareReturnOneIfSolutionBHasLessRanking
public void shouldCompareReturnOneIfSolutionBHasLessRanking()
shouldCompareReturnOneIfTheFirstSolutionIsNull
public void shouldCompareReturnOneIfTheFirstSolutionIsNull()
shouldCompareReturnZeroIfBothSolutionsAreNull
public void shouldCompareReturnZeroIfBothSolutionsAreNull()
shouldCompareReturnZeroIfBothSolutionsHaveNoRankingAttribute
public void shouldCompareReturnZeroIfBothSolutionsHaveNoRankingAttribute()
shouldCompareReturnZeroIfBothSolutionsHaveTheSameRanking
public void shouldCompareReturnZeroIfBothSolutionsHaveTheSameRanking()

StrengthFitnessComparator

public class StrengthFitnessComparator<S extends Solution<?>> implements Comparator<S>, Serializable
Author:

Juan J. Durillo

Parameters:
  • <S>
Methods
compare
public int compare(S solution1, S solution2)

org.uma.jmetal.util.comparator.impl

OverallConstraintViolationComparator

public class OverallConstraintViolationComparator<S extends Solution<?>> implements ConstraintViolationComparator<S>

This class implements a Comparator (a method for comparing Solution objects) based on the overall constraint violation of the solutions, as done in NSGA-II.

Author:Antonio J. Nebro
Constructors
OverallConstraintViolationComparator
public OverallConstraintViolationComparator()

Constructor

Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions. If the solutions has no constraints the method return 0

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

ViolationThresholdComparator

public class ViolationThresholdComparator<S extends Solution<?>> implements ConstraintViolationComparator<S>

This class implements the ViolationThreshold Comparator *

Author:Juan J. Durillo
Constructors
ViolationThresholdComparator
public ViolationThresholdComparator()

Constructor

Methods
compare
public int compare(S solution1, S solution2)

Compares two solutions. If the solutions has no constraints the method return 0

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

feasibilityRatio
public double feasibilityRatio(List<S> solutionSet)

Computes the feasibility ratio Return the ratio of feasible solutions

meanOverallViolation
public double meanOverallViolation(List<S> solutionSet)

Computes the feasibility ratio Return the ratio of feasible solutions

needToCompare
public boolean needToCompare(S solution1, S solution2)

Returns true if solutions s1 and/or s2 have an overall constraint violation with value less than 0

updateThreshold
public void updateThreshold(List<S> set)

Updates the threshold value using the population

org.uma.jmetal.util.distance

Distance

public interface Distance<E, J>

Interface representing distances between two entities

Author:
Methods
getDistance
double getDistance(E element1, J element2)

org.uma.jmetal.util.distance.impl

CosineDistanceBetweenSolutionsInObjectiveSpace

public class CosineDistanceBetweenSolutionsInObjectiveSpace<S extends Solution<?>> implements Distance<S, S>

Class for calculating the cosine distance between two Solution objects in objective space.

Author:
Constructors
CosineDistanceBetweenSolutionsInObjectiveSpace
public CosineDistanceBetweenSolutionsInObjectiveSpace(S referencePoint)
Methods
getDistance
public double getDistance(S solution1, S solution2)

CosineDistanceBetweenSolutionsInObjectiveSpaceTest

public class CosineDistanceBetweenSolutionsInObjectiveSpaceTest

Created by ajnebro on 12/2/16.

Methods
shouldIdenticalPointsHaveADistanceOfOne
public void shouldIdenticalPointsHaveADistanceOfOne()
shouldPointsInTheSameDirectionHaveADistanceOfOne
public void shouldPointsInTheSameDirectionHaveADistanceOfOne()
shouldTwoPerpendicularPointsHaveADistanceOfZero
public void shouldTwoPerpendicularPointsHaveADistanceOfZero()

EuclideanDistanceBetweenSolutionAndASolutionListInObjectiveSpace

public class EuclideanDistanceBetweenSolutionAndASolutionListInObjectiveSpace<S extends Solution<Double>, L extends List<S>> implements Distance<S, L>

Class for calculating the Euclidean distance between a Solution object a list of Solution objects in objective space.

Author:
Constructors
EuclideanDistanceBetweenSolutionAndASolutionListInObjectiveSpace
public EuclideanDistanceBetweenSolutionAndASolutionListInObjectiveSpace()
Methods
getDistance
public double getDistance(S solution, L solutionList)

EuclideanDistanceBetweenSolutionsInObjectiveSpace

public class EuclideanDistanceBetweenSolutionsInObjectiveSpace<S extends Solution<?>> implements Distance<S, S>

Class for calculating the Euclidean distance between two Solution objects in objective space.

Author:
Methods
getDistance
public double getDistance(S solution1, S solution2)

EuclideanDistanceBetweenSolutionsInSolutionSpace

public class EuclideanDistanceBetweenSolutionsInSolutionSpace<S extends Solution<Double>> implements Distance<S, S>

Class for calculating the Euclidean distance between two DoubleSolution objects in solution space.

Author:
Methods
getDistance
public double getDistance(S solution1, S solution2)

org.uma.jmetal.util.evaluator

SolutionListEvaluator

public interface SolutionListEvaluator<S> extends Serializable

Created by Antonio J. Nebro on 30/05/14.

Methods
evaluate
List<S> evaluate(List<S> solutionList, Problem<S> problem)
shutdown
void shutdown()

org.uma.jmetal.util.evaluator.impl

MultithreadedSolutionListEvaluator

public class MultithreadedSolutionListEvaluator<S> implements SolutionListEvaluator<S>
Author:Antonio J. Nebro
Constructors
MultithreadedSolutionListEvaluator
public MultithreadedSolutionListEvaluator(int numberOfThreads, Problem<S> problem)
Methods
evaluate
public List<S> evaluate(List<S> solutionList, Problem<S> problem)
getNumberOfThreads
public int getNumberOfThreads()
shutdown
public void shutdown()

SequentialSolutionListEvaluator

public class SequentialSolutionListEvaluator<S> implements SolutionListEvaluator<S>
Author:Antonio J. Nebro
Methods
evaluate
public List<S> evaluate(List<S> solutionList, Problem<S> problem)
shutdown
public void shutdown()

org.uma.jmetal.util.experiment

Experiment

public class Experiment<S extends Solution<?>, Result>

Class for describing the configuration of a jMetal experiment. Created by Antonio J. Nebro on 17/07/14.

Constructors
Experiment
public Experiment(ExperimentBuilder<S, Result> builder)

Constructor

Methods
getAlgorithmList
public List<ExperimentAlgorithm<S, Result>> getAlgorithmList()
getExperimentBaseDirectory
public String getExperimentBaseDirectory()
getExperimentName
public String getExperimentName()
getIndependentRuns
public int getIndependentRuns()
getIndicatorList
public List<GenericIndicator<S>> getIndicatorList()
getNumberOfCores
public int getNumberOfCores()
getOutputParetoFrontFileName
public String getOutputParetoFrontFileName()
getOutputParetoSetFileName
public String getOutputParetoSetFileName()
getProblemList
public List<ExperimentProblem<S>> getProblemList()
getReferenceFrontDirectory
public String getReferenceFrontDirectory()
removeDuplicatedAlgorithms
public void removeDuplicatedAlgorithms()

The list of algorithms contain an algorithm instance per problem. This is not convenient for calculating statistical data, because a same algorithm will appear many times. This method remove duplicated algorithms and leave only an instance of each one.

setAlgorithmList
public void setAlgorithmList(List<ExperimentAlgorithm<S, Result>> algorithmList)
setReferenceFrontDirectory
public void setReferenceFrontDirectory(String referenceFrontDirectory)

ExperimentBuilder

public class ExperimentBuilder<S extends Solution<?>, Result>

Builder for class Experiment

Author:Antonio J. Nebro
Constructors
ExperimentBuilder
public ExperimentBuilder(String experimentName)
Methods
build
public Experiment<S, Result> build()
getAlgorithmList
public List<ExperimentAlgorithm<S, Result>> getAlgorithmList()
getExperimentBaseDirectory
public String getExperimentBaseDirectory()
getExperimentName
public String getExperimentName()
getIndependentRuns
public int getIndependentRuns()
getIndicatorList
public List<GenericIndicator<S>> getIndicatorList()
getNumberOfCores
public int getNumberOfCores()
getOutputParetoFrontFileName
public String getOutputParetoFrontFileName()
getOutputParetoSetFileName
public String getOutputParetoSetFileName()
getProblemList
public List<ExperimentProblem<S>> getProblemList()
getReferenceFrontDirectory
public String getReferenceFrontDirectory()
setAlgorithmList
public ExperimentBuilder<S, Result> setAlgorithmList(List<ExperimentAlgorithm<S, Result>> algorithmList)
setExperimentBaseDirectory
public ExperimentBuilder<S, Result> setExperimentBaseDirectory(String experimentBaseDirectory)
setIndependentRuns
public ExperimentBuilder<S, Result> setIndependentRuns(int independentRuns)
setIndicatorList
public ExperimentBuilder<S, Result> setIndicatorList(List<GenericIndicator<S>> indicatorList)
setNumberOfCores
public ExperimentBuilder<S, Result> setNumberOfCores(int numberOfCores)
setOutputParetoFrontFileName
public ExperimentBuilder<S, Result> setOutputParetoFrontFileName(String outputParetoFrontFileName)
setOutputParetoSetFileName
public ExperimentBuilder<S, Result> setOutputParetoSetFileName(String outputParetoSetFileName)
setProblemList
public ExperimentBuilder<S, Result> setProblemList(List<ExperimentProblem<S>> problemList)
setReferenceFrontDirectory
public ExperimentBuilder<S, Result> setReferenceFrontDirectory(String referenceFrontDirectory)

ExperimentComponent

public interface ExperimentComponent

An experiment is composed of instances of this interface.

Author:Antonio J. Nebro
Methods
run
void run()

org.uma.jmetal.util.experiment.component

ComputeQualityIndicators

public class ComputeQualityIndicators<S extends Solution<?>, Result> implements ExperimentComponent

This class computes the QualityIndicators of an experiment. Once the algorithms of an experiment have been executed through running an instance of class ExecuteAlgorithms, the list of indicators in obtained from the #getIndicatorsList() method. Then, for every combination algorithm + problem, the indicators are applied to all the FUN files and the resulting values are store in a file called as #getName(), which is located in the same directory of the FUN files.

Author:Antonio J. Nebro
Constructors
ComputeQualityIndicators
public ComputeQualityIndicators(Experiment<S, Result> experiment)
Methods
findBestIndicatorFronts
public void findBestIndicatorFronts(Experiment<?, Result> experiment)
run
public void run()

ExecuteAlgorithms

public class ExecuteAlgorithms<S extends Solution<?>, Result> implements ExperimentComponent

This class executes the algorithms the have been configured with a instance of class Experiment. Java 8 parallel streams are used to run the algorithms in parallel.

The result of the execution is a pair of files FUNrunId.tsv and VARrunID.tsv per experiment, which are stored in the directory #getExperimentBaseDirectory()/algorithmName/problemName.

Author:Antonio J. Nebro
Constructors
ExecuteAlgorithms
public ExecuteAlgorithms(Experiment<S, Result> configuration)

Constructor

Methods
run
public void run()

GenerateBoxplotsWithR

public class GenerateBoxplotsWithR<Result> implements ExperimentComponent

This class generates a R script that generates an eps file containing boxplots The results are a set of R files that are written in the directory #getExperimentBaseDirectory()/R. Each file is called as indicatorName.Wilcoxon.R To run the R script: Rscript indicatorName.Wilcoxon.R To generate the resulting Latex file: pdflatex indicatorName.Wilcoxon.tex

Author:Antonio J. Nebro
Constructors
GenerateBoxplotsWithR
public GenerateBoxplotsWithR(Experiment<?, Result> experimentConfiguration)
Methods
run
public void run()
setColumns
public GenerateBoxplotsWithR<Result> setColumns(int columns)
setDisplayNotch
public GenerateBoxplotsWithR<Result> setDisplayNotch()
setRows
public GenerateBoxplotsWithR<Result> setRows(int rows)

GenerateFriedmanTestTables

public class GenerateFriedmanTestTables<Result> implements ExperimentComponent

This class computes the Friedman test ranking and generates a Latex script that produces a table per quality indicator containing the ranking The results are a set of Latex files that are written in the directory #getExperimentBaseDirectory()/latex. Each file is called as FriedmanTest[indicatorName].tex The implementation is based on the one included in Keel: J. Alcalá-Fdez, L. Sánchez, S. García, M.J. del Jesus, S. Ventura, J.M. Garrell, J. Otero, C. Romero, J. Bacardit, V.M. Rivas, J.C. Fernández, F. Herrera. KEEL: A Software Tool to Assess Evolutionary Algorithms to Data Mining Problems. Soft Computing 13:3 (2009) 307-318 Doi: 10.1007/s00500-008-0323-y

Author:Antonio J. Nebro
Constructors
GenerateFriedmanTestTables
public GenerateFriedmanTestTables(Experiment<?, Result> experimentConfiguration)
Methods
prepareFileOutputContents
public String prepareFileOutputContents(double[] averageRanking)
run
public void run()

GenerateLatexTablesWithStatistics

public class GenerateLatexTablesWithStatistics implements ExperimentComponent

This class computes a number of statistical values (mean, median, standard deviation, interquartile range) from the indicator files generated after executing ExecuteAlgorithms and ComputeQualityIndicators. After reading the data files and calculating the values, a Latex file is created containing an script that generates tables with the best and second best values per indicator. The name of the file is #getExperimentName().tex, which is located by default in the directory #getExperimentBaseDirectory()/latex Although the maximum, minimum, and total number of items are also computed, no tables are generated with them (this is a pending work).

Author:Antonio J. Nebro
Constructors
GenerateLatexTablesWithStatistics
public GenerateLatexTablesWithStatistics(Experiment<?, ?> configuration)
Methods
printEndLatexCommands
void printEndLatexCommands(String fileName)
printHeaderLatexCommands
void printHeaderLatexCommands(String fileName)
run
public void run()

GenerateReferenceParetoFront

public class GenerateReferenceParetoFront implements ExperimentComponent

This class computes a reference Pareto front from a set of files. Once the algorithms of an experiment have been executed through running an instance of class ExecuteAlgorithms, all the obtained fronts of all the algorithms are gathered per problem; then, the dominated solutions are removed and the final result is a file per problem containing the reference Pareto front. By default, the files are stored in a directory called “referenceFront”, which is located in the experiment base directory. Each front is named following the scheme “problemName.rf”.

Author:Antonio J. Nebro
Constructors
GenerateReferenceParetoFront
public GenerateReferenceParetoFront(Experiment<?, ?> experimentConfiguration)
Methods
run
public void run()

The run() method creates de output directory and compute the fronts

GenerateReferenceParetoSetAndFrontFromDoubleSolutions

public class GenerateReferenceParetoSetAndFrontFromDoubleSolutions implements ExperimentComponent

This class computes the reference Pareto set and front from a set of data files containing the variable (VARx.tsv file) and objective (FUNx.tsv) values. A requirement is that the variable values MUST correspond to DoubleSolution solutions, i.e., the solved problems must be instances of DoubleProblem. Once the algorithms of an experiment have been executed through running an instance of class ExecuteAlgorithms, all the obtained fronts of all the algorithms are gathered per problem; then, the dominated solutions are removed thus yielding to the reference Pareto front. By default, the files are stored in a directory called “referenceFront”, which is located in the experiment base directory. The following files are generated per problem: - “problemName.pf”: the reference Pareto front. - “problemName.ps”: the reference Pareto set (i.e., the variable values of the solutions of the reference Pareto front. - “problemName.algorithmName.pf”: the objectives values of the contributed solutions by the algorithm called “algorithmName” to “problemName.pf” - “problemName.algorithmName.ps”: the variable values of the contributed solutions by the algorithm called “algorithmName” to “problemName.ps”

Author:Antonio J. Nebro
Constructors
GenerateReferenceParetoSetAndFrontFromDoubleSolutions
public GenerateReferenceParetoSetAndFrontFromDoubleSolutions(Experiment<?, ?> experimentConfiguration)
Methods
run
public void run()

The run() method creates de output directory and compute the fronts

GenerateWilcoxonTestTablesWithR

public class GenerateWilcoxonTestTablesWithR<Result> implements ExperimentComponent

This class generates a R script that computes the Wilcoxon Signed Rank Test and generates a Latex script that produces a table per quality indicator containing the pairwise comparison between all the algorithms on all the solved problems. The results are a set of R files that are written in the directory #getExperimentBaseDirectory()/R. Each file is called as indicatorName.Wilcoxon.R To run the R script: Rscript indicatorName.Wilcoxon.R To generate the resulting Latex file: pdflatex indicatorName.Wilcoxon.tex

Author:Antonio J. Nebro
Constructors
GenerateWilcoxonTestTablesWithR
public GenerateWilcoxonTestTablesWithR(Experiment<?, Result> experimentConfiguration)
Methods
run
public void run()

org.uma.jmetal.util.experiment.util

ExperimentAlgorithm

public class ExperimentAlgorithm<S extends Solution<?>, Result>

Class defining tasks for the execution of algorithms in parallel.

Author:Antonio J. Nebro
Constructors
ExperimentAlgorithm
public ExperimentAlgorithm(Algorithm<Result> algorithm, String algorithmTag, ExperimentProblem<S> problem, int runId)

Constructor

ExperimentAlgorithm
public ExperimentAlgorithm(Algorithm<Result> algorithm, ExperimentProblem<S> problem, int runId)
Methods
getAlgorithm
public Algorithm<Result> getAlgorithm()
getAlgorithmTag
public String getAlgorithmTag()
getProblemTag
public String getProblemTag()
getReferenceParetoFront
public String getReferenceParetoFront()
getRunId
public int getRunId()
runAlgorithm
public void runAlgorithm(Experiment<?, ?> experimentData)

ExperimentProblem

public class ExperimentProblem<S extends Solution<?>>

Class used to add a tag field to a problem.

Author:Antonio J. Nebro
Constructors
ExperimentProblem
public ExperimentProblem(Problem<S> problem, String tag)
ExperimentProblem
public ExperimentProblem(Problem<S> problem)
Methods
changeReferenceFrontTo
public ExperimentProblem<S> changeReferenceFrontTo(String referenceFront)
getProblem
public Problem<S> getProblem()
getReferenceFront
public String getReferenceFront()
getTag
public String getTag()

org.uma.jmetal.util.extremevalues

ExtremeValuesFinder

public interface ExtremeValuesFinder<Source, Result>

Interface representing classes aimed at finding the extreme values of Source objects (e.g., lists)

Author:

Antonio J. Nebro

Parameters:
  • <Source>
  • <Result>
Methods
findHighestValues
Result findHighestValues(Source source)
findLowestValues
Result findLowestValues(Source source)

org.uma.jmetal.util.extremevalues.impl

FrontExtremeValues

public class FrontExtremeValues implements ExtremeValuesFinder<Front, List<Double>>

Class for finding the extreme values of front objects

Author:Antonio J. Nebro
Methods
findHighestValues
public List<Double> findHighestValues(Front front)
findLowestValues
public List<Double> findLowestValues(Front front)

SolutionListExtremeValues

public class SolutionListExtremeValues implements ExtremeValuesFinder<List<Solution<?>>, List<Double>>

Class for finding the extreme values of a list of objects

Author:Antonio J. Nebro
Methods
findHighestValues
public List<Double> findHighestValues(List<Solution<?>> solutionList)
findLowestValues
public List<Double> findLowestValues(List<Solution<?>> solutionList)

org.uma.jmetal.util.fileinput.util

ReadDoubleDataFile

public class ReadDoubleDataFile

Utiliy class that reads a file containing a double value per line and returns an array with all of them.

Author:Antonio J. Nebro
Methods
readFile
public double[] readFile(String fileName)

org.uma.jmetal.util.fileoutput

FileOutputContext

public interface FileOutputContext extends Serializable

This interface represents output contexts, which are classes providing a mean for getting a buffer reader object.

Author:Antonio J. Nebro
Methods
getFileName
public String getFileName()
getFileWriter
public BufferedWriter getFileWriter()
getSeparator
public String getSeparator()
setSeparator
public void setSeparator(String separator)

SolutionListOutput

public class SolutionListOutput
Author:Antonio J. Nebro
Constructors
SolutionListOutput
public SolutionListOutput(List<? extends Solution<?>> solutionList)
Methods
print
public void print()
printObjectivesToFile
public void printObjectivesToFile(FileOutputContext context, List<? extends Solution<?>> solutionList)
printObjectivesToFile
public void printObjectivesToFile(FileOutputContext context, List<? extends Solution<?>> solutionList, List<Boolean> minimizeObjective)
printObjectivesToFile
public void printObjectivesToFile(String fileName)
printObjectivesToFile
public void printObjectivesToFile(String fileName, List<Boolean> minimizeObjective)
printVariablesToFile
public void printVariablesToFile(FileOutputContext context, List<? extends Solution<?>> solutionList)
printVariablesToFile
public void printVariablesToFile(String fileName)
setFunFileOutputContext
public SolutionListOutput setFunFileOutputContext(FileOutputContext fileContext)
setObjectiveMinimizingObjectiveList
public SolutionListOutput setObjectiveMinimizingObjectiveList(List<Boolean> isObjectiveToBeMinimized)
setSeparator
public SolutionListOutput setSeparator(String separator)
setVarFileOutputContext
public SolutionListOutput setVarFileOutputContext(FileOutputContext fileContext)

org.uma.jmetal.util.fileoutput.impl

DefaultFileOutputContext

public class DefaultFileOutputContext implements FileOutputContext

Class using the default method for getting a buffered writer

Author:Antonio J. Nebro
Fields
fileName
protected String fileName
separator
protected String separator
Constructors
DefaultFileOutputContext
public DefaultFileOutputContext(String fileName)
Methods
getFileName
public String getFileName()
getFileWriter
public BufferedWriter getFileWriter()
getSeparator
public String getSeparator()
setSeparator
public void setSeparator(String separator)

org.uma.jmetal.util.front

Front

public interface Front extends Serializable

A front is a list of points

Author:Antonio J. Nebro
Methods
getNumberOfPoints
public int getNumberOfPoints()
getPoint
public Point getPoint(int index)
getPointDimensions
public int getPointDimensions()
setPoint
public void setPoint(int index, Point point)
sort
public void sort(Comparator<Point> comparator)

org.uma.jmetal.util.front.imp

ArrayFront

public class ArrayFront implements Front

This class implements the Front interface by using an array of Point objects

Author:Antonio J. Nebro
Fields
numberOfPoints
protected int numberOfPoints
points
protected Point[] points
Constructors
ArrayFront
public ArrayFront()

Constructor

ArrayFront
public ArrayFront(List<? extends Solution<?>> solutionList)

Constructor

ArrayFront
public ArrayFront(Front front)

Copy Constructor

ArrayFront
public ArrayFront(int numberOfPoints, int dimensions)

Constructor

ArrayFront
public ArrayFront(String fileName)

Constructor

Parameters:
  • fileName – File containing the data. Each line of the file is a list of objective values
Throws:
  • FileNotFoundException
Methods
createInputStream
public InputStream createInputStream(String fileName)
equals
public boolean equals(Object o)
getNumberOfPoints
public int getNumberOfPoints()
getPoint
public Point getPoint(int index)
getPointDimensions
public int getPointDimensions()
hashCode
public int hashCode()
setPoint
public void setPoint(int index, Point point)
sort
public void sort(Comparator<Point> comparator)
toString
public String toString()

ArrayFrontTest

public class ArrayFrontTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldConstructorCreateAnArranFrontFromAFileContainingA2DFront
public void shouldConstructorCreateAnArranFrontFromAFileContainingA2DFront()
shouldConstructorCreateAnArranFrontFromAFileContainingA3DFront
public void shouldConstructorCreateAnArranFrontFromAFileContainingA3DFront()
shouldCreateAnArrayFrontFromAListOfSolutionsHavingOneDoubleSolutionObject
public void shouldCreateAnArrayFrontFromAListOfSolutionsHavingOneDoubleSolutionObject()
shouldCreateAnArrayFrontFromAListOfSolutionsHavingOneSingleSolutionObject
public void shouldCreateAnArrayFrontFromAListOfSolutionsHavingOneSingleSolutionObject()
shouldCreateAnArrayFrontFromAListOfSolutionsHavingTwoDoubleSolutionObject
public void shouldCreateAnArrayFrontFromAListOfSolutionsHavingTwoDoubleSolutionObject()
shouldCreateAnArrayFrontFromANullFrontRaiseAnException
public void shouldCreateAnArrayFrontFromANullFrontRaiseAnException()
shouldCreateAnArrayFrontFromANullListRaiseAnAnException
public void shouldCreateAnArrayFrontFromANullListRaiseAnAnException()
shouldCreateAnArrayFrontFromASolutionListResultInTwoEqualsFronts
public void shouldCreateAnArrayFrontFromASolutionListResultInTwoEqualsFronts()
shouldCreateAnArrayFrontFromAnEmptyFrontRaiseAnException
public void shouldCreateAnArrayFrontFromAnEmptyFrontRaiseAnException()
shouldCreateAnArrayFrontFromAnEmptyListRaiseAnException
public void shouldCreateAnArrayFrontFromAnEmptyListRaiseAnException()
shouldCreateAnArrayFrontFromAnotherFrontResultInTwoEqualsFrontssss
public void shouldCreateAnArrayFrontFromAnotherFrontResultInTwoEqualsFrontssss()
shouldCreateInputStreamThrownAnExceptionIfFileDoesNotExist
public void shouldCreateInputStreamThrownAnExceptionIfFileDoesNotExist()
shouldDefaultConstructorCreateAnEmptyArrayFront
public void shouldDefaultConstructorCreateAnEmptyArrayFront()
shouldEqualsReturnFalseIfPointDimensionsOfTheFrontsIsDifferent
public void shouldEqualsReturnFalseIfPointDimensionsOfTheFrontsIsDifferent()
shouldEqualsReturnFalseIfTheArgumentIsFromAWrongClass
public void shouldEqualsReturnFalseIfTheArgumentIsFromAWrongClass()
shouldEqualsReturnFalseIfTheArgumentIsNull
public void shouldEqualsReturnFalseIfTheArgumentIsNull()
shouldEqualsReturnFalseIfTheComparedFrontHasADifferentNumberOfPoints
public void shouldEqualsReturnFalseIfTheComparedFrontHasADifferentNumberOfPoints()
shouldEqualsReturnFalseIfTheFrontsAreDifferent
public void shouldEqualsReturnFalseIfTheFrontsAreDifferent()
shouldEqualsReturnTrueIfTheArgumentIsEqual
public void shouldEqualsReturnTrueIfTheArgumentIsEqual()
shouldEqualsReturnTrueIfTheArgumentIsTheSameObject
public void shouldEqualsReturnTrueIfTheArgumentIsTheSameObject()
shouldGetPointRaiseAnExceptionWhenTheIndexIsGreaterThanTheFrontSize
public void shouldGetPointRaiseAnExceptionWhenTheIndexIsGreaterThanTheFrontSize()
shouldGetPointRaiseAnExceptionWhenTheIndexIsNegative
public void shouldGetPointRaiseAnExceptionWhenTheIndexIsNegative()
shouldGetPointReturnTheCorrectObject
public void shouldGetPointReturnTheCorrectObject()
shouldReadFrontAFileWithOnePointCreateTheCorrectFront
public void shouldReadFrontAFileWithOnePointCreateTheCorrectFront()

Test using a file containing: 1.0 2.0 -3.0

shouldReadFrontAnEmptyFileCreateAnEmptyFront
public void shouldReadFrontAnEmptyFileCreateAnEmptyFront()
shouldReadFrontFourPointsCreateTheCorrectFront
public void shouldReadFrontFourPointsCreateTheCorrectFront()

Test using a file containing: 1 2 3 4 5 6 7 8 9 10 11 12 -1 -2 -3 -4

shouldReadFrontWithALineContainingWrongDataRaiseAnException
public void shouldReadFrontWithALineContainingWrongDataRaiseAnException()

Test using a file containing: 3.0 2.3 asdfg

shouldReadFrontWithALineWithALineMissingDataRaiseAnException
public void shouldReadFrontWithALineWithALineMissingDataRaiseAnException()

Test using a file containing: -30 234.234 90.25 15 -5.23

shouldSetPointAssignTheCorrectObject
public void shouldSetPointAssignTheCorrectObject()
shouldSetPointRaiseAnExceptionWhenTheIndexIsGreaterThanTheFrontSize
public void shouldSetPointRaiseAnExceptionWhenTheIndexIsGreaterThanTheFrontSize()
shouldSetPointRaiseAnExceptionWhenTheIndexIsNegative
public void shouldSetPointRaiseAnExceptionWhenTheIndexIsNegative()
shouldSetPointRaiseAnExceptionWhenThePointIsNull
public void shouldSetPointRaiseAnExceptionWhenThePointIsNull()
shouldSortReturnAnOrderedFront
public void shouldSortReturnAnOrderedFront()

FrontUtilsTest

public class FrontUtilsTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldConvertFrontToArrayRaiseAnExceptionIfTheFrontIsNull
public void shouldConvertFrontToArrayRaiseAnExceptionIfTheFrontIsNull()
shouldConvertFrontToArrayReturnAnEmptyArrayIfTheFrontIsEmpty
public void shouldConvertFrontToArrayReturnAnEmptyArrayIfTheFrontIsEmpty()
shouldConvertFrontToArrayReturnTheCorrectArrayCaseA
public void shouldConvertFrontToArrayReturnTheCorrectArrayCaseA()

Case A: The front has one point

shouldConvertFrontToArrayReturnTheCorrectArrayCaseB
public void shouldConvertFrontToArrayReturnTheCorrectArrayCaseB()

Case A: The front has one three points

shouldConvertFrontToSolutionListRaiseAnExceptionIfTheFrontIsNull
public void shouldConvertFrontToSolutionListRaiseAnExceptionIfTheFrontIsNull()
shouldConvertFrontToSolutionListReturnAnEmptyListIfTheFrontIsEmpty
public void shouldConvertFrontToSolutionListReturnAnEmptyListIfTheFrontIsEmpty()
shouldConvertFrontToSolutionListReturnTheCorrectListCaseA
public void shouldConvertFrontToSolutionListReturnTheCorrectListCaseA()

Case A: The front has one point

shouldConvertFrontToSolutionListReturnTheCorrectListCaseB
public void shouldConvertFrontToSolutionListReturnTheCorrectListCaseB()

Case A: The front has one three points

shouldDistanceToClosestPointRaiseAnExceptionIfTheFrontIsEmpty
public void shouldDistanceToClosestPointRaiseAnExceptionIfTheFrontIsEmpty()
shouldDistanceToClosestPointRaiseAnExceptionIfTheFrontIsNull
public void shouldDistanceToClosestPointRaiseAnExceptionIfTheFrontIsNull()
shouldDistanceToClosestPointRaiseAnExceptionIfThePointIsNull
public void shouldDistanceToClosestPointRaiseAnExceptionIfThePointIsNull()
shouldDistanceToClosestPointReturnMaxZeroIfThePointIsTheOnlyPointInTheFront
public void shouldDistanceToClosestPointReturnMaxZeroIfThePointIsTheOnlyPointInTheFront()
shouldDistanceToClosestPointReturnTheCorrectValueIfTheFrontHasHasOnePoint
public void shouldDistanceToClosestPointReturnTheCorrectValueIfTheFrontHasHasOnePoint()
shouldDistanceToNearestPointClosestTheCorrectValueIfTheFrontHasTwoPointsCaseA
public void shouldDistanceToNearestPointClosestTheCorrectValueIfTheFrontHasTwoPointsCaseA()

Case A: the front has two points and one of them is the point passed as a parameter

shouldDistanceToNearestPointClosestTheCorrectValueIfTheFrontHasTwoPointsCaseB
public void shouldDistanceToNearestPointClosestTheCorrectValueIfTheFrontHasTwoPointsCaseB()

Case B: the front has two points and none of them is the point passed as a parameter. The dimensions of the points are ordered

shouldDistanceToNearestPointClosestTheCorrectValueIfTheFrontHasTwoPointsCaseC
public void shouldDistanceToNearestPointClosestTheCorrectValueIfTheFrontHasTwoPointsCaseC()

Case B: the front has two points and none of them is the point passed as a parameter. The dimensions of the points are not ordered

shouldDistanceToNearestPointRaiseAnExceptionIfTheFrontIsEmpty
public void shouldDistanceToNearestPointRaiseAnExceptionIfTheFrontIsEmpty()
shouldDistanceToNearestPointRaiseAnExceptionIfTheFrontIsNull
public void shouldDistanceToNearestPointRaiseAnExceptionIfTheFrontIsNull()
shouldDistanceToNearestPointRaiseAnExceptionIfThePointIsNull
public void shouldDistanceToNearestPointRaiseAnExceptionIfThePointIsNull()
shouldDistanceToNearestPointReturnMaxDoubleIfThePointIsTheOnlyPointInTheFront
public void shouldDistanceToNearestPointReturnMaxDoubleIfThePointIsTheOnlyPointInTheFront()
shouldDistanceToNearestPointReturnTheCorrectValueIfTheFrontHasHasOnePoint
public void shouldDistanceToNearestPointReturnTheCorrectValueIfTheFrontHasHasOnePoint()
shouldDistanceToNearestPointReturnTheCorrectValueIfTheFrontHasTwoPointsCaseA
public void shouldDistanceToNearestPointReturnTheCorrectValueIfTheFrontHasTwoPointsCaseA()

Case A: the front has two points and one of them is the point passed as a parameter

shouldGetInvertedFrontRaiseAnExceptionIfTheFrontIsEmpty
public void shouldGetInvertedFrontRaiseAnExceptionIfTheFrontIsEmpty()
shouldGetInvertedFrontRaiseAnExceptionIfTheFrontIsNull
public void shouldGetInvertedFrontRaiseAnExceptionIfTheFrontIsNull()
shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfFourPoints
public void shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfFourPoints()

The front has the points [0.1, 0.9], [0.2, 0.8], [0.3, 0.7], [0.4, 0.6]. The inverted front is [0.9, 0.1], [0.8, 0.2], [0.7, 0.3], [0.6, 0.4]

shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfOnePointCaseA
public void shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfOnePointCaseA()

Case A: the front has the point [0.5, 0.5]. The inverted front is the same

shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfOnePointCaseB
public void shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfOnePointCaseB()

Case B: the front has the point [0.0, 1.0]. The inverted front is [1.0, 0.0]

shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfOnePointCaseC
public void shouldGetInvertedFrontReturnTheCorrectFrontIfItComposedOfOnePointCaseC()

Case C: the front has the point [3.0, -2.0]. The inverted front is [0.0, 1.0]

shouldGetMaximumValuesRaiseAnExceptionIfTheFrontIsEmpty
public void shouldGetMaximumValuesRaiseAnExceptionIfTheFrontIsEmpty()
shouldGetMaximumValuesRaiseAnExceptionIfTheFrontIsNull
public void shouldGetMaximumValuesRaiseAnExceptionIfTheFrontIsNull()
shouldGetMaximumValuesWithAFrontWithOnePointReturnTheCorrectValue
public void shouldGetMaximumValuesWithAFrontWithOnePointReturnTheCorrectValue()
shouldGetMaximumValuesWithAFrontWithThreePointReturnTheCorrectValue
public void shouldGetMaximumValuesWithAFrontWithThreePointReturnTheCorrectValue()
shouldGetMinimumValuesRaiseAnExceptionIfTheFrontIsEmpty
public void shouldGetMinimumValuesRaiseAnExceptionIfTheFrontIsEmpty()
shouldGetMinimumValuesRaiseAnExceptionIfTheFrontIsNull
public void shouldGetMinimumValuesRaiseAnExceptionIfTheFrontIsNull()
shouldGetMinimumValuesWithAFrontWithOnePointReturnTheCorrectValue
public void shouldGetMinimumValuesWithAFrontWithOnePointReturnTheCorrectValue()
shouldGetMinimumValuesWithAFrontWithThreePointReturnTheCorrectValue
public void shouldGetMinimumValuesWithAFrontWithThreePointReturnTheCorrectValue()

org.uma.jmetal.util.front.util

FrontNormalizer

public class FrontNormalizer

Class for normalizing Front objects

Author:Antonio J. Nebro
Constructors
FrontNormalizer
public FrontNormalizer(List<? extends Solution<?>> referenceFront)

Constructor.

Parameters:
  • referenceFront
FrontNormalizer
public FrontNormalizer(Front referenceFront)

Constructor.

Parameters:
  • referenceFront
FrontNormalizer
public FrontNormalizer(double[] minimumValues, double[] maximumValues)

Constructor

Parameters:
  • minimumValues
  • maximumValues
Methods
normalize
public List<? extends Solution<?>> normalize(List<? extends Solution<?>> solutionList)

Returns a normalized front

Parameters:
  • solutionList
normalize
public Front normalize(Front front)

Returns a normalized front

Parameters:
  • front

FrontNormalizerTest

public class FrontNormalizerTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldFrontNormalizerConstructorRaiseAnExceptionIsTheReferenceFrontIsNull
public void shouldFrontNormalizerConstructorRaiseAnExceptionIsTheReferenceFrontIsNull()
shouldFrontNormalizerConstructorRaiseAnExceptionIsTheReferenceSolutionListIsNull
public void shouldFrontNormalizerConstructorRaiseAnExceptionIsTheReferenceSolutionListIsNull()
shouldFrontNormalizerConstructorRaiseAnExceptionIsTheVectorOfMaximumValuesIsNull
public void shouldFrontNormalizerConstructorRaiseAnExceptionIsTheVectorOfMaximumValuesIsNull()
shouldFrontNormalizerConstructorRaiseAnExceptionIsTheVectorOfMinimumValuesIsNull
public void shouldFrontNormalizerConstructorRaiseAnExceptionIsTheVectorOfMinimumValuesIsNull()
shouldFrontNormalizerContructorRaiseAnExceptionTheDimensionOfTheMaximumAndMinimumArrayIsNotEqual
public void shouldFrontNormalizerContructorRaiseAnExceptionTheDimensionOfTheMaximumAndMinimumArrayIsNotEqual()
shouldGetNormalizedFrontReturnTheCorrectFrontIfTheSolutionListContainsTwoPoints
public void shouldGetNormalizedFrontReturnTheCorrectFrontIfTheSolutionListContainsTwoPoints()

Points: [2,4], [-2, 3] Maximum values: [6, 8] Minimum values: [-10, 1] Result: [0.5, 1.0], []

shouldGetNormalizedFrontReturnTheCorrectFrontIfThisContainsTwoPoints
public void shouldGetNormalizedFrontReturnTheCorrectFrontIfThisContainsTwoPoints()

Points: [2,4], [-2, 3] Maximum values: [6, 8] Minimum values: [-10, 1] Result: [0.5, 1.0], []

shouldNormalizeRaiseAnExceptionIfTheFrontIsEmpty
public void shouldNormalizeRaiseAnExceptionIfTheFrontIsEmpty()
shouldNormalizeRaiseAnExceptionIfTheMaxAndMinValuesAreTheSame
public void shouldNormalizeRaiseAnExceptionIfTheMaxAndMinValuesAreTheSame()

Point: [2,4] Maximum values: [2, 4] Minimum values: [2, 4] Result: [0.5, 1.0]

shouldNormalizeRaiseAnExceptionIfTheSolutionListIsEmpty
public void shouldNormalizeRaiseAnExceptionIfTheSolutionListIsEmpty()
shouldNormalizeRaiseAnExceptionTheDimensionOfTheMaximumArrayPointsIsNotCorrect
public void shouldNormalizeRaiseAnExceptionTheDimensionOfTheMaximumArrayPointsIsNotCorrect()
shouldNormalizeRaiseAnExceptionTheFrontIsNull
public void shouldNormalizeRaiseAnExceptionTheFrontIsNull()
shouldNormalizeRaiseAnExceptionTheSolutionListIsNull
public void shouldNormalizeRaiseAnExceptionTheSolutionListIsNull()
shouldNormalizeReturnTheCorrectFrontIfThisContainsOnePoint
public void shouldNormalizeReturnTheCorrectFrontIfThisContainsOnePoint()

Point: [2,4] Maximum values: [4, 4] Minimum values: [0, 0] Result: [0.5, 1.0]

FrontUtils

public class FrontUtils

A Front is a list of points. This class includes utilities to work with Front objects.

Author:Antonio J. Nebro
Methods
convertFrontToArray
public static double[][] convertFrontToArray(Front front)

Given a front, converts it to an array of double values

Parameters:
  • front
Returns:

A front as double[][] array

convertFrontToSolutionList
public static List<PointSolution> convertFrontToSolutionList(Front front)

Given a front, converts it to a Solution set of PointSolutions

Parameters:
  • front
Returns:

A front as a List

distanceToClosestPoint
public static double distanceToClosestPoint(Point point, Front front)

Gets the distance between a point and the nearest one in a given front. The Euclidean distance is assumed

Parameters:
  • point – The point
  • front – The front that contains the other points to calculate the distances
Returns:

The minimum distance between the point and the front

distanceToClosestPoint
public static double distanceToClosestPoint(Point point, Front front, PointDistance distance)

Gets the distance between a point and the nearest one in a given front

Parameters:
  • point – The point
  • front – The front that contains the other points to calculate the distances
Returns:

The minimum distance between the point and the front

distanceToNearestPoint
public static double distanceToNearestPoint(Point point, Front front)

Gets the distance between a point and the nearest one in a front. If a distance equals to 0 is found, that means that the point is in the front, so it is excluded

Parameters:
  • point – The point
  • front – The front that contains the other points to calculate the distances
Returns:

The minimum distance between the point and the front

distanceToNearestPoint
public static double distanceToNearestPoint(Point point, Front front, PointDistance distance)

Gets the distance between a point and the nearest one in a front. If a distance equals to 0 is found, that means that the point is in the front, so it is excluded

Parameters:
  • point – The point
  • front – The front that contains the other points to calculate the distances
Returns:

The minimum distance between the point and the front

getInvertedFront
public static Front getInvertedFront(Front front)

This method receives a normalized pareto front and return the inverted one. This method is for minimization problems

Parameters:
  • front – The pareto front to inverse
Returns:

The inverted pareto front

getMaximumValues
public static double[] getMaximumValues(Front front)

Gets the maximum values for each objectives in a front

Parameters:
  • front – A front of objective values
Returns:

double [] An array with the maximum values for each objective

getMinimumValues
public static double[] getMinimumValues(Front front)

Gets the minimum values for each objectives in a given front

Parameters:
  • front – The front
Returns:

double [] An array with the minimum value for each objective

org.uma.jmetal.util.naming

DescribedEntity

public interface DescribedEntity

A DescribedEntity is identified through its name (getName()) and further detailed through its description (getDescription()).

Author:Matthieu Vergne
Methods
getDescription
public String getDescription()
Returns:the description of the DescribedEntity
getName
public String getName()
Returns:the name of the DescribedEntity

org.uma.jmetal.util.naming.impl

DescribedEntitySet

public class DescribedEntitySet<Entity extends DescribedEntity> implements Set<Entity>
Methods
add
public boolean add(Entity e)
addAll
public boolean addAll(Collection<? extends Entity> c)
clear
public void clear()
contains
public boolean contains(Object o)
contains
public boolean contains(String name)
containsAll
public boolean containsAll(Collection<?> c)
get
public <E extends Entity> E get(String name)
isEmpty
public boolean isEmpty()
iterator
public Iterator<Entity> iterator()
remove
public boolean remove(Object o)
remove
public boolean remove(String name)
removeAll
public boolean removeAll(Collection<?> c)
retainAll
public boolean retainAll(Collection<?> c)
size
public int size()
toArray
public Object[] toArray()
toArray
public <T> T[] toArray(T[] a)
toString
public String toString()

DescribedEntitySetTest

public class DescribedEntitySetTest
Methods
testAddingDifferentEntityWithDifferentNameProperlyAdds
public void testAddingDifferentEntityWithDifferentNameProperlyAdds()
testAddingDifferentEntityWithSameNameThrowsException
public void testAddingDifferentEntityWithSameNameThrowsException()
testAddingSameEntityModifiesNothing
public void testAddingSameEntityModifiesNothing()
testGetReturnsCorrectEntity
public void testGetReturnsCorrectEntity()
testToStringInCaseInsensitiveOrder
public void testToStringInCaseInsensitiveOrder()

SimpleDescribedEntity

public class SimpleDescribedEntity implements DescribedEntity

SimpleDescribedEntity is a basic implementation of DescribedEntity. It provides a basic support for the most generic properties required by this interface.

Author:Matthieu Vergne
Constructors
SimpleDescribedEntity
public SimpleDescribedEntity(String name, String description)

Create a SimpleDescribedEntity with a given name and a given description.

Parameters:
SimpleDescribedEntity
public SimpleDescribedEntity(String name)

Create a SimpleDescribedEntity with a given name and a null description.

Parameters:
SimpleDescribedEntity
public SimpleDescribedEntity()

Create a SimpleDescribedEntity with the class name as its name and a null description.

Methods
getDescription
public String getDescription()
getName
public String getName()
setDescription
public void setDescription(String description)
Parameters:
setName
public void setName(String name)
Parameters:
toString
public String toString()

SimpleDescribedEntityTest

public class SimpleDescribedEntityTest
Methods
testClassNameWhenNoName
public void testClassNameWhenNoName()
testCorrectDescriptionWhenProvided
public void testCorrectDescriptionWhenProvided()
testCorrectNameWhenProvided
public void testCorrectNameWhenProvided()
testNullDescriptionWhenNoDescription
public void testNullDescriptionWhenNoDescription()
testSetGetDescription
public void testSetGetDescription()
testSetGetName
public void testSetGetName()

SimpleDescribedEntityTest.TestedClass

class TestedClass extends SimpleDescribedEntity

org.uma.jmetal.util.neighborhood

Neighborhood

public interface Neighborhood<S> extends Serializable

Interface representing a neighborhood of a given solution in a list of solutions

Author:Antonio J. Nebro
Methods
getNeighbors
public List<S> getNeighbors(List<S> solutionList, int solutionIndex)

org.uma.jmetal.util.neighborhood.impl

AdaptiveRandomNeighborhood

public class AdaptiveRandomNeighborhood<S> implements Neighborhood<S>

This class implements the adaptive random neighborhood (topology) defined by M. Clerc. Each solution in a solution list must have a neighborhood composed by it itself and K random selected neighbors (the same solution can be chosen several times).

Author:Antonio J. Nebro
Constructors
AdaptiveRandomNeighborhood
public AdaptiveRandomNeighborhood(int solutionListSize, int numberOfRandomNeighbours)

Constructor

Parameters:
  • solutionListSize – The expected size of the list of solutions
  • numberOfRandomNeighbours – The number of neighbors per solution
AdaptiveRandomNeighborhood
public AdaptiveRandomNeighborhood(int solutionListSize, int numberOfRandomNeighbours, BoundedRandomGenerator<Integer> randomGenerator)

Constructor

Parameters:
  • solutionListSize – The expected size of the list of solutions
  • numberOfRandomNeighbours – The number of neighbors per solution
  • randomGenerator – the BoundedRandomGenerator to use for the randomisation
Methods
getNeighbors
public List<S> getNeighbors(List<S> solutionList, int solutionIndex)
recompute
public void recompute()

Recomputes the neighbors

AdaptiveRandomNeighborhoodTest

public class AdaptiveRandomNeighborhoodTest
Author:Antonio J. Nebro
Fields
exception
public ExpectedException exception
Methods
shouldConstructorCreateAnInstanceIfTheParamtersAreValid
public void shouldConstructorCreateAnInstanceIfTheParamtersAreValid()
shouldConstructorThrowAnExceptionWhenTheNumberOfNeighboursIsEqualThanTheListSize
public void shouldConstructorThrowAnExceptionWhenTheNumberOfNeighboursIsEqualThanTheListSize()
shouldConstructorThrowAnExceptionWhenTheNumberOfNeighboursIsGreaterThanTheListSize
public void shouldConstructorThrowAnExceptionWhenTheNumberOfNeighboursIsGreaterThanTheListSize()
shouldConstructorThrowAnExceptionWhenTheNumberOfNeighboursIsNegative
public void shouldConstructorThrowAnExceptionWhenTheNumberOfNeighboursIsNegative()
shouldGetNeighborsReturnThreeNeighborsPlusTheCurrentSolution
public void shouldGetNeighborsReturnThreeNeighborsPlusTheCurrentSolution()

Case 1 Solution list size: 3 Number of neighbors: 1 Neighbors: - solution 0: 0, 2 - solution 1: 1, 0 - solution 2: 2, 0

shouldGetNeighborsReturnTwoNeighborsPlusTheCurrentSolution
public void shouldGetNeighborsReturnTwoNeighborsPlusTheCurrentSolution()

Case 1 Solution list size: 4 Number of neighbors: 2

shouldGetNeighborsThrowAnExceptionIfTheListSizeIsNotCorrect
public void shouldGetNeighborsThrowAnExceptionIfTheListSizeIsNotCorrect()
shouldGetNeighborsWithANegativeSolutionIndexThrowAnException
public void shouldGetNeighborsWithANegativeSolutionIndexThrowAnException()
shouldGetNeighborsWithANullListOfSolutionsThrowAnException
public void shouldGetNeighborsWithANullListOfSolutionsThrowAnException()
shouldGetNeighborsWithATooBigSolutionIndexThrowAnException
public void shouldGetNeighborsWithATooBigSolutionIndexThrowAnException()
shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided
public void shouldJMetalRandomGeneratorNotBeUsedWhenCustomRandomGeneratorProvided()

C25

public class C25<S extends Solution<?>> extends TwoDimensionalMesh<S>

Class defining an C25 neighborhood of a solution belonging to a list of solutions which is structured as a bi-dimensional mesh. The neighbors are those solutions that are in 2-hop distance or less Shape: * * * * * * * * * * * * o * * * * * * * * * * * *

Author:Esteban López Camacho
Constructors
C25
public C25(int rows, int columns)

Constructor. Defines a neighborhood for solutionSetSize

C49

public class C49<S extends Solution<?>> extends TwoDimensionalMesh<S>

Class defining an C49 neighborhood of a solution belonging to a list of solutions which is structured as a bi-dimensional mesh. The neighbors are those solutions that are in 3-hop distance or less Shape: * * * * * * * * * * * * * * * * * * * * * * * * o * * * * * * * * * * * * * * * * * * * * * * * *

Author:Esteban López Camacho
Constructors
C49
public C49(int rows, int columns)

Constructor. Defines a neighborhood for solutionSetSize

C9

public class C9<S> extends TwoDimensionalMesh<S>

Class defining an L9 neighborhood of a solution belonging to a list of solutions which is structured as a bi-dimensional mesh. The neighbors are those solutions that are in 1-hop distance Shape: * * * * o * * * *

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
C9
public C9(int rows, int columns)

Constructor Defines a neighborhood for a solution set of rows x columns solutions

Parameters:
  • rows – the number of rows
  • columns – the number of columns

C9Test

public class C9Test

Created by ajnebro on 26/5/15.

Methods
shouldGetNeighborsReturnFourNeighborsCase1
public void shouldGetNeighborsReturnFourNeighborsCase1()

Case 1 Solution list: 0 The solution location is 0, the neighborhood is 0

shouldGetNeighborsReturnFourNeighborsCase10
public void shouldGetNeighborsReturnFourNeighborsCase10()

Case 10 Solution list: 0 1 2 3 4 5 6 7 8 9 10 11 The solution location is 5, the neighborhood is 0, 1, 2, 4, 6, 8, 9

shouldGetNeighborsReturnFourNeighborsCase11
public void shouldGetNeighborsReturnFourNeighborsCase11()

Case 11 Solution list: 0 1 2 3 4 5 6 7 8 9 10 11 The solution location is 11, the neighborhood is 6, 7, 10, 3, 2, 8

shouldGetNeighborsReturnFourNeighborsCase2
public void shouldGetNeighborsReturnFourNeighborsCase2()

Case 2 Solution list: 0 1 The solution location is 0, the neighborhood is 0, 1

shouldGetNeighborsReturnFourNeighborsCase3
public void shouldGetNeighborsReturnFourNeighborsCase3()

Case 3 Solution list: 0 1 The solution location is 1, the neighborhood is 0, 1

shouldGetNeighborsReturnFourNeighborsCase4
public void shouldGetNeighborsReturnFourNeighborsCase4()

Case 4 Solution list: 0 1 2 3 The solution location is 0, the neighborhood is 1, 2, 3

shouldGetNeighborsReturnFourNeighborsCase5
public void shouldGetNeighborsReturnFourNeighborsCase5()

Case 5 Solution list: 0 1 2 3 The solution location is 1, the neighborhood is 0, 2, 3

shouldGetNeighborsReturnFourNeighborsCase6
public void shouldGetNeighborsReturnFourNeighborsCase6()

Case 6 Solution list: 0 1 2 3 The solution location is 2, the neighborhood is 0, 1, 3

shouldGetNeighborsReturnFourNeighborsCase7
public void shouldGetNeighborsReturnFourNeighborsCase7()

Case 7 Solution list: 0 1 2 3 The solution location is 3, the neighborhood is 0, 1, 2

shouldGetNeighborsReturnFourNeighborsCase8
public void shouldGetNeighborsReturnFourNeighborsCase8()

Case 8 Solution list: 0 1 2 3 4 5 6 7 The solution location is 0, the neighborhood is 1, 4, 5, 3, 7

shouldGetNeighborsReturnFourNeighborsCase9
public void shouldGetNeighborsReturnFourNeighborsCase9()

Case 9 Solution list: 0 1 2 3 4 5 6 7 The solution location is 5, the neighborhood is 0, 1, 2, 4, 6

KNearestNeighborhood

public class KNearestNeighborhood<S extends Solution<?>> implements Neighborhood<S>

This class implements a neighborhood that select the k-nearest solutions according to a distance measure. By default, the Euclidean distance between objectives is used.

Parameters:
  • <S>
Constructors
KNearestNeighborhood
public KNearestNeighborhood(int neighborSize)
KNearestNeighborhood
public KNearestNeighborhood(int neighborSize, Distance<S, S> distance)
Methods
getNeighbors
public List<S> getNeighbors(List<S> solutionList, int solutionIndex)

KNearestNeighborhoodTest

public class KNearestNeighborhoodTest
Methods
shouldGetNeighborsWorkProperlyCaseA
public void shouldGetNeighborsWorkProperlyCaseA()

Case A: The solution list has two solutions and the neighbor size is 1

shouldGetNeighborsWorkProperlyCaseB
public void shouldGetNeighborsWorkProperlyCaseB()

Case B: The solution list has three solutions, the index of the solution is 0, and the neighbor size is 2

shouldGetNeighborsWorkProperlyCaseC
public void shouldGetNeighborsWorkProperlyCaseC()

Case C: The solution list has three solutions, the index of the solution is 1, and the neighbor size is 2

shouldGetNeighborsWorkProperlyCaseD
public void shouldGetNeighborsWorkProperlyCaseD()

Case D: The solution list has three solutions, the index of the solution is 2, and the neighbor size is 2

shouldGetNeighborsWorkProperlyCaseE
public void shouldGetNeighborsWorkProperlyCaseE()

Case E: The solution list has five solutions, the index of the solution is 0, and the neighbor size is 3

shouldGetNeighborsWorkProperlyCaseF
public void shouldGetNeighborsWorkProperlyCaseF()

Case F: The solution list has five solutions, the index of the solution is 2, and the neighbor size is 3

L13

public class L13<S extends Solution<?>> extends TwoDimensionalMesh<S>

Class defining an L9 neighborhood of a solution belonging to a list of solutions which is structured as a bi-dimensional mesh. The neighbors is illustrated as follows: * * * * * * o * * * * * *

Author:Esteban López Camacho
Constructors
L13
public L13(int rows, int columns)

Constructor. Defines a neighborhood for a solution set of rows x columns solutions

L13Test

public class L13Test

Created by ajnebro on 20/12/17.

Methods
shouldGetNeighborsReturnFourNeighborsCase1
public void shouldGetNeighborsReturnFourNeighborsCase1()

Case 1 Solution list: 0 The solution location is 0, the neighborhood is 0

shouldGetNeighborsReturnFourNeighborsCase10
public void shouldGetNeighborsReturnFourNeighborsCase10()

Case 10 Solution list: 0 1 2 3 4 5 6 7 The solution location is 0, the neighborhood is 1, 2, 6

shouldGetNeighborsReturnFourNeighborsCase11
public void shouldGetNeighborsReturnFourNeighborsCase11()

Case 11 Solution list: 0 1 2 3 4 5 6 7 8 The solution location is 4, the neighborhood is 1, 3, 5, 7

shouldGetNeighborsReturnFourNeighborsCase12
public void shouldGetNeighborsReturnFourNeighborsCase12()

Case 12 Solution list: 0 1 2 3 4 5 6 7 8 The solution location is 8, the neighborhood is 2, 6, 5, 7

shouldGetNeighborsReturnFourNeighborsCase2
public void shouldGetNeighborsReturnFourNeighborsCase2()

Case 2 Solution list: 0 1 The solution location is 0, the neighborhood is 0, 1

shouldGetNeighborsReturnFourNeighborsCase3
public void shouldGetNeighborsReturnFourNeighborsCase3()

Case 3 Solution list: 0 1 The solution location is 1, the neighborhood is 0, 1

shouldGetNeighborsReturnFourNeighborsCase4
public void shouldGetNeighborsReturnFourNeighborsCase4()

Case 4 Solution list: 0 1 2 3 The solution location is 0, the neighborhood is 1, 2

shouldGetNeighborsReturnFourNeighborsCase5
public void shouldGetNeighborsReturnFourNeighborsCase5()

Case 5 Solution list: 0 1 2 3 The solution location is 1, the neighborhood is 0, 3

shouldGetNeighborsReturnFourNeighborsCase6
public void shouldGetNeighborsReturnFourNeighborsCase6()

Case 6 Solution list: 0 1 2 3 The solution location is 2, the neighborhood is 0, 3

shouldGetNeighborsReturnFourNeighborsCase7
public void shouldGetNeighborsReturnFourNeighborsCase7()

Case 7 Solution list: 0 1 2 3 The solution location is 3, the neighborhood is 1, 2

shouldGetNeighborsReturnFourNeighborsCase8
public void shouldGetNeighborsReturnFourNeighborsCase8()

Case 8 Solution list: 0 1 2 3 4 5 6 7 The solution location is 5, the neighborhood is 1, 1, 4, 6

shouldGetNeighborsReturnFourNeighborsCase9
public void shouldGetNeighborsReturnFourNeighborsCase9()

Case 9 Solution list: 0 1 2 3 4 5 6 7 The solution location is 5, the neighborhood is 3, 4, 7

L25

public class L25<S extends Solution<?>> extends TwoDimensionalMesh<S>

Class representing neighborhoods for a solution into a list of solutions

Author:Esteban López Camacho
Constructors
L25
public L25(int rows, int columns)

Constructor. Defines a neighborhood for solutionSetSize

L41

public class L41<S extends Solution<?>> extends TwoDimensionalMesh<S>

Class representing neighborhoods for a solution into a list of solutions

Author:Esteban López Camacho
Constructors
L41
public L41(int rows, int columns)

Constructor. Defines a neighborhood for solutionSetSize

L5

public class L5<S> extends TwoDimensionalMesh<S>

Class defining an L5 neighborhood of a solution belonging to a list of solutions which is structured as a bi-dimensional mesh. The neighbors are those solutions that are in the positions North, South, East and West Shape: * * o * *

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
L5
public L5(int rows, int columns)

Constructor. Defines a neighborhood for a solution set of rows x columns solutions

L5Test

public class L5Test

Created by ajnebro on 26/5/15.

Methods
shouldGetNeighborsReturnFourNeighborsCase1
public void shouldGetNeighborsReturnFourNeighborsCase1()

Case 1 Solution list: 0 The solution location is 0, the neighborhood is 0

shouldGetNeighborsReturnFourNeighborsCase2
public void shouldGetNeighborsReturnFourNeighborsCase2()

Case 2 Solution list: 0 1 The solution location is 0, the neighborhood is 0, 1

shouldGetNeighborsReturnFourNeighborsCase3
public void shouldGetNeighborsReturnFourNeighborsCase3()

Case 3 Solution list: 0 1 The solution location is 1, the neighborhood is 0, 1

shouldGetNeighborsReturnFourNeighborsCase4
public void shouldGetNeighborsReturnFourNeighborsCase4()

Case 4 Solution list: 0 1 2 3 The solution location is 0, the neighborhood is 1, 2

WeightVectorNeighborhood

public class WeightVectorNeighborhood<S> implements Neighborhood<S>

This class implements a neighborhood based on the weight vectors of MOEA/D

Author:Antonio J. Nebro
Constructors
WeightVectorNeighborhood
public WeightVectorNeighborhood(int numberOfWeightVectors, int neighborSize)
WeightVectorNeighborhood
public WeightVectorNeighborhood(int numberOfWeightVectors, int weightVectorSize, int neighborSize, String vectorFileName)
Methods
getNeighborSize
public int getNeighborSize()
getNeighborhood
public int[][] getNeighborhood()
getNeighbors
public List<S> getNeighbors(List<S> solutionList, int solutionIndex)
getNumberOfWeightVectors
public int getNumberOfWeightVectors()
getWeightVector
public double[][] getWeightVector()
getWeightVectorSize
public int getWeightVectorSize()

WeightVectorNeighborhoodTest

public class WeightVectorNeighborhoodTest
Methods
shouldConstructorRaiseAnExceptionIfTheWeightFileDoesNotExist
public void shouldConstructorRaiseAnExceptionIfTheWeightFileDoesNotExist()
shouldDefaultConstructorBeCorrectlyInitialized
public void shouldDefaultConstructorBeCorrectlyInitialized()
shouldGetNeighborsWorksProperlyWithTwoObjectives
public void shouldGetNeighborsWorksProperlyWithTwoObjectives()

org.uma.jmetal.util.neighborhood.util

TwoDimensionalMesh

public class TwoDimensionalMesh<S> implements Neighborhood<S>

Class defining a bi-dimensional mesh.

Constructors
TwoDimensionalMesh
public TwoDimensionalMesh(int rows, int columns, int[][] neighborhood)

Constructor. Defines a neighborhood for list of solutions

Methods
getNeighbors
public List<S> getNeighbors(List<S> solutionList, int solutionPosition)

Returns the north,south, east, and west solutions of a given solution

Parameters:
  • solutionList – the solution set from where the neighbors are taken
  • solutionPosition – Represents the position of the solution

TwoDimensionalMeshTest

public class TwoDimensionalMeshTest

Created by ajnebro on 21/5/15.

Fields
exception
public ExpectedException exception
Methods
shouldGetNeighborsReturnFourNeighborsCase1
public void shouldGetNeighborsReturnFourNeighborsCase1()

Case 1 Solution list: 0 1 2 3 4 5 6 7 8 The solution location is 4, the neighborhood is 1, 3, 5, 7

shouldGetNeighborsReturnFourNeighborsCase2
public void shouldGetNeighborsReturnFourNeighborsCase2()

Case 2 Solution list: 0 1 2 3 4 5 6 7 8 The solution location is 1, the neighborhood is 7, 0, 2, 4

shouldGetNeighborsReturnFourNeighborsCase3
public void shouldGetNeighborsReturnFourNeighborsCase3()

Case 3 Solution list: 0 1 2 3 4 5 6 7 8 The solution location is 0, the neighborhood is 1, 2, 3, 6

shouldGetNeighborsReturnFourNeighborsCase4
public void shouldGetNeighborsReturnFourNeighborsCase4()

Case 4 Solution list: 0 1 2 3 4 5 6 7 8 The solution location is 2, the neighborhood is 1, 0, 5, 8

shouldGetNeighborsReturnFourNeighborsCase5
public void shouldGetNeighborsReturnFourNeighborsCase5()

Case 5 Solution list: 0 1 2 3 4 5 6 7 8 The solution location is 2, the neighborhood is 2, 6, 7, 5

shouldGetNeighborsReturnFourNeighborsCase6
public void shouldGetNeighborsReturnFourNeighborsCase6()

Case 6 Solution list: 0 1 2 3 4 5 The solution location is 0, the neighborhood is 1, 3, 3, 2

shouldGetNeighborsReturnFourNeighborsCase7
public void shouldGetNeighborsReturnFourNeighborsCase7()

Case 7 Solution list: 0 1 2 3 4 5 The solution location is 3, the neighborhood is 0, 4, 5, 0

shouldGetNeighborsReturnFourNeighborsCase8
public void shouldGetNeighborsReturnFourNeighborsCase8()

Case 8 Solution list: 0 1 2 3 The solution location is 0, the neighborhood is 2, 1, 2, 1

shouldGetNeighborsWithANegativeSolutionIndexThrowAnException
public void shouldGetNeighborsWithANegativeSolutionIndexThrowAnException()
shouldGetNeighborsWithANullListOfSolutionsThrowAnException
public void shouldGetNeighborsWithANullListOfSolutionsThrowAnException()
shouldGetNeighborsWithASolutionIndexValueEqualToTheListSizeThrowAnException
public void shouldGetNeighborsWithASolutionIndexValueEqualToTheListSizeThrowAnException()
shouldGetNeighborsWithASolutionIndexValueGreaterThanTheListSizeThrowAnException
public void shouldGetNeighborsWithASolutionIndexValueGreaterThanTheListSizeThrowAnException()
shouldGetNeighborsWithAnEmptyListOfSolutionsThrowAnException
public void shouldGetNeighborsWithAnEmptyListOfSolutionsThrowAnException()

org.uma.jmetal.util.point

Point

public interface Point

Interface representing a point

Author:Antonio J. Nebro
Methods
getDimension
int getDimension()
getValue
double getValue(int index)
getValues
double[] getValues()
setValue
void setValue(int index, double value)
update
void update(double[] point)

PointSolution

public class PointSolution implements Solution<Double>

Solution used to wrap a Point object. Only objectives are used.

Author:Antonio J. Nebro
Fields
attributes
protected Map<Object, Object> attributes
Constructors
PointSolution
public PointSolution(int numberOfObjectives)

Constructor

Parameters:
  • numberOfObjectives
PointSolution
public PointSolution(Point point)

Constructor

Parameters:
  • point
PointSolution
public PointSolution(Solution<?> solution)

Constructor

Parameters:
  • solution
PointSolution
public PointSolution(PointSolution point)

Copy constructor

Parameters:
  • point
Methods
copy
public PointSolution copy()
equals
public boolean equals(Object o)
getAttribute
public Object getAttribute(Object id)
getNumberOfObjectives
public int getNumberOfObjectives()
getNumberOfVariables
public int getNumberOfVariables()
getObjective
public double getObjective(int index)
getObjectives
public double[] getObjectives()
getVariableValue
public Double getVariableValue(int index)
getVariableValueString
public String getVariableValueString(int index)
hashCode
public int hashCode()
setAttribute
public void setAttribute(Object id, Object value)
setObjective
public void setObjective(int index, double value)
setVariableValue
public void setVariableValue(int index, Double value)
toString
public String toString()

org.uma.jmetal.util.point.impl

ArrayPoint

public class ArrayPoint implements Point

Class representing a point (i.e, an array of double values)

Author:Antonio J. Nebro
Fields
point
protected double[] point
Constructors
ArrayPoint
public ArrayPoint()

Default constructor

ArrayPoint
public ArrayPoint(int dimension)

Constructor

Parameters:
  • dimension – Dimension of the point
ArrayPoint
public ArrayPoint(Point point)

Copy constructor

Parameters:
  • point
ArrayPoint
public ArrayPoint(double[] point)

Constructor from an array of double values

Parameters:
  • point
ArrayPoint
public ArrayPoint(String fileName)

Constructor reading the values from a file

Parameters:
  • fileName
Methods
equals
public boolean equals(Object o)
getDimension
public int getDimension()
getValue
public double getValue(int index)
getValues
public double[] getValues()
hashCode
public int hashCode()
setValue
public void setValue(int index, double value)
toString
public String toString()
update
public void update(double[] point)

ArrayPointTest

public class ArrayPointTest
Author:Antonio J. Nebro
Methods
shouldConstructAPointFromANullPointRaiseAnException
public void shouldConstructAPointFromANullPointRaiseAnException()
shouldConstructAPointFromOtherPointReturnAnIdenticalPoint
public void shouldConstructAPointFromOtherPointReturnAnIdenticalPoint()
shouldConstructAPointOfAGivenDimension
public void shouldConstructAPointOfAGivenDimension()
shouldConstructFromASolutionReturnTheCorrectPoint
public void shouldConstructFromASolutionReturnTheCorrectPoint()
shouldConstructFromArrayReturnTheCorrectPoint
public void shouldConstructFromArrayReturnTheCorrectPoint()
shouldConstructFromNullArrayRaiseAnException
public void shouldConstructFromNullArrayRaiseAnException()
shouldEqualsReturnFalseIfTheClassIsNotAPoint
public void shouldEqualsReturnFalseIfTheClassIsNotAPoint()
shouldEqualsReturnFalseIfThePointIsNull
public void shouldEqualsReturnFalseIfThePointIsNull()
shouldEqualsReturnFalseIfThePointsAreNotIdentical
public void shouldEqualsReturnFalseIfThePointsAreNotIdentical()
shouldEqualsReturnTrueIfThePointsAreIdentical
public void shouldEqualsReturnTrueIfThePointsAreIdentical()
shouldEqualsReturnTrueIfTheTwoPointsAreTheSame
public void shouldEqualsReturnTrueIfTheTwoPointsAreTheSame()
shouldGetDimensionValueReturnTheCorrectValue
public void shouldGetDimensionValueReturnTheCorrectValue()
shouldGetDimensionValueWithInvalidIndexesRaiseAnException
public void shouldGetDimensionValueWithInvalidIndexesRaiseAnException()
shouldGetNumberOfDimensionsReturnTheCorrectValue
public void shouldGetNumberOfDimensionsReturnTheCorrectValue()
shouldGetValuesReturnTheCorrectValues
public void shouldGetValuesReturnTheCorrectValues()
shouldHashCodeReturnTheCorrectValue
public void shouldHashCodeReturnTheCorrectValue()
shouldSetDimensionValueAssignTheCorrectValue
public void shouldSetDimensionValueAssignTheCorrectValue()
shouldSetDimensionValueWithInvalidIndexesRaiseAnException
public void shouldSetDimensionValueWithInvalidIndexesRaiseAnException()

IdealPoint

public class IdealPoint extends ArrayPoint

d Class representing an ideal point (minimization is assumed)

Author:Antonio J.Nebro
Constructors
IdealPoint
public IdealPoint(int dimension)
Methods
update
public void update(double[] point)
update
public void update(List<? extends Solution<?>> solutionList)

IdealPointTest

public class IdealPointTest

Created by ajnebro on 12/2/16.

Methods
shouldConstructorCreateAnIdealPointWithAllObjectiveValuesCorrectlyInitialized
public void shouldConstructorCreateAnIdealPointWithAllObjectiveValuesCorrectlyInitialized()
shouldUpdateWithOneSolutionMakeTheIdealPointHaveTheSolutionValues
public void shouldUpdateWithOneSolutionMakeTheIdealPointHaveTheSolutionValues()
shouldUpdateWithThreeSolutionsLeadToTheCorrectIdealPoint
public void shouldUpdateWithThreeSolutionsLeadToTheCorrectIdealPoint()
shouldUpdateWithTwoSolutionsLeadToTheCorrectIdealPoint
public void shouldUpdateWithTwoSolutionsLeadToTheCorrectIdealPoint()

LexicographicalPointComparatorTest

public class LexicographicalPointComparatorTest
Author:Antonio J. Nebro
Methods
shouldCompareDifferentLengthPointsReturnTheCorrectValue
public void shouldCompareDifferentLengthPointsReturnTheCorrectValue()
shouldCompareEmptyPointsReturnZero
public void shouldCompareEmptyPointsReturnZero()
shouldCompareIdenticalPointsButTheFirstValueReturnMinus1
public void shouldCompareIdenticalPointsButTheFirstValueReturnMinus1()
shouldCompareIdenticalPointsButTheFirstValueReturnPlus1
public void shouldCompareIdenticalPointsButTheFirstValueReturnPlus1()
shouldCompareIdenticalPointsButTheLastValueReturnMinus1
public void shouldCompareIdenticalPointsButTheLastValueReturnMinus1()
shouldCompareIdenticalPointsButTheLastValueReturnPlus1
public void shouldCompareIdenticalPointsButTheLastValueReturnPlus1()
shouldCompareIdenticalPointsReturnZero
public void shouldCompareIdenticalPointsReturnZero()
shouldFirstPointToCompareEqualsToNullRaiseAnException
public void shouldFirstPointToCompareEqualsToNullRaiseAnException()
shouldSecondPointToCompareEqualsToNullRaiseAnException
public void shouldSecondPointToCompareEqualsToNullRaiseAnException()
startup
public void startup()

NadirPoint

public class NadirPoint extends ArrayPoint

Class representing a nadir point (minimization is assumed)

Author:Antonio J.Nebro
Constructors
NadirPoint
public NadirPoint(int dimension)
Methods
update
public void update(double[] point)
update
public void update(List<? extends Solution<?>> solutionList)

NadirPointTest

public class NadirPointTest

Created by ajnebro on 12/2/16.

Methods
shouldConstructorCreateANadirPointWithAllObjectiveValuesCorrectlyInitialized
public void shouldConstructorCreateANadirPointWithAllObjectiveValuesCorrectlyInitialized()
shouldUpdateAListOfSolutionsLeadToTheCorrectNadirPoint
public void shouldUpdateAListOfSolutionsLeadToTheCorrectNadirPoint()
shouldUpdateWithOneSolutionMakeTheNadirPointHaveTheSolutionValues
public void shouldUpdateWithOneSolutionMakeTheNadirPointHaveTheSolutionValues()
shouldUpdateWithThreeSolutionsLeadToTheCorrectNadirPoint
public void shouldUpdateWithThreeSolutionsLeadToTheCorrectNadirPoint()
shouldUpdateWithTwoSolutionsLeadToTheCorrectNadirPoint
public void shouldUpdateWithTwoSolutionsLeadToTheCorrectNadirPoint()

PointComparatorTest

public class PointComparatorTest
Author:Antonio J. Nebro
Methods
shouldCompareBetterReturnZeroIfBothPointsAreEqualWhenMaximizing
public void shouldCompareBetterReturnZeroIfBothPointsAreEqualWhenMaximizing()
shouldCompareBetterReturnZeroIfBothPointsAreEqualWhenMinimizing
public void shouldCompareBetterReturnZeroIfBothPointsAreEqualWhenMinimizing()
shouldCompareReturnMinusOneIfTheFirstPointIsBetterThanTheSecondOneWhenMaximizing
public void shouldCompareReturnMinusOneIfTheFirstPointIsBetterThanTheSecondOneWhenMaximizing()
shouldCompareReturnOneIfTheSecondPointIsBetterThanTheFirstOneWhenMaximizing
public void shouldCompareReturnOneIfTheSecondPointIsBetterThanTheFirstOneWhenMaximizing()
shouldComparingDifferentLengthPointsRaiseAnException
public void shouldComparingDifferentLengthPointsRaiseAnException()
shouldFirstPointToCompareEqualsToNullRaiseAnException
public void shouldFirstPointToCompareEqualsToNullRaiseAnException()
shouldSecondPointToCompareEqualsToNullRaiseAnException
public void shouldSecondPointToCompareEqualsToNullRaiseAnException()

PointDimensionComparatorTest

public class PointDimensionComparatorTest
Author:Antonio J. Nebro
Methods
clean
public void clean()
setup
public void setup()
shouldCompareReturnMinusOneIfTheFirstValueIsLower
public void shouldCompareReturnMinusOneIfTheFirstValueIsLower()
shouldCompareReturnPlusOneIfTheFirstValueIsGreater
public void shouldCompareReturnPlusOneIfTheFirstValueIsGreater()
shouldCompareReturnZeroIfTheComparedValuesAreEqual
public void shouldCompareReturnZeroIfTheComparedValuesAreEqual()
shouldFirstPointToCompareEqualsToNullRaiseAnException
public void shouldFirstPointToCompareEqualsToNullRaiseAnException()
shouldIndexLessThanZeroRaiseAnException
public void shouldIndexLessThanZeroRaiseAnException()
shouldIndexValueGreaterThanFirstPointDimensionsRaiseAnException
public void shouldIndexValueGreaterThanFirstPointDimensionsRaiseAnException()
shouldIndexValueGreaterThanSecondPointDimensionsRaiseAnException
public void shouldIndexValueGreaterThanSecondPointDimensionsRaiseAnException()
shouldSecondPointToCompareEqualsToNullRaiseAnException
public void shouldSecondPointToCompareEqualsToNullRaiseAnException()

PointSolutionTest

public class PointSolutionTest
Author:Antonio J. Nebro
Methods
idleTestToCoverTheUnusedMethods
public void idleTestToCoverTheUnusedMethods()
shouldCopyConstructorCreateAnIdenticalObject
public void shouldCopyConstructorCreateAnIdenticalObject()
shouldCopyReturnACopyOfTheSolution
public void shouldCopyReturnACopyOfTheSolution()
shouldDefaultConstructorCreateTheObjectCorrectly
public void shouldDefaultConstructorCreateTheObjectCorrectly()
shouldEqualsReturnFalseIfTheClassIsNotAPoint
public void shouldEqualsReturnFalseIfTheClassIsNotAPoint()
shouldEqualsReturnFalseIfThePointsAreNotIdentical
public void shouldEqualsReturnFalseIfThePointsAreNotIdentical()
shouldEqualsReturnFalseIfTheSolutionIsNull
public void shouldEqualsReturnFalseIfTheSolutionIsNull()
shouldEqualsReturnFalseIfTheTwoSolutionsHaveDifferentNumberOfObjectives
public void shouldEqualsReturnFalseIfTheTwoSolutionsHaveDifferentNumberOfObjectives()
shouldEqualsReturnTrueIfTheSolutionsAreIdentical
public void shouldEqualsReturnTrueIfTheSolutionsAreIdentical()
shouldEqualsReturnTrueIfTheTwoPointsAreTheSame
public void shouldEqualsReturnTrueIfTheTwoPointsAreTheSame()
shouldGetNumberOfObjectivesReturnTheCorrectValue
public void shouldGetNumberOfObjectivesReturnTheCorrectValue()
shouldGetObjectiveReturnTheCorrectValue
public void shouldGetObjectiveReturnTheCorrectValue()
shouldHashCodeReturnTheCorrectValue
public void shouldHashCodeReturnTheCorrectValue()
shouldSetObjectiveAssignTheTheCorrectValue
public void shouldSetObjectiveAssignTheTheCorrectValue()

org.uma.jmetal.util.point.util

DominanceDistanceTest

public class DominanceDistanceTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldCalculatingDistanceOfPointsWithOneDimensionReturnTheCorrectValue
public void shouldCalculatingDistanceOfPointsWithOneDimensionReturnTheCorrectValue()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseA
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseA()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseB
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseB()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseC
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseC()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseD
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseD()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseE
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseE()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseF
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseF()
shouldCalculatingDistanceOfPointsWithZeroDimensionReturnZero
public void shouldCalculatingDistanceOfPointsWithZeroDimensionReturnZero()
shouldFirstPointToCompareEqualsToNullRaiseAnException
public void shouldFirstPointToCompareEqualsToNullRaiseAnException()
shouldPassingPointsWithDifferentDimensionsRaiseAnException
public void shouldPassingPointsWithDifferentDimensionsRaiseAnException()
shouldSecondPointToCompareEqualsToNullRaiseAnException
public void shouldSecondPointToCompareEqualsToNullRaiseAnException()

EuclideanDistanceTest

public class EuclideanDistanceTest
Author:Antonio J. Nebro
Methods
setup
public void setup()
shouldCalculatingDistanceOfPointsWithOneDimensionReturnTheCorrectValue
public void shouldCalculatingDistanceOfPointsWithOneDimensionReturnTheCorrectValue()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseA
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseA()
shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseB
public void shouldCalculatingDistanceOfPointsWithTwoDimensionsReturnTheCorrectValueCaseB()
shouldCalculatingDistanceOfPointsWithZeroDimensionReturnZero
public void shouldCalculatingDistanceOfPointsWithZeroDimensionReturnZero()
shouldFirstPointToCompareEqualsToNullRaiseAnException
public void shouldFirstPointToCompareEqualsToNullRaiseAnException()
shouldPassingPointsWithDifferentDimensionsRaiseAnException
public void shouldPassingPointsWithDifferentDimensionsRaiseAnException()
shouldSecondPointToCompareEqualsToNullRaiseAnException
public void shouldSecondPointToCompareEqualsToNullRaiseAnException()

org.uma.jmetal.util.point.util.comparator

LexicographicalPointComparator

public class LexicographicalPointComparator implements Comparator<Point>

This class implements the Comparator interface for comparing tow points. The order used is lexicographical order.

Author:Antonio J. Nebro , Juan J. Durillo
Methods
compare
public int compare(Point pointOne, Point pointTwo)

The compare method compare the objects o1 and o2.

Parameters:
  • pointOne – An object that reference a double[]
  • pointTwo – An object that reference a double[]
Returns:

The following value: -1 if point1 < point2, 1 if point1 > point2 or 0 in other case.

PointComparator

public class PointComparator implements Comparator<Point>

Point comparator. Starts the comparison from front last point dimension to the first one

Author:Antonio J. Nebro
Constructors
PointComparator
public PointComparator()
Methods
compare
public int compare(Point pointOne, Point pointTwo)

Compares two Point objects

Parameters:
  • pointOne – An object that reference a Point
  • pointTwo – An object that reference a Point
Returns:

-1 if o1 < o1, 1 if o1 > o2 or 0 in other case.

setMaximizing
public void setMaximizing()
setMinimizing
public void setMinimizing()

PointDimensionComparator

public class PointDimensionComparator implements Comparator<Point>

This class implements the Comparator interface. It is used to compare two points according the value of a particular dimension.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
PointDimensionComparator
public PointDimensionComparator(int index)

Constructor

Methods
compare
public int compare(Point pointOne, Point pointTwo)

Compares the objects o1 and o2.

Parameters:
  • pointOne – An object that reference a double[]
  • pointTwo – An object that reference a double[]
Returns:

-1 if o1 < o1, 1 if o1 > o2 or 0 in other case.

org.uma.jmetal.util.point.util.distance

DominanceDistance

public class DominanceDistance implements PointDistance

Computes the distance between two points a y b according to the dominance relationship. Point a is supposed to be point of the Pareto front

Author:Antonio J. Nebro
Methods
compute
public double compute(Point a, Point b)

EuclideanDistance

public class EuclideanDistance implements PointDistance

Computes the Euclidean distance between two points

Author:Antonio J. Nebro
Methods
compute
public double compute(Point a, Point b)

PointDistance

public interface PointDistance

Interface representing classes for computing a distance between two points

Author:Antonio J. Nebro
Methods
compute
public double compute(Point pointA, Point pointB)

org.uma.jmetal.util.pseudorandom

BoundedRandomGenerator

public interface BoundedRandomGenerator<Value extends Comparable<Value>>

A BoundedRandomGenerator aims to provide a random value within a specific range. The range is inclusive, such that the lower bound and upper bound can be generated. Because lower and upper bounds make no sense if values cannot be compared, only Comparable values can be generated through this kind of generator. A BoundedRandomGenerator is a FunctionalInterface. It is not intended to be directly implemented by a class, but instead to request a method for generating random values, usually by using lambda expressions.

Author:

Matthieu Vergne

Parameters:
  • <Value> – The type of value to generate
Methods
bound
static BoundedRandomGenerator<Double> bound(RandomGenerator<Double> unboundedGenerator)

Create a BoundedRandomGenerator from a RandomGenerator which generate Double values between 0 and 1 (inclusive or exclusive). The distribution is preserved.

Parameters:
  • unboundedGeneratorRandomGenerator which generates values between 0 and 1
Returns:

BoundedRandomGenerator which generates Double values based on the provided generator

fromDoubleToInteger
static BoundedRandomGenerator<Integer> fromDoubleToInteger(BoundedRandomGenerator<Double> doubleGenerator)

Create a BoundedRandomGenerator which generates Integer values from a BoundedRandomGenerator which generate Double values. The distribution is preserved.

Parameters:
Returns:

BoundedRandomGenerator which generates Integer values based on the provided generator

fromDoubleToInteger
static BoundedRandomGenerator<Integer> fromDoubleToInteger(RandomGenerator<Double> doubleGenerator)

Create a BoundedRandomGenerator which generates Integer values from a BoundedRandomGenerator which generate Double values between 0 and 1 (inclusive or exclusive). The distribution is preserved.

Parameters:
Returns:

BoundedRandomGenerator which generates Integer values based on the provided generator

getRandomValue
Value getRandomValue(Value lowerBound, Value upperBound)

Generate a random value within the provided range.

Parameters:
  • lowerBound – the minimal value which can be generated
  • upperBound – the maximal value which can be generated
Returns:

the value generated

BoundedRandomGeneratorTest

public class BoundedRandomGeneratorTest
Methods
testBoundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectDistribution
public void testBoundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectDistribution()
testBoundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectValues
public void testBoundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectValues()
testBoundingFactoryMethodReturnsGeneratorWithCorrectValues
public void testBoundingFactoryMethodReturnsGeneratorWithCorrectValues()
testUnboundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectDistribution
public void testUnboundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectDistribution()
testUnboundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectValues
public void testUnboundedDoubleToIntegerFactoryMethodReturnsGeneratorWithCorrectValues()

JMetalRandom

public class JMetalRandom implements Serializable
Author:Antonio J. Nebro
Methods
getGeneratorName
public String getGeneratorName()
getInstance
public static JMetalRandom getInstance()
getRandomGenerator
public PseudoRandomGenerator getRandomGenerator()
getSeed
public long getSeed()
nextDouble
public double nextDouble()
nextDouble
public double nextDouble(double lowerBound, double upperBound)
nextInt
public int nextInt(int lowerBound, int upperBound)
setRandomGenerator
public void setRandomGenerator(PseudoRandomGenerator randomGenerator)
setSeed
public void setSeed(long seed)

PseudoRandomGenerator

public interface PseudoRandomGenerator extends Serializable
Author:Antonio J. Nebro
Methods
getName
public String getName()
getSeed
public long getSeed()
nextDouble
public double nextDouble(double lowerBound, double upperBound)
nextDouble
public double nextDouble()
nextInt
public int nextInt(int lowerBound, int upperBound)
setSeed
public void setSeed(long seed)

RandomGenerator

public interface RandomGenerator<Value>

A RandomGenerator aims to provide a random value of a given type. Any value of this type can be generated. A RandomGenerator is a FunctionalInterface. It is not intended to be directly implemented by a class, but instead to request a method for generating random values, usually by using lambda expressions.

Author:

Matthieu Vergne

Parameters:
  • <Value> – The type of value to generate
Methods
filter
static <T> RandomGenerator<T> filter(RandomGenerator<T> generator, Predicate<T> filter)

Reduce a RandomGenerator range. The returned RandomGenerator uses the provided one to generate random values, but regenerate them if they do not pass the filter. Consequently, the initial RandomGenerator may be called several times o generate a single value. The impact on performance depends on the part of the distribution which is filtered out: if a significant part of the distribution is rejected, it might be more interesting to create a dedicated RandomGenerator.

Parameters:
  • generator – the RandomGenerator to filter
  • filter – the filter to pass to be an acceptable value
Returns:

a RandomGenerator which provides only acceptable values

forArray
static <T> RandomGenerator<T> forArray(BoundedRandomGenerator<Integer> indexSelector, T... values)

Create a RandomGenerator over an array based on a random selector.

Parameters:
  • indexSelector – the random selector
  • values – the values to return
Returns:

a RandomGenerator on the provided values

forCollection
static <T> RandomGenerator<T> forCollection(BoundedRandomGenerator<Integer> indexSelector, Collection<T> values)

Create a RandomGenerator over a Collection based on a random selector.

Parameters:
  • indexSelector – the random selector
  • values – the values to return
Returns:

a RandomGenerator on the provided values

forEnum
static <T extends Enum<T>> RandomGenerator<T> forEnum(BoundedRandomGenerator<Integer> indexSelector, Class<T> enumClass)

Create a RandomGenerator over Enum values based on a random selector.

Parameters:
  • indexSelector – the random selector
  • enumClass – the Enum to cover
Returns:

a RandomGenerator on the Enum values

getRandomValue
public Value getRandomValue()

Generate a random value.

Returns:the value generated

RandomGeneratorTest

public class RandomGeneratorTest
Methods
testArrayGeneratorGeneratesAllValues
public void testArrayGeneratorGeneratesAllValues()
testCollectionGeneratorGeneratesAllValues
public void testCollectionGeneratorGeneratesAllValues()
testEnumGeneratorGeneratesAllValues
public void testEnumGeneratorGeneratesAllValues()
testFilteredGeneratorGeneratesCorrectValues
public void testFilteredGeneratorGeneratesCorrectValues()

RandomGeneratorTest.EnumValues

enum EnumValues
Enum Constants
VAL1
public static final RandomGeneratorTest.EnumValues VAL1
VAL2
public static final RandomGeneratorTest.EnumValues VAL2
VAL3
public static final RandomGeneratorTest.EnumValues VAL3

org.uma.jmetal.util.pseudorandom.impl

AuditableRandomGenerator

public class AuditableRandomGenerator implements PseudoRandomGenerator

An AuditableRandomGenerator is a PseudoRandomGenerator which can be audited to know when a random generation method is called.

Author:Matthieu Vergne
Constructors
AuditableRandomGenerator
public AuditableRandomGenerator(PseudoRandomGenerator generator)
Methods
addListener
public void addListener(Consumer<Audit> listener)
getName
public String getName()
getSeed
public long getSeed()
nextDouble
public double nextDouble(double lowerBound, double upperBound)
nextDouble
public double nextDouble()
nextInt
public int nextInt(int lowerBound, int upperBound)
removeListener
public void removeListener(Consumer<Audit> listener)
setSeed
public void setSeed(long seed)

AuditableRandomGenerator.Audit

public static class Audit
Constructors
Audit
public Audit(RandomMethod method, Bounds bounds, Number result)
Methods
getBounds
public Optional<Bounds> getBounds()
getMethod
public RandomMethod getMethod()
getResult
public Number getResult()

AuditableRandomGenerator.Bounds

public static class Bounds
Fields
lower
final Number lower
upper
final Number upper
Constructors
Bounds
public Bounds(Number lower, Number upper)

AuditableRandomGenerator.RandomMethod

public static enum RandomMethod
Enum Constants
BOUNDED_DOUBLE
public static final AuditableRandomGenerator.RandomMethod BOUNDED_DOUBLE
BOUNDED_INT
public static final AuditableRandomGenerator.RandomMethod BOUNDED_INT
DOUBLE
public static final AuditableRandomGenerator.RandomMethod DOUBLE

AuditableRandomGeneratorTest

public class AuditableRandomGeneratorTest
Methods
testAuditableRandomGeneratorProvidesCorrectAuditWhenGettingBoundedDouble
public void testAuditableRandomGeneratorProvidesCorrectAuditWhenGettingBoundedDouble()
testAuditableRandomGeneratorProvidesCorrectAuditWhenGettingBoundedInteger
public void testAuditableRandomGeneratorProvidesCorrectAuditWhenGettingBoundedInteger()
testAuditableRandomGeneratorProvidesCorrectAuditWhenGettingDouble
public void testAuditableRandomGeneratorProvidesCorrectAuditWhenGettingDouble()

ExtendedPseudoRandomGenerator

public class ExtendedPseudoRandomGenerator implements PseudoRandomGenerator

Extended pseudo random number generator based on the decorator pattern. Two new methods are added: randNormal() and randSphere()

Author:Antonio J. Nebro
Constructors
ExtendedPseudoRandomGenerator
public ExtendedPseudoRandomGenerator(PseudoRandomGenerator randomGenerator)
Methods
getName
public String getName()
getSeed
public long getSeed()
nextDouble
public double nextDouble(double lowerBound, double upperBound)
nextDouble
public double nextDouble()
nextInt
public int nextInt(int lowerBound, int upperBound)
randNormal
public double randNormal(double mean, double standardDeviation)

Use the polar form of the Box-Muller transformation to obtain a pseudo random number from a Gaussian distribution Code taken from Maurice Clerc’s implementation

Parameters:
  • mean
  • standardDeviation
Returns:

A pseudo random number

randSphere
public double[] randSphere(int dimension)

Get a random point from an hypersphere (center = 0, radius = 1) Code taken from Maurice Clerc’s implementation

Parameters:
  • dimension
Returns:

A pseudo random point

randSphere
public double[] randSphere(int dimension, double center, double radius)

Ger a random point from an hypersphere Code taken from Maurice Clerc’s implementation

Parameters:
  • center
  • radius
Returns:

A pseudo random number

setSeed
public void setSeed(long seed)

JavaRandomGenerator

public class JavaRandomGenerator implements PseudoRandomGenerator
Author:Antonio J. Nebro
Constructors
JavaRandomGenerator
public JavaRandomGenerator()

Constructor

JavaRandomGenerator
public JavaRandomGenerator(long seed)

Constructor

Methods
getName
public String getName()
getSeed
public long getSeed()
nextDouble
public double nextDouble(double lowerBound, double upperBound)
nextDouble
public double nextDouble()
nextInt
public int nextInt(int lowerBound, int upperBound)
setSeed
public void setSeed(long seed)

MersenneTwisterGenerator

public class MersenneTwisterGenerator implements PseudoRandomGenerator
Author:Antonio J. Nebro
Constructors
MersenneTwisterGenerator
public MersenneTwisterGenerator()

Constructor

MersenneTwisterGenerator
public MersenneTwisterGenerator(long seed)

Constructor

Methods
getName
public String getName()
getSeed
public long getSeed()
nextDouble
public double nextDouble(double lowerBound, double upperBound)
nextDouble
public double nextDouble()
nextInt
public int nextInt(int lowerBound, int upperBound)
setSeed
public void setSeed(long seed)

Well44497bGenerator

public class Well44497bGenerator implements PseudoRandomGenerator
Author:Antonio J. Nebro
Constructors
Well44497bGenerator
public Well44497bGenerator()

Constructor

Well44497bGenerator
public Well44497bGenerator(long seed)

Constructor

Methods
getName
public String getName()
getSeed
public long getSeed()
nextDouble
public double nextDouble(double lowerBound, double upperBound)
nextDouble
public double nextDouble()
nextInt
public int nextInt(int lowerBound, int upperBound)
setSeed
public void setSeed(long seed)

org.uma.jmetal.util.solutionattribute

DensityEstimator

public interface DensityEstimator<S> extends SolutionAttribute<S, Double>

Interface representing implementations to compute the crowding distance

Author:Antonio J. Nebro
Methods
computeDensityEstimator
public void computeDensityEstimator(List<S> solutionSet)

Ranking

public interface Ranking<S> extends SolutionAttribute<S, Integer>

Ranks a list of solutions according to the dominance relationship

Author:Antonio J. Nebro
Methods
computeRanking
public Ranking<S> computeRanking(List<S> solutionList)
getNumberOfSubfronts
public int getNumberOfSubfronts()
getSubfront
public List<S> getSubfront(int rank)

SolutionAttribute

public interface SolutionAttribute<S, V> extends Serializable

Attributes allows to extend the solution classes to incorporate data required by operators or algorithms manipulating them.

Author:Antonio J. Nebro
Methods
getAttribute
public V getAttribute(S solution)
getAttributeIdentifier
public Object getAttributeIdentifier()
setAttribute
public void setAttribute(S solution, V value)

org.uma.jmetal.util.solutionattribute.impl

CrowdingDistance

public class CrowdingDistance<S extends Solution<?>> extends GenericSolutionAttribute<S, Double> implements DensityEstimator<S>

This class implements the crowding distance

Author:Antonio J. Nebro
Methods
computeDensityEstimator
public void computeDensityEstimator(List<S> solutionList)

Assigns crowding distances to all solutions in a SolutionSet.

Parameters:
  • solutionList – The SolutionSet.
Throws:
getAttributeIdentifier
public Object getAttributeIdentifier()

CrowdingDistanceTest

public class CrowdingDistanceTest
Author:Antonio J. Nebro
Methods
shouldTheCrowdingDistanceOfASingleSolutionBeInfinity
public void shouldTheCrowdingDistanceOfASingleSolutionBeInfinity()
shouldTheCrowdingDistanceOfAnEmptySetDoNothing
public void shouldTheCrowdingDistanceOfAnEmptySetDoNothing()
shouldTheCrowdingDistanceOfThreeSolutionsCorrectlyAssigned
public void shouldTheCrowdingDistanceOfThreeSolutionsCorrectlyAssigned()
shouldTheCrowdingDistanceOfTwoSolutionsBeInfinity
public void shouldTheCrowdingDistanceOfTwoSolutionsBeInfinity()

DistanceToSolutionListAttribute

public class DistanceToSolutionListAttribute extends GenericSolutionAttribute<Solution<?>, Double>

Created by cbarba on 24/3/15.

DominanceRanking

public class DominanceRanking<S extends Solution<?>> extends GenericSolutionAttribute<S, Integer> implements Ranking<S>

This class implements some facilities for ranking set of solutions. Given a collection of solutions, they are ranked according to scheme proposed in NSGA-II; as an output, a set of subsets are obtained. The subsets are numbered starting from 0 (in NSGA-II, the numbering starts from 1); thus, subset 0 contains the non-dominated solutions, subset 1 contains the non-dominated solutions after removing those belonging to subset 0, and so on.

Author:Antonio J. Nebro , Juan J. Durillo
Constructors
DominanceRanking
public DominanceRanking(Comparator<S> comparator)

Constructor

DominanceRanking
public DominanceRanking()

Constructor

DominanceRanking
public DominanceRanking(Object id)
Methods
computeRanking
public Ranking<S> computeRanking(List<S> solutionSet)
getNumberOfSubfronts
public int getNumberOfSubfronts()
getSubfront
public List<S> getSubfront(int rank)

DominanceRankingTest

public class DominanceRankingTest
Author:Antonio J. Nebro
Methods
shouldRankingOfAPopulationWithFiveSolutionsWorkProperly
public void shouldRankingOfAPopulationWithFiveSolutionsWorkProperly()
shouldRankingOfAPopulationWithThreeDominatedSolutionsReturnThreeSubfronts
public void shouldRankingOfAPopulationWithThreeDominatedSolutionsReturnThreeSubfronts()
shouldRankingOfAPopulationWithTwoDominatedSolutionsReturnTwoSubfronts
public void shouldRankingOfAPopulationWithTwoDominatedSolutionsReturnTwoSubfronts()
shouldRankingOfAPopulationWithTwoNonDominatedSolutionsReturnOneSubfront
public void shouldRankingOfAPopulationWithTwoNonDominatedSolutionsReturnOneSubfront()
shouldTheRankingOfAnEmptyPopulationReturnOneSubfronts
public void shouldTheRankingOfAnEmptyPopulationReturnOneSubfronts()
shouldTheRankingOfAnEmptyPopulationReturnZeroSubfronts
public void shouldTheRankingOfAnEmptyPopulationReturnZeroSubfronts()

Fitness

public class Fitness<S extends Solution<?>> extends GenericSolutionAttribute<S, Double>
Author:Antonio J. Nebro

GenericSolutionAttribute

public class GenericSolutionAttribute<S extends Solution<?>, V> implements SolutionAttribute<S, V>

Generic class for implementing SolutionAttribute classes. By default, the identifier of a SolutionAttribute is the class object, but it can be set to a different value when constructing an instance.

Author:Antonio J. Nebro
Constructors
GenericSolutionAttribute
public GenericSolutionAttribute()

Constructor

GenericSolutionAttribute
public GenericSolutionAttribute(Object id)

Constructor

Parameters:
  • id – Attribute identifier
Methods
getAttribute
public V getAttribute(S solution)
getAttributeIdentifier
public Object getAttributeIdentifier()
setAttribute
public void setAttribute(S solution, V value)

GenericSolutionAttributeTest

public class GenericSolutionAttributeTest
Author:Antonio J. Nebro
Methods
shouldConstructorCreateASolutionAttributedWithThePassedIdentifier
public void shouldConstructorCreateASolutionAttributedWithThePassedIdentifier()
shouldDefaultConstructorCreateASolutionAttributedWithAnIdentifierEqualToTheClassObject
public void shouldDefaultConstructorCreateASolutionAttributedWithAnIdentifierEqualToTheClassObject()
shouldGetAttributeIdentifierReturnTheRightIdentifier
public void shouldGetAttributeIdentifierReturnTheRightIdentifier()
shouldGetAttributeReturnNullIfTheSolutionHasNoAttribute
public void shouldGetAttributeReturnNullIfTheSolutionHasNoAttribute()
shouldGetAttributeReturnTheAttributeValue
public void shouldGetAttributeReturnTheAttributeValue()
shouldSetAttributeAssignTheAttributeValueToTheSolution
public void shouldSetAttributeAssignTheAttributeValueToTheSolution()

HypervolumeContributionAttribute

public class HypervolumeContributionAttribute<S extends Solution<?>> extends GenericSolutionAttribute<S, Double>
Author:Antonio J. Nebro

LocationAttribute

public class LocationAttribute<S extends Solution<?>> extends GenericSolutionAttribute<S, Integer>

Assign to each solution in a solution list an attribute containing the position of the solutions in the list.

Author:

Antonio J. Nebro

Parameters:
  • <S>
Constructors
LocationAttribute
public LocationAttribute(List<S> solutionList)

NumberOfViolatedConstraints

public class NumberOfViolatedConstraints<S extends Solution<?>> extends GenericSolutionAttribute<S, Integer>
Author:Antonio J. Nebro

OverallConstraintViolation

public class OverallConstraintViolation<S extends Solution<?>> extends GenericSolutionAttribute<S, Double>
Author:Antonio J. Nebro

PreferenceDistance

public class PreferenceDistance<S extends Solution<?>> extends GenericSolutionAttribute<S, Double> implements DensityEstimator<S>
Constructors
PreferenceDistance
public PreferenceDistance(List<Double> interestPoint, double epsilon)
Methods
computeDensityEstimator
public void computeDensityEstimator(List<S> solutionList)
epsilonClean
public List<S> epsilonClean(List<S> solutionList)
getSize
public int getSize()
updatePointOfInterest
public void updatePointOfInterest(List<Double> newInterestPoint)

StrengthRawFitness

public class StrengthRawFitness<S extends Solution<?>> extends GenericSolutionAttribute<S, Double> implements DensityEstimator<S>
Methods
computeDensityEstimator
public void computeDensityEstimator(List<S> solutionSet)

org.uma.jmetal.utility

GenerateReferenceFrontFromFile

public class GenerateReferenceFrontFromFile

This utility reads a file or the files in a directory and creates a reference front. The file(s) must contain only objective values. The program receives two parameters: 1. the name of the file or directory containing the data 2. the output file name which will contain the generated front

Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

org.uma.jmetal.workingTest

BLXAlphaCrossoverWorkingTest

public class BLXAlphaCrossoverWorkingTest
Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Program to generate data representing the distribution of points generated by a SBX crossover operator. The parameters to be introduced by the command line are: - numberOfSolutions: number of solutions to generate - granularity: number of subdivisions to be considered. - alpha: alpha value - outputFile: file containing the results

Parameters:
  • args – Command line arguments

BLXAlphaCrossoverWorkingTest.VariableComparator

public static class VariableComparator implements Comparator<DoubleSolution>
Methods
compare
public int compare(DoubleSolution solution1, DoubleSolution solution2)

Compares two solutions according to the first variable value

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

IntegerPolynomialMutationWorkingTest

public class IntegerPolynomialMutationWorkingTest
Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Program to generate data representing the distribution of points generated by a polynomial mutation operator. The parameters to be introduced by the command line are: - numberOfSolutions: number of solutions to generate - granularity: number of subdivisions to be considered. - distributionIndex: distribution index of the polynomial mutation operator - outputFile: file containing the results

Parameters:
  • args – Command line arguments

IntegerPolynomialMutationWorkingTest.VariableComparator

public static class VariableComparator implements Comparator<IntegerSolution>
Methods
compare
public int compare(IntegerSolution solution1, IntegerSolution solution2)

Compares two solutions according to the first variable value

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

IntegerSBXCrossoverWorkingTest

public class IntegerSBXCrossoverWorkingTest
Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Program to generate data representing the distribution of points generated by a SBX crossover operator. The parameters to be introduced by the command line are: - numberOfSolutions: number of solutions to generate - granularity: number of subdivisions to be considered. - distributionIndex: distribution index of the polynomial mutation operator - outputFile: file containing the results

Parameters:
  • args – Command line arguments

IntegerSBXCrossoverWorkingTest.VariableComparator

public static class VariableComparator implements Comparator<IntegerSolution>
Methods
compare
public int compare(IntegerSolution solution1, IntegerSolution solution2)

Compares two solutions according to the first variable value

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

PolynomialMutationWorkingTest

public class PolynomialMutationWorkingTest
Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Program to generate data representing the distribution of points generated by a polynomial mutation operator. The parameters to be introduced by the command line are: - numberOfSolutions: number of solutions to generate - granularity: number of subdivisions to be considered. - distributionIndex: distribution index of the polynomial mutation operator - outputFile: file containing the results

Parameters:
  • args – Command line arguments

PolynomialMutationWorkingTest.VariableComparator

public static class VariableComparator implements Comparator<DoubleSolution>
Methods
compare
public int compare(DoubleSolution solution1, DoubleSolution solution2)

Compares two solutions according to the first variable value

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

SBXCrossoverWorkingTest

public class SBXCrossoverWorkingTest
Author:Antonio J. Nebro
Methods
main
public static void main(String[] args)

Program to generate data representing the distribution of points generated by a SBX crossover operator. The parameters to be introduced by the command line are: - numberOfSolutions: number of solutions to generate - granularity: number of subdivisions to be considered. - distributionIndex: distribution index of the polynomial mutation operator - outputFile: file containing the results

Parameters:
  • args – Command line arguments

SBXCrossoverWorkingTest.VariableComparator

public static class VariableComparator implements Comparator<DoubleSolution>
Methods
compare
public int compare(DoubleSolution solution1, DoubleSolution solution2)

Compares two solutions according to the first variable value

Parameters:
  • solution1 – Object representing the first Solution.
  • solution2 – Object representing the second Solution.
Returns:

-1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.

About

jMetal is being developed by Antonio J. Nebro (email), associate professor at the University of Málaga, Juan J. Durillo (email), Matthieu Vergne (email) and Antonio Benítez-Hidalgo (email).

Note

Latest version: jMetal 5.6. Last update: September 25th 2018. This site was up in: September 25th 2018.

References

  1. J.J. Durillo, A.J. Nebro jMetal: a Java Framework for Multi-Objective Optimization. Advances in Engineering Software 42 (2011) 760-771.
  2. A.J. Nebro, J.J. Durillo, M. Vergne Redesigning the jMetal Multi-Objective Optimization Framework. GECCO (Companion) 2015, pp: 1093-1100. July 2015.
  3. Nebro A.J. et al. (2018) Extending the Speed-Constrained Multi-objective PSO (SMPSO) with Reference Point Based Preference Articulation. In: Auger A., Fonseca C., Lourenço N., Machado P., Paquete L., Whitley D. (eds) Parallel Problem Solving from Nature – PPSN XV. PPSN 2018. Lecture Notes in Computer Science, vol 11101. Springer, Cham

About jMetal 5

jMetal 5 is the first major revision of jMetal since its initial version. The architecture have been redesigned from scratch to provide a simpler design while keeping the same functionality. The current version is jMetal 5.6.

Now jMetal is a Maven project that is hosted at GitHub, where interested people can access to the current status of the project and are free to contribute.

Note

The former jMetal versions are still available at SourceForge.

How to use it

You can find the last released versions of jMetal on the Maven Central Repository.

To use jMetal in your project, you need at least the jmetal-core artifact. It provides various components used to implement jMetal algorithms. To implement your own, you only need this package.

jMetal comes with various algorithms already implemented, which you can obtain by adding the jmetal-algorithm artifact. If you are more interested in experimenting with your own algorithms, you can instead add the jmetal-problem artifact to obtain various problems to solve. You can of course add both of them to try combinations. If you want to go further by running and evaluating different combinations, you can finally add the jmetal-exec artifact, which comes with various utilities.

Summary of features

  • Multi-objective algoritms: NSGA-II, SPEA2, PAES, PESA-II, OMOPSO, MOCell, AbYSS, MOEA/D, GDE3, IBEA, SMPSO, SMPSOhv, SMS-EMOA, MOEA/D-STM, MOEA/D-DE, MOCHC, MOMBI, MOMBI-II, NSGA-III, WASF-GA, GWASF-GA, R-NSGA-II, CDG-MOEA, ESPEA, SMSPO/RP
  • Single-objective algoritms: genetic algorithm (variants: generational, steady-state), evolution strategy (variants: elitist or mu+lambda, non-elitist or mu, lambda), DE, CMA-ES, PSO (Stantard 2007, Standard 2011), Coral reef optimization.
  • Algorithms that can be executed in parallel: NSGA-II, SMPSO, GDE3, SPEA2, PESA-II
  • Included problems:
    • Problem families: ZDT, DTLZ, WFG, CEC2009, LZ09, GLT, MOP, CEC2018
    • Classical problems: Kursawe, Fonseca, Schaffer, Viennet2, Viennet3
    • Constrained problems: Srinivas, Tanaka, Osyczka2, Constr_Ex, Golinski, Water, Viennet4
    • Combinatorial problems: multi-objective TSP
    • Academic problems: OneMax, OneZeroMax
  • Quality indicators: hypervolume, spread, generational distance, inverted generational distance, inverted generational distance plus, additive epsilon.
  • Variable representations: binary, real, integer, permutation, mixed encoding (real+binary, int+real).