Cosmetics again. MK rev. 187.
This commit is contained in:
		@@ -457,6 +457,17 @@ public class Plot implements PlotInterface, Serializable {
 | 
			
		||||
		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.
 | 
			
		||||
//	 */
 | 
			
		||||
 
 | 
			
		||||
@@ -870,9 +870,10 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
 | 
			
		||||
    
 | 
			
		||||
	/**
 | 
			
		||||
	 * For any AbstractEAIndividual try to convert its position to double[] and return it.
 | 
			
		||||
	 * Returns null if there is no conversion available.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param indy
 | 
			
		||||
	 * @return double valued position of an individual
 | 
			
		||||
	 * @return double valued position of an individual or null
 | 
			
		||||
	 */
 | 
			
		||||
	public static double[] getDoublePosition(AbstractEAIndividual indy) {
 | 
			
		||||
		if (indy instanceof InterfaceDataTypeDouble) {
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ public class SelProbInvertByMax extends AbstractSelProb {
 | 
			
		||||
			// first check if anyone holds the constraints
 | 
			
		||||
			int k=0;
 | 
			
		||||
			while ((k < population.size()) && !isFeasible) {
 | 
			
		||||
				if (!((AbstractEAIndividual)population.get(k)).violatesConstraint()) isFeasible = true;
 | 
			
		||||
				if (!(population.getEAIndividual(k)).violatesConstraint()) isFeasible = true;
 | 
			
		||||
				k++;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -58,7 +58,8 @@ public class SelProbInvertByMax extends AbstractSelProb {
 | 
			
		||||
				sum = 0;
 | 
			
		||||
				// invert fitness
 | 
			
		||||
				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];
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,10 @@ public class SelProbNonLinearRanking extends AbstractSelProb implements java.io.
 | 
			
		||||
    public SelProbNonLinearRanking() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public SelProbNonLinearRanking(double theC) {
 | 
			
		||||
        this.m_C    = theC;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public SelProbNonLinearRanking(SelProbNonLinearRanking a) {
 | 
			
		||||
        this.m_C    = a.m_C;
 | 
			
		||||
    }
 | 
			
		||||
@@ -178,7 +182,7 @@ public class SelProbNonLinearRanking extends AbstractSelProb implements java.io.
 | 
			
		||||
        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.
 | 
			
		||||
     */
 | 
			
		||||
    public void setC(double x) {
 | 
			
		||||
@@ -190,6 +194,6 @@ public class SelProbNonLinearRanking extends AbstractSelProb implements java.io.
 | 
			
		||||
        return m_C;
 | 
			
		||||
    }
 | 
			
		||||
    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
 | 
			
		||||
            boolean isFeasible = false;
 | 
			
		||||
            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) {
 | 
			
		||||
                // 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]);
 | 
			
		||||
                        else
 | 
			
		||||
                            result[i] = 0;
 | 
			
		||||
                    }
 | 
			
		||||
                    for (int i = 0; i < data.length; i++)
 | 
			
		||||
                        sum += result[i];
 | 
			
		||||
                    }
 | 
			
		||||
                    for (int i = 0; i < population.size(); i++)
 | 
			
		||||
                        ((AbstractEAIndividual)population.get(i)).SetSelectionProbability(x, result[i]/sum);
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user