Table of Contents

Class: Es Es.py

Implementation of classic Rechenberg (mu, lambda) evolution strategy Elitist (mu + lambda)-ES is supported by setting attribute elitist to true.

With each call to cycle() an evolution generation cycle will be performed consisting of offspring creation, evaluation and selection.

Mutation inclusive mutative step size adaption (MSA) is implemented in EsObject._mutate().

Attributes - _mu - _la: - _g: generation - _offspring: list of _lambda offspring - _best: List of improved offspring - _elitist: true for elitist selection scheme

Methods   
__init__
_chooseParents
_select
_setMutationArgs
age
allBest
best
cycle
path
quality
successRate
  __init__ 
__init__ (
        self,
        Prime,
        Params=( 1, 10 ),
        Elitist=0,
        )

Prime: Initial EsObject (or derived type). Params: Tuple consisting of - lambda: Number of offspring created by _create(). - mu: Number of offspring selected as parents _select(). #@@ Model: Either a quality function or a OptimizationModel instance.

Exceptions   
AttributeError, 'Es: You have to assigne a _gene attribute to Prime (' + Prime.__class__ + ' instance)'
  _chooseParents 
_chooseParents ( self )

Choose mu parents to create (mutated) offspring from.

  _select 
_select ( self )

Do offspring ranking: Offspring list is sorted best first using _cmpOffspring() (which is bound to either CmpMinimize() or CmpMaximize()).

  _setMutationArgs 
_setMutationArgs ( self )

Strategy parameters needed for creating mutated offspring are passed to EsObject._mutationArgs class attribute.

This is pure virtual as nothing has to be passed for standard ES.

To be called by cycle().

  age 
age ( self,  offspring )

  allBest 
allBest ( self )

Returns best offspring (of all past generations)

  best 
best ( self )

Returns best offspring of current generation

  cycle 
cycle ( self )

Do a generation cycle by - creating offspring by mutating parents - evaluating each offsprings quality - selecting lambda best offspring as parents for the next generation

  path 
path ( self,  best=None )

Returns genes of all offspring which were improvements as the evolution path (length <= self._g).

  quality 
quality ( self )

  successRate 
successRate ( self )

Returns no. of improvements relative to no. of generations (in percent)


Table of Contents

This document was automatically generated on Thu Feb 27 21:23:48 2003 by HappyDoc version 2.1