Cosmetics again. MK rev. 187.
This commit is contained in:
parent
ee67276827
commit
1a11229eff
@ -457,6 +457,17 @@ public class Plot implements PlotInterface, Serializable {
|
|||||||
m_Frame = null;
|
m_Frame = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the corners of the given range as unconnected points.
|
||||||
|
*
|
||||||
|
* @param range
|
||||||
|
* @param graphLabel
|
||||||
|
*/
|
||||||
|
public void setCornerPoints(double[][] range, int graphLabel) {
|
||||||
|
setUnconnectedPoint(range[0][0], range[1][0], graphLabel);
|
||||||
|
setUnconnectedPoint(range[0][1], range[1][1], graphLabel);
|
||||||
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * Just for testing the Plot class.
|
// * Just for testing the Plot class.
|
||||||
// */
|
// */
|
||||||
|
@ -870,9 +870,10 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* For any AbstractEAIndividual try to convert its position to double[] and return it.
|
* For any AbstractEAIndividual try to convert its position to double[] and return it.
|
||||||
|
* Returns null if there is no conversion available.
|
||||||
*
|
*
|
||||||
* @param indy
|
* @param indy
|
||||||
* @return double valued position of an individual
|
* @return double valued position of an individual or null
|
||||||
*/
|
*/
|
||||||
public static double[] getDoublePosition(AbstractEAIndividual indy) {
|
public static double[] getDoublePosition(AbstractEAIndividual indy) {
|
||||||
if (indy instanceof InterfaceDataTypeDouble) {
|
if (indy instanceof InterfaceDataTypeDouble) {
|
||||||
|
@ -47,7 +47,7 @@ public class SelProbInvertByMax extends AbstractSelProb {
|
|||||||
// first check if anyone holds the constraints
|
// first check if anyone holds the constraints
|
||||||
int k=0;
|
int k=0;
|
||||||
while ((k < population.size()) && !isFeasible) {
|
while ((k < population.size()) && !isFeasible) {
|
||||||
if (!((AbstractEAIndividual)population.get(k)).violatesConstraint()) isFeasible = true;
|
if (!(population.getEAIndividual(k)).violatesConstraint()) isFeasible = true;
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,7 +58,8 @@ public class SelProbInvertByMax extends AbstractSelProb {
|
|||||||
sum = 0;
|
sum = 0;
|
||||||
// invert fitness
|
// invert fitness
|
||||||
for (int i = 0; i < data.length; i++) {
|
for (int i = 0; i < data.length; i++) {
|
||||||
result[i] = maxFit - data[i][x];
|
if (population.getEAIndividual(i).violatesConstraint()) result[i]=0;
|
||||||
|
else result[i] = maxFit - data[i][x];
|
||||||
sum += result[i];
|
sum += result[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,10 @@ public class SelProbNonLinearRanking extends AbstractSelProb implements java.io.
|
|||||||
public SelProbNonLinearRanking() {
|
public SelProbNonLinearRanking() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SelProbNonLinearRanking(double theC) {
|
||||||
|
this.m_C = theC;
|
||||||
|
}
|
||||||
|
|
||||||
public SelProbNonLinearRanking(SelProbNonLinearRanking a) {
|
public SelProbNonLinearRanking(SelProbNonLinearRanking a) {
|
||||||
this.m_C = a.m_C;
|
this.m_C = a.m_C;
|
||||||
}
|
}
|
||||||
@ -178,7 +182,7 @@ public class SelProbNonLinearRanking extends AbstractSelProb implements java.io.
|
|||||||
return "Non-Linear Ranking";
|
return "Non-Linear Ranking";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This methods allow you to set and get the nappa.
|
/** This methods allow you to set and get the scaling.
|
||||||
* @param x Long seed.
|
* @param x Long seed.
|
||||||
*/
|
*/
|
||||||
public void setC(double x) {
|
public void setC(double x) {
|
||||||
@ -190,6 +194,6 @@ public class SelProbNonLinearRanking extends AbstractSelProb implements java.io.
|
|||||||
return m_C;
|
return m_C;
|
||||||
}
|
}
|
||||||
public String cTipText() {
|
public String cTipText() {
|
||||||
return "The c should be << 1.";
|
return "The exponential base c is taken to the power of the individual's rank and should be << 1.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -40,7 +40,10 @@ public class SelProbStandard extends AbstractSelProb implements java.io.Serializ
|
|||||||
// first check if anyone holds the constraints
|
// first check if anyone holds the constraints
|
||||||
boolean isFeasible = false;
|
boolean isFeasible = false;
|
||||||
for (int i = 0; i < population.size(); i++) {
|
for (int i = 0; i < population.size(); i++) {
|
||||||
if (!((AbstractEAIndividual)population.get(i)).violatesConstraint()) isFeasible = true;
|
if (!((AbstractEAIndividual)population.get(i)).violatesConstraint()) {
|
||||||
|
isFeasible = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isFeasible) {
|
if (isFeasible) {
|
||||||
// at least one is feasible
|
// at least one is feasible
|
||||||
@ -53,9 +56,8 @@ public class SelProbStandard extends AbstractSelProb implements java.io.Serializ
|
|||||||
result[i] = Math.exp(-data[i][x]);
|
result[i] = Math.exp(-data[i][x]);
|
||||||
else
|
else
|
||||||
result[i] = 0;
|
result[i] = 0;
|
||||||
}
|
|
||||||
for (int i = 0; i < data.length; i++)
|
|
||||||
sum += result[i];
|
sum += result[i];
|
||||||
|
}
|
||||||
for (int i = 0; i < population.size(); i++)
|
for (int i = 0; i < population.size(); i++)
|
||||||
((AbstractEAIndividual)population.get(i)).SetSelectionProbability(x, result[i]/sum);
|
((AbstractEAIndividual)population.get(i)).SetSelectionProbability(x, result[i]/sum);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user