Package pygene :: Module gene :: Class ComplexGene
[show private | hide private]
[frames | no frames]

Type ComplexGene

object --+        
         |        
PGXmlMixin --+    
             |    
      BaseGene --+
                 |
                ComplexGene


A gene whose value is a complex point number
Method Summary
  __add__(self, other)
Combines two genes in a gene pair, to produce an effect
  mutate(self)
Mutate this gene's value by a random amount within the range +/- self.mutAmt
  randomValue(self)
Generates a plausible random value for this gene.
    Inherited from BaseGene
  __init__(self, value)
  __repr__(self)
  copy(self)
Produce an exact copy of this gene
  maybeMutate(self)
  xmlDumpAttribs(self, tag)
sets attributes of tag
  xmlDumpSelf(self, doc, parent)
dump out this gene into parent tag
    Inherited from PGXmlMixin
  xmlDump(self, fileobj)
Dumps out the population to an open file in XML format.
  xmlDumpClass(self, tag)
dumps out class information
  xmlDumps(self)
dumps out to xml, returning a string of the raw generated xml
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
float mutAmtImag = 0.10000000000000001                                                   
float mutAmtReal = 0.10000000000000001                                                   
float randMax = 1.0                                                                   
float randMin = -1.0                                                                  
    Inherited from BaseGene
float mutProb = 0.01                                                                  
NoneType value = None                                                                  

Method Details

__add__(self, other)
(Addition operator)

Combines two genes in a gene pair, to produce an effect

This is used to determine the gene's phenotype

This class computes the arithmetic mean of the two genes' values, so is akin to incomplete dominance.

Override if desired
Overrides:
pygene.gene.BaseGene.__add__

mutate(self)

Mutate this gene's value by a random amount within the range +/- self.mutAmt

perform mutation IN-PLACE, ie don't return mutated copy
Overrides:
pygene.gene.BaseGene.mutate

randomValue(self)

Generates a plausible random value for this gene.

Override as needed
Overrides:
pygene.gene.BaseGene.randomValue

Class Variable Details

mutAmtImag

Type:
float
Value:
0.10000000000000001                                                   

mutAmtReal

Type:
float
Value:
0.10000000000000001                                                   

randMax

Type:
float
Value:
1.0                                                                   

randMin

Type:
float
Value:
-1.0                                                                  

Generated by Epydoc 2.1 on Mon Dec 12 14:37:12 2005 http://epydoc.sf.net