Commit 05a712f7 authored by Fabian Becker's avatar Fabian Becker
Browse files

Implementation of the Jannlab DE

parent 9051558e
package eva2.optimization.enums;
public enum DEType {
RandOne, RandTwo, RandToBest, BestOne, BestTwo, Trigonometric, CurrentToRand;
RandOne, RandTwo, RandToBest, BestOne, BestTwo, Trigonometric, CurrentToRand, JannlabToBest;
@Override
public String toString() {
......@@ -20,6 +20,8 @@ public enum DEType {
return this.name();
case CurrentToRand:
return "DE/current-to-rand";
case JannlabToBest:
return "DE/JannLab/1";
default:
return this.name();
}
......
......@@ -334,7 +334,7 @@ public class DifferentialEvolution extends AbstractOptimizer implements java.io.
break;
}
case RandTwo: {
// this is DE/current-to-rand/1
// this is DE/rand/2
double[] rndDelta = this.fetchDeltaRandom(population);
double[] rndDelta2 = this.fetchDeltaRandom(population);
if (parents != null) {
......@@ -357,6 +357,19 @@ public class DifferentialEvolution extends AbstractOptimizer implements java.io.
}
break;
}
case JannlabToBest: {
// This is x_i + F * (x_best - x_r1) + F * (x_r2 - x_r3)
AbstractEAIndividual randomIndy = population.getRandNIndividuals(1).get(0);
double[] rndDelta = this.fetchDeltaRandom(population);
double[] bestDelta = this.fetchDeltaBest(population, (InterfaceDataTypeDouble)randomIndy);
if (parents != null) {
parents.add(population.getEAIndividual(parentIndex));
} // Add wherever oX is used directly
for (int i = 0; i < oX.length; i++) {
vX[i] = oX[i] + this.getCurrentF() * bestDelta[i] + this.getCurrentF() * rndDelta[i];
}
break;
}
case BestOne: {
// DE/best/1
AbstractEAIndividual bestIndy = getBestIndy(population);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment