Table of Contents

Class: Population charlemagne/population.py

Represents a population of GPs

Base Classes   
list
Methods   
__init__
__setitem__
_contextSensitiveCrossoverOccured
_crossoverOccured
_forceBestOccured
_makeProgram
_mutateOccured
_populateOccured
_replicateOccured
_resetStats
_solutionFound
_statsUpdateOccured
_statsUpdated
_updateStats
breed
getAdjustedFitnessSum
getAverageAdjustedFitness
getAverageDepth
getBestProgram
getDeepestDepth
getEnvironment
getGeneration
getWorstProgram
help
load
next
populate
reset
save
show
  __init__ 
__init__ (
        self,
        env,
        interpreter,
        )

  __setitem__ 
__setitem__ (
        self,
        index,
        item,
        )

  _contextSensitiveCrossoverOccured 
_contextSensitiveCrossoverOccured ( self )

Called when a context sensitive crossover operation has occured

This can be extended in subclasses to provide feedback.

  _crossoverOccured 
_crossoverOccured ( self )

Called when a standard crossover operation has occured

This can be extended in subclasses to provide feedback.

  _forceBestOccured 
_forceBestOccured ( self )

Called when a force best operation has occured

This can be extended in subclasses to provide feedback.

  _makeProgram 
_makeProgram ( self,  lisp )

Factory method for instantiating Programs

Override this in subclasses to instantiate Program subclasses.

  _mutateOccured 
_mutateOccured ( self )

Called when a mutate operation has occured

This can be extended in subclasses to provide feedback.

  _populateOccured 
_populateOccured ( self )

Called when an individual program is populated

This can be extended in subclasses to provide feedback.

  _replicateOccured 
_replicateOccured ( self )

Called when a replicate operation has occured

This can be extended in subclasses to provide feedback.

  _resetStats 
_resetStats ( self )

  _solutionFound 
_solutionFound ( self )

Called when the solution has been discovered

This can be extended in subclasses to provide feedback.

  _statsUpdateOccured 
_statsUpdateOccured ( self )

Called when statistics are calculated for an individual program

Extended to provide console-base feedback

  _statsUpdated 
_statsUpdated ( self )

Called when the statitistics have been updated

This can be extended in subclasses to provide feedback.

  _updateStats 
_updateStats ( self )

  breed 
breed ( self )

Breed the programs until a solution is found

  getAdjustedFitnessSum 
getAdjustedFitnessSum ( self )

The sum of the adjusted fitnesses of all Programs in list

  getAverageAdjustedFitness 
getAverageAdjustedFitness ( self )

Returns the average adjusted fitness of the population

  getAverageDepth 
getAverageDepth ( self )

Reports the average depth of the population

  getBestProgram 
getBestProgram ( self )

The best Program in the list

  getDeepestDepth 
getDeepestDepth ( self )

Reports the deepest depth in the population

  getEnvironment 
getEnvironment ( self )

Returns the current Environment

  getGeneration 
getGeneration ( self )

Returns the generation number of the population

  getWorstProgram 
getWorstProgram ( self )

The worst Program in the list

  help 
help ( self )

  load 
load ( self,  path )

Load a population from a file

  next 
next ( self )

Breed the programs to create the next generation

Exceptions   
GeneticOperationException
  populate 
populate ( self )

Populate the population

Exceptions   
IllegalStateException
  reset 
reset ( self )

Reset the Population to its initial (empty) state

  save 
save ( self )

Save the current population to the file provided

  show 
show ( self )

Abstract method for showing the Population

Implement this in subclasses to provide custom display formats.

Exceptions   
UnimplementedVirtualMethod

Table of Contents

This document was automatically generated on Tue Jun 10 03:55:07 2003 by HappyDoc version 2.0.1