ec.gp.sasc
Class SASCNodeSelector

java.lang.Object
  extended by ec.gp.sasc.SASCNodeSelector
All Implemented Interfaces:
GPNodeSelector, Prototype, Setup, Serializable, Cloneable

public class SASCNodeSelector
extends Object
implements GPNodeSelector

Esta classe faz a seleção dos nós para o crossover

See Also:
Serialized Form

Field Summary
 int nodes
          The number of nodes in the tree, -1 if unknown.
 float nonterminalProbability
          The probability a nonterminal must be chosen.
 int nonterminals
          The number of nonterminals in the tree, -1 if unknown.
static String P_NODESELECTOR
           
static String P_NONTERMINAL_PROBABILITY
           
static String P_ROOT_PROBABILITY
           
static String P_TERMINAL_PROBABILITY
           
 float rootProbability
          The probability the root must be chosen
 float terminalProbability
          The probability a terminal must be chosen
 int terminals
          The number of terminals in the tree, -1 if unknown.
 
Constructor Summary
SASCNodeSelector()
          Construtor da classe
 
Method Summary
 Object clone()
          Método para clonagem
 Parameter defaultBase()
          Retorna a base que pode ser utilizada diretamente para parametrização do node selector
 GPNode pickNode(EvolutionState s, int subpopulation, int thread, GPIndividual ind, GPTree tree)
          Método default para seleção do nó.
 GPNode pickNodeRandom(EvolutionState s, int subpopulation, int thread, GPIndividual ind, GPTree tree)
          Método para a seleção aleatória do nó.
 GPNode pickNodeSSAC(EvolutionState s, int subpopulation, int thread, GPIndividual ind, GPTree tree, SASCNode rootNodeSecondParent)
          Faz a seleção segundo o método SSAC de Angeline
 GPNode pickNodeSSSCFirst(EvolutionState s, int subpopulation, int thread, GPIndividual ind, GPTree tree, SASCNode rootNodeSecondParent)
          Faz a seleção do nó para o primeiro reprodutor, segundo o método SSSC
 GPNode pickNodeSSSCSecond(EvolutionState s, int subpopulation, int thread, GPIndividual ind, GPTree tree, SASCNode rootNodeSecondParent, double beta)
          Faz a seleção para o segundo reprodutor, segundo o método SSSC
 void reset()
          Método para reinicialização do node selector
 void setup(EvolutionState state, Parameter base)
          Método para a configuração do objeto
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_NODESELECTOR

public static final String P_NODESELECTOR
See Also:
Constant Field Values

P_TERMINAL_PROBABILITY

public static final String P_TERMINAL_PROBABILITY
See Also:
Constant Field Values

P_NONTERMINAL_PROBABILITY

public static final String P_NONTERMINAL_PROBABILITY
See Also:
Constant Field Values

P_ROOT_PROBABILITY

public static final String P_ROOT_PROBABILITY
See Also:
Constant Field Values

rootProbability

public float rootProbability
The probability the root must be chosen


terminalProbability

public float terminalProbability
The probability a terminal must be chosen


nonterminalProbability

public float nonterminalProbability
The probability a nonterminal must be chosen.


nonterminals

public int nonterminals
The number of nonterminals in the tree, -1 if unknown.


terminals

public int terminals
The number of terminals in the tree, -1 if unknown.


nodes

public int nodes
The number of nodes in the tree, -1 if unknown.

Constructor Detail

SASCNodeSelector

public SASCNodeSelector()
Construtor da classe

Method Detail

defaultBase

public Parameter defaultBase()
Retorna a base que pode ser utilizada diretamente para parametrização do node selector

Specified by:
defaultBase in interface Prototype

clone

public Object clone()
Método para clonagem

Specified by:
clone in interface Prototype
Overrides:
clone in class Object

setup

public void setup(EvolutionState state,
                  Parameter base)
Método para a configuração do objeto

Specified by:
setup in interface Prototype
Specified by:
setup in interface Setup
Parameters:
state - Objeto EvolutionState que guarda as informações sobre a evolução do processo
base - Base de parametrização auxiliar. Se esse parâmetro for enviado com valor "database" por exemplo, qualquer parâmetro desta classe poderá ser obtida no arquivo de parâmetros através da keyword "gp.database.". Por exemplo, para obter o tamanho da base de treinamento, a keyword seria "database.training".

reset

public void reset()
Método para reinicialização do node selector

Specified by:
reset in interface GPNodeSelector

pickNode

public GPNode pickNode(EvolutionState s,
                       int subpopulation,
                       int thread,
                       GPIndividual ind,
                       GPTree tree)
Método default para seleção do nó. Faz a seleção de forma aleatória.

Specified by:
pickNode in interface GPNodeSelector

pickNodeRandom

public GPNode pickNodeRandom(EvolutionState s,
                             int subpopulation,
                             int thread,
                             GPIndividual ind,
                             GPTree tree)
Método para a seleção aleatória do nó.

Parameters:
s -
subpopulation -
thread -
ind -
tree -
Returns:

pickNodeSSSCFirst

public GPNode pickNodeSSSCFirst(EvolutionState s,
                                int subpopulation,
                                int thread,
                                GPIndividual ind,
                                GPTree tree,
                                SASCNode rootNodeSecondParent)
Faz a seleção do nó para o primeiro reprodutor, segundo o método SSSC

Parameters:
s -
subpopulation -
thread -
ind -
tree -
rootNodeSecondParent -
Returns:

pickNodeSSSCSecond

public GPNode pickNodeSSSCSecond(EvolutionState s,
                                 int subpopulation,
                                 int thread,
                                 GPIndividual ind,
                                 GPTree tree,
                                 SASCNode rootNodeSecondParent,
                                 double beta)
Faz a seleção para o segundo reprodutor, segundo o método SSSC

Parameters:
s -
subpopulation -
thread -
ind -
tree -
rootNodeSecondParent -
beta -
Returns:

pickNodeSSAC

public GPNode pickNodeSSAC(EvolutionState s,
                           int subpopulation,
                           int thread,
                           GPIndividual ind,
                           GPTree tree,
                           SASCNode rootNodeSecondParent)
Faz a seleção segundo o método SSAC de Angeline

Parameters:
s -
subpopulation -
thread -
ind -
tree -
rootNodeSecondParent -
Returns: