gpalta.clustering
Class FitnessClusteringCS

java.lang.Object
  extended by gpalta.clustering.FitnessClusteringCS
All Implemented Interfaces:
Fitness, java.io.Serializable, java.lang.Cloneable

public class FitnessClusteringCS
extends java.lang.Object
implements Fitness, java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Constructor Summary
FitnessClusteringCS()
           
 
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).
 double[] calculateNative(int wThread, double[][] outputs, int nSamples, int nClusters, int[] samples, int nSubSamples, int useHits, int normalizeOutputs, int discretize)
           
 double[] calculateNativeInterface(Output outputs, ProblemData problemData, int[] wSamples)
           
 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.
 int hits(int[] system, int[] actual, int nClasses)
           
 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 initNative(int wThread, double[][] kernel, int nSamples, int nClusters, int[][] close, int[] nClose)
           
 void setCallingThread(int wThread)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitnessClusteringCS

public FitnessClusteringCS()
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: Fitness
Make a copy This method must be implemented cloned instances must be independent.

Specified by:
clone in interface Fitness
Overrides:
clone in class java.lang.Object
Returns:
Throws:
java.lang.CloneNotSupportedException

setCallingThread

public void setCallingThread(int wThread)
Specified by:
setCallingThread in interface Fitness

init

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

Specified by:
init in interface Fitness
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

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

Specified by:
init in interface Fitness
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

calculateNative

public double[] calculateNative(int wThread,
                                double[][] outputs,
                                int nSamples,
                                int nClusters,
                                int[] samples,
                                int nSubSamples,
                                int useHits,
                                int normalizeOutputs,
                                int discretize)

initNative

public void initNative(int wThread,
                       double[][] kernel,
                       int nSamples,
                       int nClusters,
                       int[][] close,
                       int[] nClose)

calculateNativeInterface

public double[] calculateNativeInterface(Output outputs,
                                         ProblemData problemData,
                                         int[] wSamples)

calculate

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

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

assign

public void assign(Individual ind,
                   double[] fit)
Specified by:
assign in interface Fitness

getProcessedOutput

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

Specified by:
getProcessedOutput in interface Fitness
Parameters:
raw - The "raw" output of the individual
problemData - The data to evaluate on
Returns:
A specialized output for the problem

hits

public int hits(int[] system,
                int[] actual,
                int nClasses)