lio.misc
Class Statistics

java.lang.Object
  extended by lio.misc.Statistics
All Implemented Interfaces:
LiOResource
Direct Known Subclasses:
GreedyStatistics

public class Statistics
extends java.lang.Object
implements LiOResource

This class computes statistics concerning with the search being carried out. It provides methods to access to each data independently and can format those data into a String.


Constructor Summary
Statistics()
           
 
Method Summary
 void finish()
          Use this method to show the process of collecting statistics has finished, mainly for timing purposes
 double getBestFitness()
          Returns the best fitness currently found.
 java.lang.Double[] getbestFitnessTrace()
          Return an array with the best value found on each generation/iteration.
 Individual getBestIndividual()
           
 java.lang.Double[] getConvergenceVelocity()
          Compute convergence velocity following the measure proposed in Schwefel (1988)
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object with the information of each object.
 java.lang.Double[] getEvaluationsTrace()
          Return an array with the number of evaluations performed on each generation/iteration.
 int getNumEvalsWithoutImproving()
          Getter for property numEvalsWithoutImproving.
 double getNumEvaluations()
          Returns the current number of evaluations.
 double getNumEvaluationsBest()
          Returns number of evaluations when the best individual was found.
 double getNumGenerations()
          Returns the current number of iterations.
 double getNumGenerationsBest()
          Returns number of generations when the best individual was found.
 int getNumGenerationsWithoutImproving()
          Getter for property numGenerationsWithoutImproving.
 double getNumIterations()
          Returns the current number of iterations.
 double getNumIterationsBest()
          Returns number of iterations when the best individual was found.
 double getTime()
          Returns time elapsed from the beginning of the search.
 double getTimeBest()
          Returns the time elapsed since the beginning of the search until the best individual was found.
 void init()
          Reset statistics.
 void newEvaluation(Individual individual)
          Makes and accounts a new evaluation.
 void newEvaluation(Individual individual, double value)
          Accounts a new evaluation.
 void newGeneration()
          It's the same as newIteration, but allows clarity when working with population-based algorithms.
 void newIteration()
          Registers iterations when working when iterative algorithms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics()
Method Detail

init

public void init()
Reset statistics.


newEvaluation

public void newEvaluation(Individual individual)
Makes and accounts a new evaluation.

Parameters:
individual - Individual being evaluated.

newEvaluation

public void newEvaluation(Individual individual,
                          double value)
Accounts a new evaluation.

Parameters:
individual - Individual evaluated.
value - Fitness value of the individual.

newIteration

public void newIteration()
Registers iterations when working when iterative algorithms.


newGeneration

public void newGeneration()
It's the same as newIteration, but allows clarity when working with population-based algorithms.


finish

public void finish()
Use this method to show the process of collecting statistics has finished, mainly for timing purposes


getBestFitness

public double getBestFitness()
Returns the best fitness currently found.

Returns:
The best value currently found.

getNumEvaluations

public double getNumEvaluations()
Returns the current number of evaluations.

Returns:
Current number of evaluations.

getNumEvaluationsBest

public double getNumEvaluationsBest()
Returns number of evaluations when the best individual was found.

Returns:
The number of evaluations carried out when the best individual was found.

getNumIterations

public double getNumIterations()
Returns the current number of iterations.

Returns:
Current number of iterations.

getNumIterationsBest

public double getNumIterationsBest()
Returns number of iterations when the best individual was found.

Returns:
The number of iterations carried out when the best individual was found.

getNumGenerations

public double getNumGenerations()
Returns the current number of iterations.

Returns:
Current number of iterations.

getNumGenerationsBest

public double getNumGenerationsBest()
Returns number of generations when the best individual was found.

Returns:
The number of generations carried out when the best individual was found.

getTime

public double getTime()
Returns time elapsed from the beginning of the search.

Returns:
Milliseconds since the search started.

getTimeBest

public double getTimeBest()
Returns the time elapsed since the beginning of the search until the best individual was found.

Returns:
Number of milliseconds employed to find the best individual.

getConvergenceVelocity

public java.lang.Double[] getConvergenceVelocity()
Compute convergence velocity following the measure proposed in Schwefel (1988)

Returns:
convergence velocity for whole iterations

getbestFitnessTrace

public java.lang.Double[] getbestFitnessTrace()
Return an array with the best value found on each generation/iteration.

Returns:
A trace of the best fitness found on each iteration.

getEvaluationsTrace

public java.lang.Double[] getEvaluationsTrace()
Return an array with the number of evaluations performed on each generation/iteration.

Returns:
A trace of the number of evaluations on each iteration.

getDefinition

public LiOResourceDefinition getDefinition()
Return a LiOResDescription object with the information of each object. That object holds the name and all parameters that describe the object

Specified by:
getDefinition in interface LiOResource
Returns:
A definition of the object.

getNumEvalsWithoutImproving

public int getNumEvalsWithoutImproving()
Getter for property numEvalsWithoutImproving.

Returns:
Value of property numEvalsWithoutImproving.

getNumGenerationsWithoutImproving

public int getNumGenerationsWithoutImproving()
Getter for property numGenerationsWithoutImproving.

Returns:
Value of property numGenerationsWithoutImproving.

getBestIndividual

public Individual getBestIndividual()
Returns:
Returns the bestIndividual.