More @Parameters and a fix for empty getters.

This commit is contained in:
Fabian Becker 2014-11-01 18:59:28 +01:00
parent 9efebe8b4b
commit 2a2162c5da
3 changed files with 13 additions and 21 deletions

View File

@ -155,8 +155,14 @@ public final class OptimizationBuilder {
} else {
// The subtree has the name of the class
String className = (String)((ArgumentTree)tree.get(name)).getValue();
// Try to get the actual class from its name
Class subType = getClassFromName(className, type);
Class subType;
if (className != null) {
// Try to get the actual class from its name
subType = getClassFromName(className, type);
} else {
subType = type;
}
// Here the recursion starts
obj = constructFromArgumentTree(subType, (ArgumentTree) tree.get(name));

View File

@ -87,13 +87,11 @@ public abstract class AbstractOptimizationProblem implements InterfaceOptimizati
return parallelThreads;
}
@Parameter(name = "parallel", description = "Set the number of threaded parallel function evaluations - interesting for slow functions and generational optimizers.")
public void setParallelThreads(int parallelThreads) {
this.parallelThreads = parallelThreads;
}
public String parallelThreadsTipText() {
return "Set the number of threaded parallel function evaluations - interesting for slow functions and generational optimizers.";
}
/**
* This method initializes the problem instance.
@ -406,10 +404,6 @@ public abstract class AbstractOptimizationProblem implements InterfaceOptimizati
return template;
}
public String individualTemplateTipText() {
return "Choose the individual representation to use.";
}
/**
* This method extracts the individuals from a given population that are assumed to correspond to local or global optima.
* Similar individuals are clustered together with a density based clustering method

View File

@ -22,6 +22,7 @@ import eva2.tools.diagram.ColorBarCalculator;
import eva2.tools.math.Jama.Matrix;
import eva2.tools.math.Mathematics;
import eva2.tools.math.RNG;
import eva2.util.annotation.Parameter;
/**
* For a double valued problem, there are two main methods to implement:
@ -285,6 +286,7 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
*
* @param noise The sigma for a gaussian random number.
*/
@Parameter(description = "Gaussian noise level on the fitness value.")
public void setNoise(double noise) {
if (noise < 0) {
noise = 0;
@ -301,15 +303,12 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
return this.noise;
}
public String noiseTipText() {
return "Gaussian noise level on the fitness value.";
}
/**
* This method allows you to choose the EA individual used by the problem.
*
* @param indy The EAIndividual type
*/
@Parameter(name = "individual", description = "Base individual type defining the data representation and mutation/crossover operators")
public void setEAIndividual(InterfaceDataTypeDouble indy) {
this.template = (AbstractEAIndividual) indy;
}
@ -324,10 +323,6 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
return (InterfaceDataTypeDouble) this.template;
}
public String EAIndividualTipText() {
return "Set the base individual type defining the data representation and mutation/crossover operators";
}
/**
* A (symmetric) absolute range limit.
*
@ -351,6 +346,7 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
return "Absolute limit for the symmetric range in any dimension";
}
@Parameter(name = "rotate", description = "If marked, the function is rotated by 22.5 degrees along every axis.")
public void setDoRotation(boolean doRotation) {
this.doRotation = doRotation;
if (!doRotation) {
@ -362,10 +358,6 @@ public abstract class AbstractProblemDouble extends AbstractOptimizationProblem
return doRotation;
}
public String doRotationTipText() {
return "If marked, the function is rotated by 22.5 degrees along every axis.";
}
/**
* *******************************************************************************************************************
* These are for InterfaceParamControllable