JAGA Homepage

org.jaga.hooks
Class AnalysisHook

java.lang.Object
  extended by org.jaga.hooks.SimpleGAHook
      extended by org.jaga.hooks.AnalysisHook

public class AnalysisHook
extends SimpleGAHook

TODO: Complete these comments.

Project: JAGA - Java API for Genetic Algorithms.

Company: University College London and JAGA.Org (http://www.jaga.org).

Copyright: (c) 2004 by G. Paperin.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, ONLY if you include a note of the original author(s) in any redistributed/modified copy.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or see http://www.gnu.org/licenses/gpl.html

Version:
JAGA public release 1.0 beta
Author:
Greg Paperin (greg@jaga.org)

Nested Class Summary
(package private)  class AnalysisHook.Entry
          Statistical data entry.
 
Field Summary
private  boolean analyseBestFitness
           
private  boolean analyseGenAge
           
private  boolean analyseGenAverageFit
           
private  boolean analyseGenDump
           
private  boolean analyseGenFitStdDeviation
           
private  boolean analyseGenMaxFit
           
private  boolean analyseGenMinFit
           
private  boolean analyseRunTime
           
private  boolean analyseTotalFitEvals
           
private  java.util.ArrayList bestFitnessValues
           
private  FittestIndividualResult bestResult
           
private  long fitnessCalculations
           
private  GAAnalysisFrame frame
           
private  java.util.ArrayList genAverageFitnesses
           
private  int generationNum
           
private  java.util.HashMap genFitnessStdDeviations
           
private  java.util.ArrayList genMaxFitnesses
           
private  java.util.ArrayList genMinFitnesses
           
private  java.io.PrintStream logStream
           
private  int maxPlotCount
           
private  double maxPlotVal
           
private  double minPlotVal
           
private  java.lang.String plotFrameTitle
           
private  boolean plotGraph
           
private  java.lang.String runTime
           
private  long startedTime
           
private  long updateDelay
           
private  boolean viewUpdated
           
 
Constructor Summary
AnalysisHook()
           
AnalysisHook(boolean plotGraph)
           
AnalysisHook(java.io.PrintStream logStream)
           
AnalysisHook(java.io.PrintStream logStream, boolean plotGraph)
           
 
Method Summary
private  void checkTime()
           
private  GAAnalysisFrame createAnalysisFrame()
           
private  void fitnessCalculated()
           
 void fitnessCalculated(SimpleGA caller, Individual updatedIndividual, Population pop, int age, GAParameterSet params)
           
 void foundNewResult(SimpleGA caller, Population pop, int age, GAResult result, GAParameterSet params)
           
 void frameDisposed()
           
private  void gaTerminated()
           
 void generationChanged(SimpleGA caller, Population pop, int age, GAResult result, GAParameterSet paramss)
           
 AnalysisHook.Entry getAverageFitness(int index)
           
 int getAverageFitnessCount()
           
 AnalysisHook.Entry getBestFitnessValue(int index)
           
 int getBestFitnessValueCount()
           
 java.util.ArrayList getBestFitnessValues()
           
 FittestIndividualResult getBestResult()
           
 long getFitnessCalculations()
           
 int getFitnessStdDeviationCount()
           
 java.util.ArrayList getGenAverageFitnesses()
           
 int getGenerationNum()
           
 java.util.ArrayList getGenMaxFitnesses()
           
 java.util.ArrayList getGenMinFitnesses()
           
 java.io.PrintStream getLogStream()
           
 AnalysisHook.Entry getMaxFitness(int index)
           
 int getMaxFitnessCount()
           
 int getMaxPlotCount()
           
 double getMaxPlotVal()
           
 AnalysisHook.Entry getMinFitness(int index)
           
 int getMinFitnessCount()
           
 double getMinPlotVal()
           
 java.lang.String getPlotFrameTitle()
           
 java.lang.String getRunTime()
           
private  java.lang.String getRunTimeString()
           
 AnalysisHook.Entry getStdDeviation(int genNum)
           
 long getUpdateDelay()
           
 void initialisationDone(SimpleGA caller, Population pop, int age, GAResult result, GAParameterSet params)
           
 boolean isAnalyseBestFitness()
           
 boolean isAnalyseGenAge()
           
 boolean isAnalyseGenAverageFit()
           
 boolean isAnalyseGenDump()
           
 boolean isAnalyseGenFitStdDeviation()
           
 boolean isAnalyseGenMaxFit()
           
 boolean isAnalyseGenMinFit()
           
 boolean isAnalyseRunTime()
           
 boolean isAnalyseTotalFitEvals()
           
 boolean isPlotGraph()
           
 boolean isViewUpdated()
           
private  void log(java.lang.String msg)
           
 void populationReinitialised(Population pop, int age, GAResult result, GAParameterSet params)
           
 void reproduced(SimpleGA caller, Individual[] children, Individual[] parents, Population pop, int age, GAResult result, GAParameterSet params)
           
 void reset()
           
 void selectedForReproduction(SimpleGA caller, Individual[] selectedParents, Population pop, int age, GAResult result, GAParameterSet params)
           
 void setAnalyseBestFitness(boolean analyseBestFitness)
           
 void setAnalyseGenAge(boolean analyseGenAge)
           
 void setAnalyseGenAverageFit(boolean analyseGenAverageFit)
           
 void setAnalyseGenDump(boolean analyseGenDump)
           
 void setAnalyseGenFitStdDeviation(boolean analyseGenFitStdDeviation)
           
 void setAnalyseGenMaxFit(boolean analyseGenMaxFit)
           
 void setAnalyseGenMinFit(boolean analyseGenMinFit)
           
 void setAnalyseRunTime(boolean analyseRunTime)
           
 void setAnalyseTotalFitEvals(boolean analyseTotalFitEvals)
           
 void setLogStream(java.io.PrintStream logStream)
           
 void setPlotFrameTitle(java.lang.String plotFrameTitle)
           
 void setPlotGraph(boolean plotGraph)
           
 void setUpdateDelay(long updateDelay)
           
 void stopLogStream()
           
 void terminationConditionApplies(SimpleGA caller, Population pop, int age, GAResult result, GAParameterSet params)
           
private  void updateGraphSize(double val, int count)
           
private  void updatePopulation(Population pop, int age, GAResult result)
           
private  void updateResult(GAResult result, int age)
           
private  void updateView()
           
 void viewUpdateComplete()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

analyseBestFitness

private boolean analyseBestFitness

analyseTotalFitEvals

private boolean analyseTotalFitEvals

analyseGenAge

private boolean analyseGenAge

analyseGenMinFit

private boolean analyseGenMinFit

analyseGenMaxFit

private boolean analyseGenMaxFit

analyseGenAverageFit

private boolean analyseGenAverageFit

analyseGenFitStdDeviation

private boolean analyseGenFitStdDeviation

analyseGenDump

private boolean analyseGenDump

analyseRunTime

private boolean analyseRunTime

logStream

private java.io.PrintStream logStream

plotGraph

private boolean plotGraph

updateDelay

private long updateDelay

frame

private GAAnalysisFrame frame

viewUpdated

private boolean viewUpdated

minPlotVal

private double minPlotVal

maxPlotVal

private double maxPlotVal

maxPlotCount

private int maxPlotCount

plotFrameTitle

private java.lang.String plotFrameTitle

bestResult

private FittestIndividualResult bestResult

bestFitnessValues

private java.util.ArrayList bestFitnessValues

generationNum

private int generationNum

genAverageFitnesses

private java.util.ArrayList genAverageFitnesses

genFitnessStdDeviations

private java.util.HashMap genFitnessStdDeviations

genMinFitnesses

private java.util.ArrayList genMinFitnesses

genMaxFitnesses

private java.util.ArrayList genMaxFitnesses

fitnessCalculations

private long fitnessCalculations

startedTime

private long startedTime

runTime

private java.lang.String runTime
Constructor Detail

AnalysisHook

public AnalysisHook()

AnalysisHook

public AnalysisHook(java.io.PrintStream logStream)

AnalysisHook

public AnalysisHook(boolean plotGraph)

AnalysisHook

public AnalysisHook(java.io.PrintStream logStream,
                    boolean plotGraph)
Method Detail

reset

public void reset()

createAnalysisFrame

private GAAnalysisFrame createAnalysisFrame()

frameDisposed

public void frameDisposed()

updateResult

private void updateResult(GAResult result,
                          int age)

updatePopulation

private void updatePopulation(Population pop,
                              int age,
                              GAResult result)

gaTerminated

private void gaTerminated()

fitnessCalculated

private void fitnessCalculated()

updateGraphSize

private void updateGraphSize(double val,
                             int count)

updateView

private void updateView()

log

private void log(java.lang.String msg)

checkTime

private void checkTime()

getRunTimeString

private java.lang.String getRunTimeString()

initialisationDone

public void initialisationDone(SimpleGA caller,
                               Population pop,
                               int age,
                               GAResult result,
                               GAParameterSet params)
Overrides:
initialisationDone in class SimpleGAHook

populationReinitialised

public void populationReinitialised(Population pop,
                                    int age,
                                    GAResult result,
                                    GAParameterSet params)

foundNewResult

public void foundNewResult(SimpleGA caller,
                           Population pop,
                           int age,
                           GAResult result,
                           GAParameterSet params)
Overrides:
foundNewResult in class SimpleGAHook

generationChanged

public void generationChanged(SimpleGA caller,
                              Population pop,
                              int age,
                              GAResult result,
                              GAParameterSet paramss)
Overrides:
generationChanged in class SimpleGAHook

terminationConditionApplies

public void terminationConditionApplies(SimpleGA caller,
                                        Population pop,
                                        int age,
                                        GAResult result,
                                        GAParameterSet params)
Overrides:
terminationConditionApplies in class SimpleGAHook

selectedForReproduction

public void selectedForReproduction(SimpleGA caller,
                                    Individual[] selectedParents,
                                    Population pop,
                                    int age,
                                    GAResult result,
                                    GAParameterSet params)
Overrides:
selectedForReproduction in class SimpleGAHook

reproduced

public void reproduced(SimpleGA caller,
                       Individual[] children,
                       Individual[] parents,
                       Population pop,
                       int age,
                       GAResult result,
                       GAParameterSet params)
Overrides:
reproduced in class SimpleGAHook

fitnessCalculated

public void fitnessCalculated(SimpleGA caller,
                              Individual updatedIndividual,
                              Population pop,
                              int age,
                              GAParameterSet params)
Overrides:
fitnessCalculated in class SimpleGAHook

isAnalyseBestFitness

public boolean isAnalyseBestFitness()

setAnalyseBestFitness

public void setAnalyseBestFitness(boolean analyseBestFitness)

isAnalyseGenAge

public boolean isAnalyseGenAge()

setAnalyseGenAge

public void setAnalyseGenAge(boolean analyseGenAge)

isAnalyseGenAverageFit

public boolean isAnalyseGenAverageFit()

setAnalyseGenAverageFit

public void setAnalyseGenAverageFit(boolean analyseGenAverageFit)

isAnalyseGenFitStdDeviation

public boolean isAnalyseGenFitStdDeviation()

setAnalyseGenFitStdDeviation

public void setAnalyseGenFitStdDeviation(boolean analyseGenFitStdDeviation)

isAnalyseGenDump

public boolean isAnalyseGenDump()

setAnalyseGenDump

public void setAnalyseGenDump(boolean analyseGenDump)

isAnalyseRunTime

public boolean isAnalyseRunTime()

setAnalyseRunTime

public void setAnalyseRunTime(boolean analyseRunTime)

isAnalyseTotalFitEvals

public boolean isAnalyseTotalFitEvals()

setAnalyseTotalFitEvals

public void setAnalyseTotalFitEvals(boolean analyseTotalFitEvals)

getLogStream

public java.io.PrintStream getLogStream()

setLogStream

public void setLogStream(java.io.PrintStream logStream)

stopLogStream

public void stopLogStream()

isAnalyseGenMaxFit

public boolean isAnalyseGenMaxFit()

setAnalyseGenMaxFit

public void setAnalyseGenMaxFit(boolean analyseGenMaxFit)

isAnalyseGenMinFit

public boolean isAnalyseGenMinFit()

setAnalyseGenMinFit

public void setAnalyseGenMinFit(boolean analyseGenMinFit)

isPlotGraph

public boolean isPlotGraph()

setPlotGraph

public void setPlotGraph(boolean plotGraph)

getPlotFrameTitle

public java.lang.String getPlotFrameTitle()

setPlotFrameTitle

public void setPlotFrameTitle(java.lang.String plotFrameTitle)

getUpdateDelay

public long getUpdateDelay()

setUpdateDelay

public void setUpdateDelay(long updateDelay)

isViewUpdated

public boolean isViewUpdated()

getGenerationNum

public int getGenerationNum()

getFitnessCalculations

public long getFitnessCalculations()

getRunTime

public java.lang.String getRunTime()

getBestFitnessValue

public AnalysisHook.Entry getBestFitnessValue(int index)

getBestFitnessValueCount

public int getBestFitnessValueCount()

getMinFitness

public AnalysisHook.Entry getMinFitness(int index)

getMinFitnessCount

public int getMinFitnessCount()

getMaxFitness

public AnalysisHook.Entry getMaxFitness(int index)

getMaxFitnessCount

public int getMaxFitnessCount()

getAverageFitness

public AnalysisHook.Entry getAverageFitness(int index)

getAverageFitnessCount

public int getAverageFitnessCount()

getFitnessStdDeviationCount

public int getFitnessStdDeviationCount()

getMaxPlotVal

public double getMaxPlotVal()

getMinPlotVal

public double getMinPlotVal()

getMaxPlotCount

public int getMaxPlotCount()

viewUpdateComplete

public void viewUpdateComplete()

getBestFitnessValues

public java.util.ArrayList getBestFitnessValues()

getGenAverageFitnesses

public java.util.ArrayList getGenAverageFitnesses()

getGenMaxFitnesses

public java.util.ArrayList getGenMaxFitnesses()

getGenMinFitnesses

public java.util.ArrayList getGenMinFitnesses()

getBestResult

public FittestIndividualResult getBestResult()

getStdDeviation

public AnalysisHook.Entry getStdDeviation(int genNum)

JAGA Homepage

Go to JAGA Homepage