Commit 5e4018d7 authored by Fabian Becker's avatar Fabian Becker

SelProb -> SelectionProbability

parent d0a3d2e4
......@@ -2,8 +2,8 @@ package eva2.optimization.operator.selection;
import eva2.optimization.individuals.AbstractEAIndividual;
import eva2.optimization.operator.selection.probability.InterfaceSelectionProbability;
import eva2.optimization.operator.selection.probability.SelProbStandard;
import eva2.optimization.operator.selection.probability.SelProbStandardScaling;
import eva2.optimization.operator.selection.probability.SelectionProbabilityStandard;
import eva2.optimization.operator.selection.probability.SelectionProbabilityStandardScaling;
import eva2.optimization.population.Population;
import eva2.tools.math.RNG;
import eva2.util.annotation.Description;
......@@ -23,14 +23,14 @@ public class SelectParticleWheel implements InterfaceSelection, java.io.Serializ
* Comment for {@code serialVersionUID}
*/
private static final long serialVersionUID = 1L;
private InterfaceSelectionProbability selProbCalculator = new SelProbStandard();
private InterfaceSelectionProbability selProbCalculator = new SelectionProbabilityStandard();
private boolean selectFixedSteps = false;
public SelectParticleWheel() {
}
public SelectParticleWheel(double scalingProb) {
selProbCalculator = new SelProbStandardScaling(scalingProb);
selProbCalculator = new SelectionProbabilityStandardScaling(scalingProb);
}
public SelectParticleWheel(InterfaceSelectionProbability selProb) {
......
......@@ -2,7 +2,7 @@ package eva2.optimization.operator.selection;
import eva2.optimization.individuals.AbstractEAIndividual;
import eva2.optimization.operator.selection.probability.InterfaceSelectionProbability;
import eva2.optimization.operator.selection.probability.SelProbStandard;
import eva2.optimization.operator.selection.probability.SelectionProbabilityStandard;
import eva2.optimization.population.Population;
import eva2.tools.math.RNG;
import eva2.util.annotation.Description;
......@@ -17,7 +17,7 @@ import eva2.util.annotation.Description;
public class SelectXProbRouletteWheel implements InterfaceSelection, java.io.Serializable {
private transient TreeElement[] treeRoot = null;
private InterfaceSelectionProbability selectionProbability = new SelProbStandard();
private InterfaceSelectionProbability selectionProbability = new SelectionProbabilityStandard();
private boolean obeyDebsConstViolationPrinciple = true;
public SelectXProbRouletteWheel() {
......
......@@ -11,7 +11,7 @@ import java.util.ArrayList;
* This abstract implementation gives some general
* methods for retrieving and cleaning fitness values.
*/
public abstract class AbstractSelProb implements InterfaceSelectionProbability, java.io.Serializable {
public abstract class AbstractSelectionProbability implements InterfaceSelectionProbability, java.io.Serializable {
/**
* This method allows you to make a deep clone of
......
......@@ -9,24 +9,24 @@ import eva2.util.annotation.Description;
* invariant to any linear transition function.
*/
@Description("This is the Boltzman Normation.")
public class SelProbBoltzman extends AbstractSelProb implements java.io.Serializable {
public class SelectionProbabilityBoltzman extends AbstractSelectionProbability implements java.io.Serializable {
private double q = 1.0;
public SelProbBoltzman() {
public SelectionProbabilityBoltzman() {
}
public SelProbBoltzman(double q) {
public SelectionProbabilityBoltzman(double q) {
this.q = q;
}
public SelProbBoltzman(SelProbBoltzman a) {
public SelectionProbabilityBoltzman(SelectionProbabilityBoltzman a) {
this.q = a.q;
}
@Override
public Object clone() {
return new SelProbBoltzman(this);
return new SelectionProbabilityBoltzman(this);
}
/**
......
......@@ -10,16 +10,16 @@ import eva2.util.annotation.Description;
* Here we have the infamous fitness sharing method.
*/
@Description("This is a fitness sharing based normation method.")
public class SelProbFitnessSharing extends AbstractSelProb implements java.io.Serializable {
public class SelectionProbabilityFitnessSharing extends AbstractSelectionProbability implements java.io.Serializable {
private InterfaceSelectionProbability basicNormationMethod = new SelProbStandard();
private InterfaceSelectionProbability basicNormationMethod = new SelectionProbabilityStandard();
private InterfaceDistanceMetric distanceMetric = new PhenotypeMetric();
private double sharingDistance = 0.1;
public SelProbFitnessSharing() {
public SelectionProbabilityFitnessSharing() {
}
public SelProbFitnessSharing(SelProbFitnessSharing a) {
public SelectionProbabilityFitnessSharing(SelectionProbabilityFitnessSharing a) {
if (a.basicNormationMethod != null) {
this.basicNormationMethod = (InterfaceSelectionProbability) a.basicNormationMethod.clone();
}
......@@ -31,7 +31,7 @@ public class SelProbFitnessSharing extends AbstractSelProb implements java.io.Se
@Override
public Object clone() {
return new SelProbFitnessSharing(this);
return new SelectionProbabilityFitnessSharing(this);
}
/**
......
......@@ -10,24 +10,24 @@ import eva2.util.annotation.Description;
*
*/
@Description("This is a standard normation method inverted by maximum fitness.")
public class SelProbInvertByMax extends AbstractSelProb {
public class SelectionProbabilityInvertByMax extends AbstractSelectionProbability {
private double maxFit = 1.;
public SelProbInvertByMax() {
public SelectionProbabilityInvertByMax() {
}
public SelProbInvertByMax(double mF) {
public SelectionProbabilityInvertByMax(double mF) {
maxFit = mF;
}
public SelProbInvertByMax(SelProbInvertByMax a) {
public SelectionProbabilityInvertByMax(SelectionProbabilityInvertByMax a) {
this.maxFit = a.maxFit;
}
@Override
public Object clone() {
return new SelProbInvertByMax(this);
return new SelectionProbabilityInvertByMax(this);
}
/**
......
......@@ -7,22 +7,22 @@ import eva2.util.annotation.Description;
* A linear ranking method with offsets.
*/
@Description("This is linear ranking normation.")
public class SelProbLinearRanking extends AbstractSelProb implements java.io.Serializable {
public class SelectionProbabilityLinearRanking extends AbstractSelectionProbability implements java.io.Serializable {
private double nappaPlus = 1.1;
private double nappaMinus = 0.9;
public SelProbLinearRanking() {
public SelectionProbabilityLinearRanking() {
}
public SelProbLinearRanking(SelProbLinearRanking a) {
public SelectionProbabilityLinearRanking(SelectionProbabilityLinearRanking a) {
this.nappaPlus = a.nappaPlus;
this.nappaMinus = a.nappaMinus;
}
@Override
public Object clone() {
return new SelProbLinearRanking(this);
return new SelectionProbabilityLinearRanking(this);
}
/**
......
......@@ -8,24 +8,24 @@ import eva2.util.annotation.Description;
* the given optimization problem i guess.
*/
@Description("This is non-linear ranking normation.")
public class SelProbNonLinearRanking extends AbstractSelProb implements java.io.Serializable {
public class SelectionProbabilityNonLinearRanking extends AbstractSelectionProbability implements java.io.Serializable {
private double c = 0.04;
public SelProbNonLinearRanking() {
public SelectionProbabilityNonLinearRanking() {
}
public SelProbNonLinearRanking(double theC) {
public SelectionProbabilityNonLinearRanking(double theC) {
this.c = theC;
}
public SelProbNonLinearRanking(SelProbNonLinearRanking a) {
public SelectionProbabilityNonLinearRanking(SelectionProbabilityNonLinearRanking a) {
this.c = a.c;
}
@Override
public Object clone() {
return new SelProbNonLinearRanking(this);
return new SelectionProbabilityNonLinearRanking(this);
}
/**
......
......@@ -8,17 +8,17 @@ import eva2.util.annotation.Description;
* This truly scaling invariant.
*/
@Description("This is ranking normation.")
public class SelProbRanking extends AbstractSelProb implements java.io.Serializable {
public class SelectionProbabilityRanking extends AbstractSelectionProbability implements java.io.Serializable {
public SelProbRanking() {
public SelectionProbabilityRanking() {
}
public SelProbRanking(SelProbRanking a) {
public SelectionProbabilityRanking(SelectionProbabilityRanking a) {
}
@Override
public Object clone() {
return new SelProbRanking(this);
return new SelectionProbabilityRanking(this);
}
/**
......
......@@ -9,17 +9,17 @@ import eva2.util.annotation.Description;
* p(i is selected) = exp(-fitness(i))/sum_j(exp(-fitness(j)))
*/
@Description("This is a standard normation method using the exp function.")
public class SelProbStandard extends AbstractSelProb implements java.io.Serializable {
public class SelectionProbabilityStandard extends AbstractSelectionProbability implements java.io.Serializable {
public SelProbStandard() {
public SelectionProbabilityStandard() {
}
public SelProbStandard(SelProbStandard a) {
public SelectionProbabilityStandard(SelectionProbabilityStandard a) {
}
@Override
public Object clone() {
return new SelProbStandard(this);
return new SelectionProbabilityStandard(this);
}
/**
......
......@@ -7,24 +7,24 @@ import eva2.util.annotation.Description;
* A simple sum with a scaling factor.
*/
@Description("This is a standard normation method with scaling.")
public class SelProbStandardScaling extends AbstractSelProb implements java.io.Serializable {
public class SelectionProbabilityStandardScaling extends AbstractSelectionProbability implements java.io.Serializable {
private double Q = 0;
public SelProbStandardScaling() {
public SelectionProbabilityStandardScaling() {
}
public SelProbStandardScaling(double q) {
public SelectionProbabilityStandardScaling(double q) {
Q = q;
}
public SelProbStandardScaling(SelProbStandardScaling a) {
public SelectionProbabilityStandardScaling(SelectionProbabilityStandardScaling a) {
this.Q = a.Q;
}
@Override
public Object clone() {
return new SelProbStandardScaling(this);
return new SelectionProbabilityStandardScaling(this);
}
/**
......
......@@ -7,7 +7,7 @@ import eva2.optimization.operator.distancemetric.EuclideanMetric;
import eva2.optimization.operator.distancemetric.InterfaceDistanceMetric;
import eva2.optimization.operator.distancemetric.PhenotypeMetric;
import eva2.optimization.operator.postprocess.PostProcess;
import eva2.optimization.operator.selection.probability.AbstractSelProb;
import eva2.optimization.operator.selection.probability.AbstractSelectionProbability;
import eva2.tools.EVAERROR;
import eva2.tools.Pair;
import eva2.tools.Serializer;
......@@ -2143,7 +2143,7 @@ public class Population extends ArrayList<AbstractEAIndividual> implements Popul
* @param criterion
* @return
*/
public double[] getCenterWeighted(AbstractSelProb selProb, int criterion, boolean obeyConst) {
public double[] getCenterWeighted(AbstractSelectionProbability selProb, int criterion, boolean obeyConst) {
selProb.computeSelectionProbability(this, "Fitness", obeyConst);
double[] mean = AbstractEAIndividual.getDoublePosition(getEAIndividual(0));
......
Markdown is supported
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