From d676e78f61b30eff14ba92019037a295f46f6ac0 Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Sat, 1 Nov 2014 17:57:56 +0100 Subject: [PATCH] Few more @Parameter annotations where useful. --- .../distancemetric/InterfaceDistanceMetric.java | 5 ----- src/eva2/optimization/population/Population.java | 16 ++++------------ 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java b/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java index 7f8890d0..4f9e306f 100644 --- a/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java +++ b/src/eva2/optimization/operator/distancemetric/InterfaceDistanceMetric.java @@ -7,11 +7,6 @@ import eva2.optimization.individuals.AbstractEAIndividual; * This metric methods is experimental and should be moved to the * optimization problem to allow problem specific distance metrics * between individuals. - * Created by IntelliJ IDEA. - * User: streiche - * Date: 24.04.2003 - * Time: 13:23:40 - * To change this template use Options | File Templates. */ public interface InterfaceDistanceMetric { diff --git a/src/eva2/optimization/population/Population.java b/src/eva2/optimization/population/Population.java index 89e5732c..32f537ec 100644 --- a/src/eva2/optimization/population/Population.java +++ b/src/eva2/optimization/population/Population.java @@ -15,6 +15,7 @@ import eva2.tools.math.Mathematics; import eva2.tools.math.RNG; import eva2.tools.math.StatisticUtils; import eva2.util.annotation.Description; +import eva2.util.annotation.Parameter; import java.util.*; import java.util.logging.Level; @@ -1633,6 +1634,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea * * @param size */ + @Parameter(name = "size", description = "The initial population size.") public final void setTargetSize(int size) { this.targetPopSize = size; } @@ -1652,10 +1654,6 @@ public class Population extends ArrayList implements PopulationInterface, Clonea return this.targetPopSize; } - public String targetSizeTipText() { - return "The initial population size."; - } - public AbstractEAIndividual getEAIndividual(int i) { return (AbstractEAIndividual) this.get(i); } @@ -1831,14 +1829,11 @@ public class Population extends ArrayList implements PopulationInterface, Clonea return popDistMetric; } + @Parameter(name = "metric", description = "Set a default distance metric to be used with the population.") public void setPopMetric(InterfaceDistanceMetric metric) { popDistMetric = metric; } - public String popMetricTipText() { - return "Set a default distance metric to be used with the population."; - } - /** * Returns the average, minimal and maximal individual distance as diversity * measure for the population. If the given metric argument is null, the @@ -2325,6 +2320,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea return initMethod; } + @Parameter(description = "Define the initial sampling method. Note that anything other than inidividualDefault will override the individual initialization concerning the positions in solution space.") public void setInitMethod(PopulationInitMethod initMethod) { this.initMethod = initMethod; GenericObjectEditor.setShowProperty(this.getClass(), "initAround", initMethod == PopulationInitMethod.aroundSeed); @@ -2332,10 +2328,6 @@ public class Population extends ArrayList implements PopulationInterface, Clonea GenericObjectEditor.setShowProperty(this.getClass(), "seedCardinality", initMethod == PopulationInitMethod.binCardinality); } - public String initMethodTipText() { - return "Define the initial sampling method. Note that anything other than inidividualDefault will override the individual initialization concerning the positions in solution space."; - } - /** * Add the population data of a given population to this instance. Note that * collisions are not checked!