gpalta.clustering
Class FitnessClusteringGroup

java.lang.Object
  extended by gpalta.clustering.FitnessGroup
      extended by gpalta.clustering.FitnessClusteringGroup
All Implemented Interfaces:
Fitness

public class FitnessClusteringGroup
extends FitnessGroup


Field Summary
protected  Config config
           
protected  int[] nPerCluster
           
protected  double[][] prototypes
           
protected  int[] winner
           
 
Constructor Summary
FitnessClusteringGroup()
           
 
Method Summary
protected  void calcProto(Output outputs, DataHolder data)
           
 void calculate(Output outputs, Individual ind, TempOutputFactory tempOutputFactory, DataHolder data)
          Evaluates the individual for every sample, and then calculates its fitness.
 Output getProcessedOutput(Output raw, Individual ind, TempOutputFactory tempOutputFactory, DataHolder data)
          Get the output of the individual for every sample, plus anything the fitness might need to add, like statistics or aditional calculations related to the fitness.
 void init(Config config, DataHolder data, Output desiredOutputs, double[] weights)
          Initializes the Fitness, receiving the desired outputs and the wheights (importance) for each sample.
 void init(Config config, DataHolder data, java.lang.String fileName)
          Initializes the Fitness, reading desired outputs from file
 
Methods inherited from class gpalta.clustering.FitnessGroup
assignFitness, penalizedFitness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prototypes

protected double[][] prototypes

winner

protected int[] winner

nPerCluster

protected int[] nPerCluster

config

protected Config config
Constructor Detail

FitnessClusteringGroup

public FitnessClusteringGroup()
Method Detail

init

public void init(Config config,
                 DataHolder data,
                 java.lang.String fileName)
Description copied from interface: Fitness
Initializes the Fitness, reading desired outputs from file

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

init

public void init(Config config,
                 DataHolder data,
                 Output desiredOutputs,
                 double[] weights)
Description copied from interface: Fitness
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
data - 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

public void calculate(Output outputs,
                      Individual ind,
                      TempOutputFactory tempOutputFactory,
                      DataHolder data)
Description copied from interface: Fitness
Evaluates the individual for every sample, and then calculates its fitness. The value is stored in the individual


calcProto

protected void calcProto(Output outputs,
                         DataHolder data)

getProcessedOutput

public Output getProcessedOutput(Output raw,
                                 Individual ind,
                                 TempOutputFactory tempOutputFactory,
                                 DataHolder data)
Description copied from interface: Fitness
Get the output of the individual for every sample, plus anything the fitness might need to add, like statistics or aditional calculations related to the fitness.

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