gpalta.core
Interface Fitness

All Known Implementing Classes:
FitnessClassic, FitnessClusteringCS

public interface Fitness

Hold desired outputs for fitness cases, and calculates the fitness for a given Tree


Method Summary
 void assign(Individual ind, double[] fit)
           
 double[] calculate(Output outputs, Individual ind, ProblemData problemData, int[] wSamples)
          Calculate the fitness for an Individual, given its outputs (the Individual is already evaluated).
 java.lang.Object clone()
          Make a copy This method must be implemented cloned instances must be independent.
 Output getProcessedOutput(Output raw, ProblemData problemData)
          Take the output of an Individual and add anything the fitness might need to add, like statistics or aditional calculations related to the fitness.
 void init(Config config, ProblemData problemData, Output desiredOutputs, double[] weights)
          Initializes the Fitness, receiving the desired outputs and the wheights (importance) for each sample.
 void init(Config config, ProblemData problemData, java.lang.String fileName)
          Initializes the Fitness, reading desired outputs from file
 void setCallingThread(int wThread)
           
 

Method Detail

init

void init(Config config,
          ProblemData problemData,
          java.lang.String fileName)
Initializes the Fitness, reading desired outputs from file

Parameters:
config - The evolution config, might be needed inside the Fitness
problemData - The current problem's data, might also be needed (for instance to know the numer of samples used)
fileName - The file to read

init

void init(Config config,
          ProblemData problemData,
          Output desiredOutputs,
          double[] weights)
Initializes the Fitness, receiving the desired outputs and the wheights (importance) for each sample.

Parameters:
config - The evolution config, might be needed inside the Fitness
problemData - The current problem's data, might also be needed (for instance to know the number of samples used)
desiredOutputs - The desired outputs
weights - The weight (importance) of each sample

calculate

double[] calculate(Output outputs,
                   Individual ind,
                   ProblemData problemData,
                   int[] wSamples)
Calculate the fitness for an Individual, given its outputs (the Individual is already evaluated). The fitness value is stored in the individual

Parameters:
outputs - The output of the Individual
ind - The Individual.
problemData - The problem's data (might be needed to calculate the fitness)

assign

void assign(Individual ind,
            double[] fit)

getProcessedOutput

Output getProcessedOutput(Output raw,
                          ProblemData problemData)
Take the output of an Individual and add anything the fitness might need to add, like statistics or aditional calculations related to the fitness.

Parameters:
raw - The "raw" output of the individual
problemData - The data to evaluate on
Returns:
A specialized output for the problem

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Make a copy This method must be implemented cloned instances must be independent.

Returns:
Throws:
java.lang.CloneNotSupportedException

setCallingThread

void setCallingThread(int wThread)