classifier.gp
Class SelectionFunction

java.lang.Object
  extended byclassifier.gp.SelectionFunction
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BestSelection, FitnessOverselected, FitnessProportionate, RandomSelection, Tournament, WorstSelection

public abstract class SelectionFunction
extends java.lang.Object
implements java.io.Serializable

To choose the current method to select individual program

Version:
0.1
Author:
Sacchi Matteo, Sassi Federico
See Also:
Serialized Form

Field Summary
(package private) static int BESTSELECTION
          5
(package private) static int FITNESSOVERSELECTED
          2
(package private) static int FITNESSPROPORTIONATE
          3
(package private) static int RANDOMSELECTION
          4
(package private) static int TOURNAMENT
          1
(package private) static int WORSTSELECTION
          6
 
Constructor Summary
SelectionFunction()
           
 
Method Summary
protected static SelectionFunction createSelectionFunction(int selection_function, java.util.Properties p)
          To choose the selection function through a number
abstract  Individual select(Population p)
          Select an individual on the basis of the selected criteria
 java.lang.String toString()
          Just a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOURNAMENT

static final int TOURNAMENT
1

See Also:
Constant Field Values

FITNESSOVERSELECTED

static final int FITNESSOVERSELECTED
2

See Also:
Constant Field Values

FITNESSPROPORTIONATE

static final int FITNESSPROPORTIONATE
3

See Also:
Constant Field Values

RANDOMSELECTION

static final int RANDOMSELECTION
4

See Also:
Constant Field Values

BESTSELECTION

static final int BESTSELECTION
5

See Also:
Constant Field Values

WORSTSELECTION

static final int WORSTSELECTION
6

See Also:
Constant Field Values
Constructor Detail

SelectionFunction

public SelectionFunction()
Method Detail

select

public abstract Individual select(Population p)
Select an individual on the basis of the selected criteria

Parameters:
p - population of origin
Returns:
the selected individual

toString

public java.lang.String toString()
Just a string

Returns:
"Funzione di Selezione: "

createSelectionFunction

protected static SelectionFunction createSelectionFunction(int selection_function,
                                                           java.util.Properties p)
To choose the selection function through a number

Parameters:
selection_function - number that specify which funcition to use;
p - parameters to pass to the selected funciton
Returns:
a new instance of the selected function with the parameters setted