lio.population.contchain
Class SetAnalysis

java.lang.Object
  extended by lio.population.contchain.SetAnalysis

public class SetAnalysis
extends java.lang.Object

This class deals with a population considering that elements are chains of real values. It allows performing some operations such as getting statistics of different variables, etc.


Constructor Summary
SetAnalysis(double[][] samples)
           
SetAnalysis(Individual[] individuals)
          Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the array passed as parameter.
SetAnalysis(Individual[] individuals, int pNumIndividuals)
          Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the array as parameter.
SetAnalysis(Population pop)
          Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the populaton passed as parameter.
SetAnalysis(Population pop, int pNumIndividuals)
          Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the populaton passed as parameter.
 
Method Summary
 int getIndSize()
           
 double getMean(int variable)
          Get the mean value of some variable.
 double[][] getMeansAndVariances()
          Gets means and variances of all variables.
 int getSize()
           
 double getVariance(double mean, int variable)
          Get the variance of some variable given the mean.
 double getVariance(int variable)
          Get the variance of some variable.
 void setIndSize(int indSize)
           
 void setSize(int size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetAnalysis

public SetAnalysis(Individual[] individuals)
Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the array passed as parameter.

Parameters:
individuals - Array of individuals that will be processed.

SetAnalysis

public SetAnalysis(Individual[] individuals,
                   int pNumIndividuals)
Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the array as parameter. It only works with the best individuals.

Parameters:
individuals - Array of individuals that will be processed.
numIndividuals - number of selected;

SetAnalysis

public SetAnalysis(Population pop)
Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the populaton passed as parameter.

Parameters:
pop - Population that will be processed.

SetAnalysis

public SetAnalysis(Population pop,
                   int pNumIndividuals)
Constructor Builds a set analizer by extracting the references to the elements inside each ContChain in the populaton passed as parameter. It only works with the best individuals.

Parameters:
pop - Population that will be encapsulated by the BitChainPopulation.
numIndividuals - number of individuals that will be encapsulated.

SetAnalysis

public SetAnalysis(double[][] samples)
Method Detail

getMean

public double getMean(int variable)
Get the mean value of some variable.

Parameters:
variable - Number of variable whose mean is wanted to know.
Returns:
the mean of the variable.

getVariance

public double getVariance(int variable)
Get the variance of some variable.

Parameters:
variable - Number of variable whose mean is wanted to know.
Returns:
The variance of the variable.

getVariance

public double getVariance(double mean,
                          int variable)
Get the variance of some variable given the mean.

Parameters:
mean - Mean value for this variable in the N best individuals.
variable - Number of variable whose mean is wanted to know.
Returns:
The variance of the variable.

getMeansAndVariances

public double[][] getMeansAndVariances()
Gets means and variances of all variables.

Returns:
An array containing the mean([0]) and the variance([1]) for each variable.

getIndSize

public int getIndSize()

setIndSize

public void setIndSize(int indSize)

getSize

public int getSize()

setSize

public void setSize(int size)