Home | Trees | Index | Help |
|
---|
Package pygene :: Module organism :: Class BaseOrganism |
|
object
--+ |PGXmlMixin
--+ | BaseOrganism
MendelOrganism
,
Organism
,
ProgOrganism
Base class for genetic algo and genetic programming organisms
Best not use this directly, but rather use or subclass from one of:Method Summary | |
---|---|
Allows '+' operator for sexual reproduction | |
Convenience method which invokes duel | |
Delivers a minimal string representation of this organism. | |
Duels this organism against an opponent | |
Produce a detailed human-readable report on this organism and its structure | |
Return the fitness level of this organism, as a float | |
Mates this organism with another organism to produce an entirely new organism | |
Implement the mutation phase | |
Dump out the custom attributes of this organism | |
Dumps out this object's contents into an xml tree | |
Inherited from PGXmlMixin | |
Dumps out the population to an open file in XML format. | |
dumps out class information | |
dumps out to xml, returning a string of the raw generated xml | |
Inherited from object | |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Method Details |
---|
__add__(self,
partner)
|
__cmp__(self,
other)
|
__repr__(self)
|
duel(self, opponent)Duels this organism against an opponent Returns -1 if this organism loses, 0 if it's a tie, or 1 if this organism wins |
dump(self)Produce a detailed human-readable report on this organism and its structure |
fitness(self)Return the fitness level of this organism, as a float Should return a number from 0.0 to infinity, where 0.0 means 'perfect' Organisms should evolve such that 'fitness' converges to zero. This method must be overridden |
mate(self, partner)Mates this organism with another organism to produce an entirely new organism Override this in subclasses |
mutate(self)Implement the mutation phase Must be overridden |
xmlDumpAttribs(self, elem)Dump out the custom attributes of this organism elem is an xml.dom.minidom.element object
|
xmlDumpSelf(self, doc, parent)Dumps out this object's contents into an xml tree Arguments:
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Dec 12 14:37:12 2005 | http://epydoc.sf.net |