Version 2.027, renamed set methods in individual interfaces to help avoid misinterpretations.

This commit is contained in:
Marcel Kronfeld 2008-07-10 09:06:07 +00:00
parent 7697d00bf7
commit 982caa7f4c
31 changed files with 110 additions and 108 deletions

View File

@ -4,8 +4,8 @@ package eva2;
* Main product and version information strings. * Main product and version information strings.
* *
* --- Changelog * --- Changelog
* * 2.027: Renamed SetData and SetDataLamarckian from individual datatype interfaces to SetGenotype and SetPhenotype.
* Repaired the GenericArrayEditor. * Repaired the GenericArrayEditor. Population measures can now be plottet in stats.
* 2.026: Added DiversityTerminator and KnownOptimaTerminator, slightly changed InterfaceTerminator for these * 2.026: Added DiversityTerminator and KnownOptimaTerminator, slightly changed InterfaceTerminator for these
* and InterfaceStatistics to provide termination message to text window. * and InterfaceStatistics to provide termination message to text window.
* Killed redundant method getGenerations() in Population. Population.getAllSolutions now returns a * Killed redundant method getGenerations() in Population. Population.getAllSolutions now returns a
@ -25,7 +25,7 @@ package eva2;
public class EvAInfo { public class EvAInfo {
public static final String productName = "EvA 2"; public static final String productName = "EvA 2";
public static final String productLongName = "Evolutionary Algorithms Workbench 2"; public static final String productLongName = "Evolutionary Algorithms Workbench 2";
public static final String versionNum = new String ("2.026"); public static final String versionNum = new String ("2.027");
public static final String url = "http://www.ra.cs.uni-tuebingen.de/software/EvA2"; public static final String url = "http://www.ra.cs.uni-tuebingen.de/software/EvA2";
public static final String propertyFile = "resources/EvA2.props"; public static final String propertyFile = "resources/EvA2.props";

View File

@ -129,7 +129,6 @@ public class GraphPointSet {
case 8: c = Color.orange; break; case 8: c = Color.orange; break;
case 9: c = Color.darkGray; break; case 9: c = Color.darkGray; break;
} }
System.out.println("Selected " + c.toString() + " for " + k);
return c; return c;
} }
/** /**

View File

@ -147,15 +147,15 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to set the binary data. /** This method allows you to set the binary data.
* @param binaryData The new binary data. * @param binaryData The new binary data.
*/ */
public void SetBinaryData(BitSet binaryData) { public void SetBinaryPhenotype(BitSet binaryData) {
this.m_Phenotype = binaryData; this.m_Phenotype = binaryData;
} }
/** This method allows you to set the binary data, this can be used for /** This method allows you to set the binary data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param binaryData The new binary data. * @param binaryData The new binary data.
*/ */
public void SetBinaryDataLamarckian(BitSet binaryData) { public void SetBinaryGenotype(BitSet binaryData) {
this.SetBinaryData(binaryData); this.SetBinaryPhenotype(binaryData);
for (int i = 0; i < this.m_Genotype.length; i++) { for (int i = 0; i < this.m_Genotype.length; i++) {
if (this.m_UseHardSwitch) { if (this.m_UseHardSwitch) {
if (binaryData.get(i)) this.m_Genotype[i] = RNG.randomDouble(0.55,1.0); if (binaryData.get(i)) this.m_Genotype[i] = RNG.randomDouble(0.55,1.0);
@ -187,7 +187,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
public void initByValue(Object obj, InterfaceOptimizationProblem opt) { public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof BitSet) { if (obj instanceof BitSet) {
BitSet bs = (BitSet) obj; BitSet bs = (BitSet) obj;
this.SetBinaryDataLamarckian(bs); this.SetBinaryGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for ESIndividualBinaryData is no BitSet!"); System.out.println("Initial value for ESIndividualBinaryData is no BitSet!");

View File

@ -174,7 +174,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* use SetDoubleDataLamarckian(). * use SetDoubleDataLamarckian().
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleData(double[] doubleData) { public void SetDoublePhenotype(double[] doubleData) {
this.m_Phenotype = doubleData; this.m_Phenotype = doubleData;
} }
@ -182,8 +182,8 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* memetic algorithms. * memetic algorithms.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleDataLamarckian(double[] doubleData) { public void SetDoubleGenotype(double[] doubleData) {
this.SetDoubleData(doubleData); this.SetDoublePhenotype(doubleData);
this.m_Genotype = new double[doubleData.length]; this.m_Genotype = new double[doubleData.length];
System.arraycopy(doubleData, 0, this.m_Genotype, 0, doubleData.length); System.arraycopy(doubleData, 0, this.m_Genotype, 0, doubleData.length);
} }
@ -209,7 +209,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
if (obj instanceof double[]) { if (obj instanceof double[]) {
double[] bs = (double[]) obj; double[] bs = (double[]) obj;
if (bs.length != this.m_Genotype.length) System.out.println("Init value and requested length doesn't match!"); if (bs.length != this.m_Genotype.length) System.out.println("Init value and requested length doesn't match!");
this.SetDoubleDataLamarckian(bs); this.SetDoubleGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for ESIndividualDoubleData is not double[]!"); System.out.println("Initial value for ESIndividualDoubleData is not double[]!");

View File

@ -169,7 +169,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to set the int data. /** This method allows you to set the int data.
* @param intData The new int data. * @param intData The new int data.
*/ */
public void SetIntegerData(int[] intData) { public void SetIntPhenotype(int[] intData) {
this.m_Phenotype = intData; this.m_Phenotype = intData;
} }
@ -177,8 +177,11 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* memetic algorithms. * memetic algorithms.
* @param intData The new int data. * @param intData The new int data.
*/ */
public void SetIntegerDataLamarckian(int[] intData) { public void SetIntGenotype(int[] intData) {
this.SetIntegerData(intData); for (int i = 0; i < this.m_Genotype.length; i++) {
m_Genotype[i]=(double)intData[i];
}
getIntegerData();
} }
/************************************************************************************ /************************************************************************************
@ -202,7 +205,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
if (obj instanceof int[]) { if (obj instanceof int[]) {
int[] bs = (int[]) obj; int[] bs = (int[]) obj;
if (bs.length != this.m_Genotype.length) System.out.println("Init value and requested length doesn't match!"); if (bs.length != this.m_Genotype.length) System.out.println("Init value and requested length doesn't match!");
this.SetIntegerDataLamarckian(bs); this.SetIntGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for ESIndividualIntegerData is not int[]!"); System.out.println("Initial value for ESIndividualIntegerData is not int[]!");

View File

@ -133,7 +133,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
return res; return res;
} }
public void SetPermutationData(int[][] perm){ public void SetPermutationPhenotype(int[][] perm){
this.m_Phenotype = perm; this.m_Phenotype = perm;
this.m_Range = new double[perm.length][][]; this.m_Range = new double[perm.length][][];
for (int i = 0; i < perm.length; i++) { for (int i = 0; i < perm.length; i++) {
@ -146,8 +146,8 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
} }
public void SetPermutationDataLamarckian(int[][] perm){ public void SetPermutationGenotype(int[][] perm){
this.SetPermutationData(perm); this.SetPermutationPhenotype(perm);
this.m_Genotype = new double[perm.length][]; this.m_Genotype = new double[perm.length][];
this.m_Range = new double[perm.length][][]; this.m_Range = new double[perm.length][][];
@ -231,7 +231,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
if (obj instanceof int[][]) { if (obj instanceof int[][]) {
int[][] bs = (int[][]) obj; int[][] bs = (int[][]) obj;
if (bs.length != this.m_Genotype.length) System.out.println("Init value and requested length doesn't match!"); if (bs.length != this.m_Genotype.length) System.out.println("Init value and requested length doesn't match!");
this.SetPermutationDataLamarckian(bs); this.SetPermutationGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for ESIndividualPermutationData is not int[]!"); System.out.println("Initial value for ESIndividualPermutationData is not int[]!");

View File

@ -222,8 +222,8 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param doubleData The new double data. * @param doubleData The new double data.
* @see InterfaceDataTypeDouble.SetDoubleData() * @see InterfaceDataTypeDouble.SetDoubleData()
*/ */
public void SetDoubleData(double[] doubleData) { public void SetDoublePhenotype(double[] doubleData) {
this.m_Numbers.SetDoubleData(doubleData); this.m_Numbers.SetDoublePhenotype(doubleData);
} }
/** This method allows you to set the double data, this can be used for /** This method allows you to set the double data, this can be used for
@ -231,8 +231,8 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param doubleData The new double data. * @param doubleData The new double data.
* @see InterfaceDataTypeDouble.SetDoubleDataLamarckian() * @see InterfaceDataTypeDouble.SetDoubleDataLamarckian()
*/ */
public void SetDoubleDataLamarckian(double[] doubleData) { public void SetDoubleGenotype(double[] doubleData) {
this.m_Numbers.SetDoubleDataLamarckian(doubleData); this.m_Numbers.SetDoubleGenotype(doubleData);
} }
/********************************************************************************************************************** /**********************************************************************************************************************
@ -272,8 +272,8 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param binaryData The new binary data. * @param binaryData The new binary data.
* @see InterfaceDataTypeBinary.SetBinaryData() * @see InterfaceDataTypeBinary.SetBinaryData()
*/ */
public void SetBinaryData(BitSet binaryData) { public void SetBinaryPhenotype(BitSet binaryData) {
this.m_BitSet.SetBinaryData(binaryData); this.m_BitSet.SetBinaryPhenotype(binaryData);
} }
/** This method allows you to set the binary data, this can be used for /** This method allows you to set the binary data, this can be used for
@ -281,8 +281,8 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param binaryData The new binary data. * @param binaryData The new binary data.
* @see InterfaceBinaryData.SetBinaryDataLamarckian() * @see InterfaceBinaryData.SetBinaryDataLamarckian()
*/ */
public void SetBinaryDataLamarckian(BitSet binaryData) { public void SetBinaryGenotype(BitSet binaryData) {
this.m_BitSet.SetBinaryDataLamarckian(binaryData); this.m_BitSet.SetBinaryGenotype(binaryData);
} }
/********************************************************************************************************************** /**********************************************************************************************************************

View File

@ -112,7 +112,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
public void initByValue(Object obj, InterfaceOptimizationProblem opt) { public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof BitSet) { if (obj instanceof BitSet) {
BitSet bs = (BitSet) obj; BitSet bs = (BitSet) obj;
this.SetBinaryDataLamarckian(bs); this.SetBinaryGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for GAIndividualBinaryData is no BitSet!"); System.out.println("Initial value for GAIndividualBinaryData is no BitSet!");
@ -234,7 +234,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to set the binary data. /** This method allows you to set the binary data.
* @param binaryData The new binary data. * @param binaryData The new binary data.
*/ */
public void SetBinaryData(BitSet binaryData) { public void SetBinaryPhenotype(BitSet binaryData) {
this.m_Phenotype = binaryData; this.m_Phenotype = binaryData;
} }
@ -242,8 +242,8 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* memetic algorithms. * memetic algorithms.
* @param binaryData The new binary data. * @param binaryData The new binary data.
*/ */
public void SetBinaryDataLamarckian(BitSet binaryData) { public void SetBinaryGenotype(BitSet binaryData) {
this.SetBinaryData(binaryData); this.SetBinaryPhenotype(binaryData);
this.m_Genotype =(BitSet)binaryData.clone(); this.m_Genotype =(BitSet)binaryData.clone();
} }

View File

@ -189,7 +189,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* use SetDoubleDataLamarckian. * use SetDoubleDataLamarckian.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleData(double[] doubleData) { public void SetDoublePhenotype(double[] doubleData) {
this.m_Phenotype = doubleData; this.m_Phenotype = doubleData;
} }
@ -197,8 +197,8 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* memetic algorithms. * memetic algorithms.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleDataLamarckian(double[] doubleData) { public void SetDoubleGenotype(double[] doubleData) {
this.SetDoubleData(doubleData); this.SetDoublePhenotype(doubleData);
int[] locus = new int[2]; int[] locus = new int[2];
for (int i = 0; i < doubleData.length; i++) { for (int i = 0; i < doubleData.length; i++) {
locus[0] = i * this.m_Precision; locus[0] = i * this.m_Precision;
@ -228,7 +228,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
if (obj instanceof double[]) { if (obj instanceof double[]) {
double[] bs = (double[]) obj; double[] bs = (double[]) obj;
if (bs.length != this.m_Range.length) System.out.println("Init value and requested length doesn't match!"); if (bs.length != this.m_Range.length) System.out.println("Init value and requested length doesn't match!");
this.SetDoubleDataLamarckian(bs); this.SetDoubleGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for GAIndividualDoubleData is not double[]!"); System.out.println("Initial value for GAIndividualDoubleData is not double[]!");

View File

@ -186,7 +186,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to set the double data. /** This method allows you to set the double data.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetIntegerData(int[] doubleData) { public void SetIntPhenotype(int[] doubleData) {
this.m_Phenotype = doubleData; this.m_Phenotype = doubleData;
} }
@ -194,8 +194,8 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* memetic algorithms. * memetic algorithms.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetIntegerDataLamarckian(int[] doubleData) { public void SetIntGenotype(int[] doubleData) {
this.SetIntegerData(doubleData); this.SetIntPhenotype(doubleData);
if (doubleData != null) { if (doubleData != null) {
int[] locus = new int[2]; int[] locus = new int[2];
locus[0] = 0; locus[0] = 0;
@ -229,7 +229,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
if (obj instanceof int[]) { if (obj instanceof int[]) {
int[] bs = (int[]) obj; int[] bs = (int[]) obj;
if (bs.length != this.m_Range.length) System.out.println("Init value and requested length doesn't match!"); if (bs.length != this.m_Range.length) System.out.println("Init value and requested length doesn't match!");
this.SetIntegerDataLamarckian(bs); this.SetIntGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for GAIndividualDoubleData is not double[]!"); System.out.println("Initial value for GAIndividualDoubleData is not double[]!");
@ -354,7 +354,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
tmp += data[i] + "; "; tmp += data[i] + "; ";
} }
System.out.println(tmp+"}"); System.out.println(tmp+"}");
indy.SetIntegerDataLamarckian(data); indy.SetIntGenotype(data);
System.out.println(""+indy.getStringRepresentation()); System.out.println(""+indy.getStringRepresentation());
data = indy.getIntegerData(); data = indy.getIntegerData();
tmp = "After {"; tmp = "After {";

View File

@ -214,16 +214,16 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* SetDoubleDataLamarckian(). * SetDoubleDataLamarckian().
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleData(double[] doubleData) { public void SetDoublePhenotype(double[] doubleData) {
this.m_Numbers.SetDoubleData(doubleData); this.m_Numbers.SetDoublePhenotype(doubleData);
} }
/** This method allows you to set the genotype data, this can be used for /** This method allows you to set the genotype data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleDataLamarckian(double[] doubleData) { public void SetDoubleGenotype(double[] doubleData) {
this.m_Numbers.SetDoubleDataLamarckian(doubleData); this.m_Numbers.SetDoubleGenotype(doubleData);
} }
/************************************************************************************ /************************************************************************************
@ -254,15 +254,15 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to set the program. /** This method allows you to set the program.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramData(InterfaceProgram[] program) { public void SetProgramPhenotype(InterfaceProgram[] program) {
this.m_Program.SetProgramData(program); this.m_Program.SetProgramPhenotype(program);
} }
/** This method allows you to set the program. /** This method allows you to set the program.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramDataLamarckian(InterfaceProgram[] program) { public void SetProgramGenotype(InterfaceProgram[] program) {
this.m_Program.SetProgramDataLamarckian(program); this.m_Program.SetProgramGenotype(program);
} }
/** This method allows you to set the function area /** This method allows you to set the function area

View File

@ -460,7 +460,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the program phenotype. /** This method allows you to set the program phenotype.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramData(InterfaceProgram[] program) { public void SetProgramPhenotype(InterfaceProgram[] program) {
if (program instanceof AbstractGPNode[]) { if (program instanceof AbstractGPNode[]) {
this.m_Phenotype = new AbstractGPNode[program.length]; this.m_Phenotype = new AbstractGPNode[program.length];
for (int t = 0; t < program.length; t++) { for (int t = 0; t < program.length; t++) {
@ -473,8 +473,8 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* Warning - this is not implemented, it only sets the phenotype using SetProgramData. * Warning - this is not implemented, it only sets the phenotype using SetProgramData.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramDataLamarckian(InterfaceProgram[] program) { public void SetProgramGenotype(InterfaceProgram[] program) {
this.SetProgramData(program); this.SetProgramPhenotype(program);
if (program instanceof AbstractGPNode[]) System.err.println("Warning setProgram() for GEIndividualProgramData not implemented!"); if (program instanceof AbstractGPNode[]) System.err.println("Warning setProgram() for GEIndividualProgramData not implemented!");
} }
@ -517,7 +517,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
*/ */
public void initByValue(Object obj, InterfaceOptimizationProblem opt) { public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof InterfaceProgram) { if (obj instanceof InterfaceProgram) {
this.SetProgramDataLamarckian((InterfaceProgram[])obj); this.SetProgramGenotype((InterfaceProgram[])obj);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!"); System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!");

View File

@ -170,7 +170,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to set the double data. /** This method allows you to set the double data.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetIntegerData(int[] doubleData) { public void SetIntPhenotype(int[] doubleData) {
this.m_Phenotype = doubleData; this.m_Phenotype = doubleData;
} }
@ -178,8 +178,8 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* memetic algorithms. * memetic algorithms.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetIntegerDataLamarckian(int[] doubleData) { public void SetIntGenotype(int[] doubleData) {
this.SetIntegerData(doubleData); this.SetIntPhenotype(doubleData);
this.m_Genotype = new int[this.m_Range.length]; this.m_Genotype = new int[this.m_Range.length];
for (int i = 0; i < doubleData.length; i++) { for (int i = 0; i < doubleData.length; i++) {
this.m_Genotype[i] = doubleData[i]; this.m_Genotype[i] = doubleData[i];
@ -207,7 +207,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
if (obj instanceof int[]) { if (obj instanceof int[]) {
int[] bs = (int[]) obj; int[] bs = (int[]) obj;
if (bs.length != this.m_Range.length) System.out.println("Init value and requested length doesn't match!"); if (bs.length != this.m_Range.length) System.out.println("Init value and requested length doesn't match!");
this.SetIntegerDataLamarckian(bs); this.SetIntGenotype(bs);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for GAIndividualDoubleData is not double[]!"); System.out.println("Initial value for GAIndividualDoubleData is not double[]!");

View File

@ -220,16 +220,16 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method allows you to set the int data. /** This method allows you to set the int data.
* @param intData The new int data. * @param intData The new int data.
*/ */
public void SetIntegerData(int[] intData) { public void SetIntPhenotype(int[] intData) {
this.m_Integer.SetIntegerData(intData); this.m_Integer.SetIntPhenotype(intData);
} }
/** This method allows you to set the int data, this can be used for /** This method allows you to set the int data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param intData The new int data. * @param intData The new int data.
*/ */
public void SetIntegerDataLamarckian(int[] intData) { public void SetIntGenotype(int[] intData) {
this.m_Integer.SetIntegerDataLamarckian(intData); this.m_Integer.SetIntGenotype(intData);
} }
/********************************************************************************************************************** /**********************************************************************************************************************
@ -268,16 +268,16 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method allows you to set the permutation. /** This method allows you to set the permutation.
* @param perm The new permutation data. * @param perm The new permutation data.
*/ */
public void SetPermutationData(int[][] perm) { public void SetPermutationPhenotype(int[][] perm) {
this.SetPermutationData(perm); this.SetPermutationPhenotype(perm);
} }
/** This method allows you to set the permutation data, this can be used for /** This method allows you to set the permutation data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param perm The new permutation data. * @param perm The new permutation data.
*/ */
public void SetPermutationDataLamarckian(int[][] perm) { public void SetPermutationGenotype(int[][] perm) {
this.SetPermutationDataLamarckian(perm); this.SetPermutationGenotype(perm);
} }
public void setFirstindex(int[] firstindex) { public void setFirstindex(int[] firstindex) {

View File

@ -155,7 +155,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the program phenotype. /** This method allows you to set the program phenotype.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramData(InterfaceProgram[] program) { public void SetProgramPhenotype(InterfaceProgram[] program) {
if (program instanceof AbstractGPNode[]) { if (program instanceof AbstractGPNode[]) {
this.m_Phenotype = new AbstractGPNode[program.length]; this.m_Phenotype = new AbstractGPNode[program.length];
for (int i = 0; i < this.m_Phenotype.length; i++) for (int i = 0; i < this.m_Phenotype.length; i++)
@ -166,8 +166,8 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the program genotype. /** This method allows you to set the program genotype.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramDataLamarckian(InterfaceProgram[] program) { public void SetProgramGenotype(InterfaceProgram[] program) {
this.SetProgramData(program); this.SetProgramPhenotype(program);
if (program instanceof AbstractGPNode[]) { if (program instanceof AbstractGPNode[]) {
this.m_Genotype = new AbstractGPNode[program.length]; this.m_Genotype = new AbstractGPNode[program.length];
for (int i = 0; i < this.m_Genotype.length; i++) for (int i = 0; i < this.m_Genotype.length; i++)
@ -210,7 +210,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
*/ */
public void initByValue(Object obj, InterfaceOptimizationProblem opt) { public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof InterfaceProgram[]) { if (obj instanceof InterfaceProgram[]) {
this.SetProgramDataLamarckian((InterfaceProgram[])obj); this.SetProgramGenotype((InterfaceProgram[])obj);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!"); System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!");

View File

@ -16,7 +16,7 @@ public interface InterfaceDataTypeBinary {
/** This method allows you to request a certain amount of binary data /** This method allows you to request a certain amount of binary data
* @param length The lenght of the BitSet that is to be optimized * @param length The lenght of the BitSet that is to be optimized
*/ */
public void setBinaryDataLength (int length); public void setBinaryDataLength(int length);
/** This method returns the length of the binary data set /** This method returns the length of the binary data set
* @return The number of bits stored * @return The number of bits stored
@ -37,11 +37,11 @@ public interface InterfaceDataTypeBinary {
/** This method allows you to set the binary data. /** This method allows you to set the binary data.
* @param binaryData The new binary data. * @param binaryData The new binary data.
*/ */
public void SetBinaryData(BitSet binaryData); public void SetBinaryPhenotype(BitSet binaryData);
/** This method allows you to set the binary data, this can be used for /** This method allows you to set the binary data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param binaryData The new binary data. * @param binaryData The new binary data.
*/ */
public void SetBinaryDataLamarckian(BitSet binaryData); public void SetBinaryGenotype(BitSet binaryData);
} }

View File

@ -14,7 +14,7 @@ public interface InterfaceDataTypeDouble {
/** This method allows you to request a certain amount of double data /** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized * @param length The lenght of the double[] that is to be optimized
*/ */
public void setDoubleDataLength (int length); public void setDoubleDataLength(int length);
/** This method returns the length of the double data set /** This method returns the length of the double data set
* @return The number of doubles stored * @return The number of doubles stored
@ -48,11 +48,11 @@ public interface InterfaceDataTypeDouble {
* SetDoubleDataLamarckian to set the genotype data. * SetDoubleDataLamarckian to set the genotype data.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleData(double[] doubleData); public void SetDoublePhenotype(double[] doubleData);
/** This method allows you to set the double data, this can be used for /** This method allows you to set the double data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param doubleData The new double data. * @param doubleData The new double data.
*/ */
public void SetDoubleDataLamarckian(double[] doubleData); public void SetDoubleGenotype(double[] doubleData);
} }

View File

@ -47,11 +47,11 @@ public interface InterfaceDataTypeInteger {
/** This method allows you to set the int data. /** This method allows you to set the int data.
* @param intData The new int data. * @param intData The new int data.
*/ */
public void SetIntegerData(int[] intData); public void SetIntPhenotype(int[] intData);
/** This method allows you to set the int data, this can be used for /** This method allows you to set the int data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param intData The new int data. * @param intData The new int data.
*/ */
public void SetIntegerDataLamarckian(int[] intData); public void SetIntGenotype(int[] intData);
} }

View File

@ -48,13 +48,13 @@ public interface InterfaceDataTypePermutation {
/** This method allows you to set the permutation. /** This method allows you to set the permutation.
* @param perm The new permutation data. * @param perm The new permutation data.
*/ */
void SetPermutationData(int[][] perm); void SetPermutationPhenotype(int[][] perm);
/** This method allows you to set the permutation data, this can be used for /** This method allows you to set the permutation data, this can be used for
* memetic algorithms. * memetic algorithms.
* @param perm The new permutation data. * @param perm The new permutation data.
*/ */
void SetPermutationDataLamarckian(int[][] perm); void SetPermutationGenotype(int[][] perm);
public void setFirstindex(int[] firstindex); public void setFirstindex(int[] firstindex);
} }

View File

@ -32,12 +32,12 @@ public interface InterfaceDataTypeProgram {
/** This method allows you to set the program. /** This method allows you to set the program.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramData(InterfaceProgram[] program); public void SetProgramPhenotype(InterfaceProgram[] program);
/** This method allows you to set the program. /** This method allows you to set the program.
* @param program The new program. * @param program The new program.
*/ */
public void SetProgramDataLamarckian(InterfaceProgram[] program); public void SetProgramGenotype(InterfaceProgram[] program);
/** This method allows you to set the function area /** This method allows you to set the function area
* @param area The area contains functions and terminals * @param area The area contains functions and terminals

View File

@ -104,7 +104,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
*/ */
public void initByValue(Object obj, InterfaceOptimizationProblem opt) { public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof int[]) { if (obj instanceof int[]) {
this.SetPermutationDataLamarckian((int[][]) obj); this.SetPermutationGenotype((int[][]) obj);
} else { } else {
this.defaultInit(); this.defaultInit();
System.out.println("Initial value for OBGAIndividualBinaryData is no Permutation!"); System.out.println("Initial value for OBGAIndividualBinaryData is no Permutation!");
@ -177,7 +177,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
perm[p2] = temp; perm[p2] = temp;
} }
this.SetPermutationDataLamarckian(permmatrix); this.SetPermutationGenotype(permmatrix);
} }
/*generates a random permutation */ /*generates a random permutation */
@ -196,7 +196,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
i++; i++;
} }
} }
this.SetPermutationDataLamarckian(perm); this.SetPermutationGenotype(perm);
// System.out.println(getStringRepresentation()); // System.out.println(getStringRepresentation());
} }
@ -223,12 +223,12 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
return res; return res;
} }
public void SetPermutationData(int[][] perm){ public void SetPermutationPhenotype(int[][] perm){
this.m_Phenotype = perm; this.m_Phenotype = perm;
} }
public void SetPermutationDataLamarckian(int[][] perm){ public void SetPermutationGenotype(int[][] perm){
this.SetPermutationData(perm); this.SetPermutationPhenotype(perm);
this.m_Genotype = new int[perm.length][]; this.m_Genotype = new int[perm.length][];
for (int i = 0; i < perm.length; i++) { for (int i = 0; i < perm.length; i++) {
this.m_Genotype[i] = new int[perm[i].length]; this.m_Genotype[i] = new int[perm[i].length];

View File

@ -317,7 +317,7 @@ public class ClusteringXMeans implements InterfaceClustering, java.io.Serializab
x[0] = 10; x[0] = 10;
x[1] = 10; x[1] = 10;
} }
((InterfaceDataTypeDouble)pop.get(i)).SetDoubleDataLamarckian(x); ((InterfaceDataTypeDouble)pop.get(i)).SetDoubleGenotype(x);
} }
} else { } else {
f1.initPopulation(pop); f1.initPopulation(pop);

View File

@ -98,7 +98,7 @@ public abstract class AbstractDynTransProblem extends AbstractSynchronousOptimiz
/* individuum moves towords untranslated problem */ /* individuum moves towords untranslated problem */
indyData[i] -= getTranslation(i, time); indyData[i] -= getTranslation(i, time);
} }
((InterfaceDataTypeDouble)individual).SetDoubleDataLamarckian(indyData); ((InterfaceDataTypeDouble)individual).SetDoubleGenotype(indyData);
} }
/* /*

View File

@ -175,7 +175,7 @@ public abstract class AbstractMultiModalProblemKnown extends AbstractProblemDoub
protected void addOptimum(double[] point) { protected void addOptimum(double[] point) {
InterfaceDataTypeDouble tmpIndy; InterfaceDataTypeDouble tmpIndy;
tmpIndy = (InterfaceDataTypeDouble)((AbstractEAIndividual)this.m_Template).clone(); tmpIndy = (InterfaceDataTypeDouble)((AbstractEAIndividual)this.m_Template).clone();
tmpIndy.SetDoubleDataLamarckian(point); tmpIndy.SetDoubleGenotype(point);
((AbstractEAIndividual)tmpIndy).SetFitness(evalUnnormalized(point)); ((AbstractEAIndividual)tmpIndy).SetFitness(evalUnnormalized(point));
if (((AbstractEAIndividual)tmpIndy).getFitness(0)>=m_GlobalOpt) { if (((AbstractEAIndividual)tmpIndy).getFitness(0)>=m_GlobalOpt) {
m_GlobalOpt = ((AbstractEAIndividual)tmpIndy).getFitness(0); m_GlobalOpt = ((AbstractEAIndividual)tmpIndy).getFitness(0);

View File

@ -166,7 +166,7 @@ public class BKnapsackProblem extends AbstractProblemBinary implements java.io.S
while (eval(tmpSet)[1] > 0) { while (eval(tmpSet)[1] > 0) {
tmpSet.set(RNG.randomInt(0,items.length-1)); tmpSet.set(RNG.randomInt(0,items.length-1));
} }
((InterfaceDataTypeBinary)indy).SetBinaryDataLamarckian(tmpSet); ((InterfaceDataTypeBinary)indy).SetBinaryGenotype(tmpSet);
} }
} }
@ -234,7 +234,7 @@ public class BKnapsackProblem extends AbstractProblemBinary implements java.io.S
} }
if (this.m_Lamarckism) { if (this.m_Lamarckism) {
((InterfaceDataTypeBinary) individual).SetBinaryDataLamarckian(tmpBitSet); ((InterfaceDataTypeBinary) individual).SetBinaryGenotype(tmpBitSet);
} }
} }
result[0] += 5100; result[0] += 5100;

View File

@ -156,7 +156,7 @@ public class DynamicParticleSwarmOptimization extends ParticleSwarmOptimization
} }
} }
if (indy instanceof InterfaceDataTypeDouble) ((InterfaceDataTypeDouble)indy).SetDoubleDataLamarckian(newPos); if (indy instanceof InterfaceDataTypeDouble) ((InterfaceDataTypeDouble)indy).SetDoubleGenotype(newPos);
else endy.SetDGenotype(newPos); else endy.SetDGenotype(newPos);
resetFitness(indy); resetFitness(indy);

View File

@ -183,7 +183,7 @@ public class GradientDescentAlgorithm implements InterfaceOptimizer, java.io.Ser
} }
((InterfaceDataTypeDouble) indy).SetDoubleDataLamarckian(params); ((InterfaceDataTypeDouble) indy).SetDoubleGenotype(params);
} }
} }
@ -196,7 +196,7 @@ public class GradientDescentAlgorithm implements InterfaceOptimizer, java.io.Ser
Hashtable history = (Hashtable) indyhash.get(indy); Hashtable history = (Hashtable) indyhash.get(indy);
if (indy.getFitness()[0] > recoverythreshold) { if (indy.getFitness()[0] > recoverythreshold) {
System.out.println("Gradient Descent: Fitness critical:" + indy.getFitness()[0]); System.out.println("Gradient Descent: Fitness critical:" + indy.getFitness()[0]);
((InterfaceDataTypeDouble) indy).SetDoubleData((double[]) history.get("params")); ((InterfaceDataTypeDouble) indy).SetDoublePhenotype((double[]) history.get("params"));
double[] changes = (double[]) history.get("changes"); double[] changes = (double[]) history.get("changes");
int[] lock = (int[]) history.get("lock"); int[] lock = (int[]) history.get("lock");

View File

@ -1132,7 +1132,7 @@ public class ParticleSwarmOptimization implements InterfaceOptimizer, java.io.Se
} }
// finally set the new position and the current velocity // finally set the new position and the current velocity
if (indy instanceof InterfaceDataTypeDouble) ((InterfaceDataTypeDouble)indy).SetDoubleDataLamarckian(newPosition); if (indy instanceof InterfaceDataTypeDouble) ((InterfaceDataTypeDouble)indy).SetDoubleGenotype(newPosition);
else { else {
((InterfaceESIndividual) indy).SetDGenotype(newPosition); // WARNING, this does a checkBounds in any case! ((InterfaceESIndividual) indy).SetDGenotype(newPosition); // WARNING, this does a checkBounds in any case!
if (!m_CheckConstraints) System.err.println("warning, checkbounds will be forced by InterfaceESIndividual!"); if (!m_CheckConstraints) System.err.println("warning, checkbounds will be forced by InterfaceESIndividual!");

View File

@ -250,7 +250,7 @@ public class Tribes implements InterfaceOptimizer, java.io.Serializable {
if (bestMemPos.firstIsBetter(bestMemPos.getFitness(), bestExp.getFitness())) { if (bestMemPos.firstIsBetter(bestMemPos.getFitness(), bestExp.getFitness())) {
AbstractEAIndividual indy = (AbstractEAIndividual)bestExp.clone(); AbstractEAIndividual indy = (AbstractEAIndividual)bestExp.clone();
indy.SetFitness(bestMemPos.getFitness()); indy.SetFitness(bestMemPos.getFitness());
((InterfaceDataTypeDouble)indy).SetDoubleDataLamarckian(bestMemPos.getPos()); ((InterfaceDataTypeDouble)indy).SetDoubleGenotype(bestMemPos.getPos());
return indy; return indy;
} else return bestExp; } else return bestExp;
} }
@ -684,7 +684,7 @@ public class Tribes implements InterfaceOptimizer, java.io.Serializable {
if (tmp == null) System.err.println("Error in Tribes::positionToExplorer!"); if (tmp == null) System.err.println("Error in Tribes::positionToExplorer!");
TribesExplorer indy = tmp.clone(); TribesExplorer indy = tmp.clone();
indy.clearPosVel(); indy.clearPosVel();
indy.SetDoubleDataLamarckian(pos.getPos()); indy.SetDoubleGenotype(pos.getPos());
indy.SetFitness(pos.getFitness()); indy.SetFitness(pos.getFitness());
return indy; return indy;
} }

View File

@ -961,7 +961,7 @@ v[d] = cmin * v[d];
if (obj instanceof double[]) { if (obj instanceof double[]) {
double[] x = (double[]) obj; double[] x = (double[]) obj;
if (x.length != position.x.length) System.err.println("Init value and requested length doesn't match!"); if (x.length != position.x.length) System.err.println("Init value and requested length doesn't match!");
this.SetDoubleDataLamarckian(x); this.SetDoubleGenotype(x);
} else { } else {
this.init(opt); this.init(opt);
System.err.println("Initial value for ESIndividualDoubleData is not double[]!"); System.err.println("Initial value for ESIndividualDoubleData is not double[]!");
@ -979,11 +979,11 @@ v[d] = cmin * v[d];
System.err.println("TRIBES: mutation is not available!"); System.err.println("TRIBES: mutation is not available!");
} }
public void SetDoubleData(double[] doubleData) { public void SetDoublePhenotype(double[] doubleData) {
position.setDoubleArray(doubleData); position.setDoubleArray(doubleData);
} }
public void SetDoubleDataLamarckian(double[] doubleData) { public void SetDoubleGenotype(double[] doubleData) {
position.setDoubleArray(doubleData); position.setDoubleArray(doubleData);
} }

View File

@ -261,15 +261,15 @@ public class StatsParameter implements InterfaceStatisticsParameter, Serializabl
* *
*/ */
public String plotDataTipText() { public String plotDataTipText() {
return "The data to be plotted."; return "The data to be plotted: best fitness, worst fitness or average/max distance in population.";
} }
/** // /**
* // *
*/ // */
public String plotObjectivesTipText() { // public String plotObjectivesTipText() {
return "The individual of which the objectives are plotted."; // return "The individual of which the objectives are plotted.";
} // }
/** /**