Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.NeuralNetwork.Gene.Schema.SimpleFinisher Class Reference

List of all members.

Public Member Functions

def __init__
def is_finished

Public Attributes

 num_generations
 num_schemas
 min_generations

Detailed Description

Determine when we are done evolving motifs.

This takes the very simple approach of halting evolution when the
GA has proceeded for a specified number of generations and has
a given number of unique schema with positive fitness.

Definition at line 397 of file Schema.py.


Constructor & Destructor Documentation

def Bio.NeuralNetwork.Gene.Schema.SimpleFinisher.__init__ (   self,
  num_schemas,
  min_generations = 100 
)
Initialize the finisher with its parameters.

Arguments:

o num_schemas -- the number of useful (positive fitness) schemas
we want to generation

o min_generations -- The minimum number of generations to allow
the GA to proceed.

Definition at line 404 of file Schema.py.

00404 
00405     def __init__(self, num_schemas, min_generations = 100):
00406         """Initialize the finisher with its parameters.
00407 
00408         Arguments:
00409 
00410         o num_schemas -- the number of useful (positive fitness) schemas
00411         we want to generation
00412 
00413         o min_generations -- The minimum number of generations to allow
00414         the GA to proceed.
00415         """
00416         self.num_generations = 0
00417 
00418         self.num_schemas = num_schemas
00419         self.min_generations = min_generations

Here is the caller graph for this function:


Member Function Documentation

Determine when we can stop evolving the population.

Definition at line 420 of file Schema.py.

00420 
00421     def is_finished(self, organisms):
00422         """Determine when we can stop evolving the population.
00423         """
00424         self.num_generations += 1
00425         # print "generation %s" % self.num_generations
00426 
00427         if self.num_generations >= self.min_generations:
00428             all_seqs = []
00429             for org in organisms:
00430                 if org.fitness > 0:
00431                     if org.genome not in all_seqs:
00432                         all_seqs.append(org.genome)
00433 
00434             if len(all_seqs) >= self.num_schemas:
00435                 return 1
00436 
00437         return 0
00438 # ---


Member Data Documentation

Definition at line 418 of file Schema.py.

Definition at line 415 of file Schema.py.

Definition at line 417 of file Schema.py.


The documentation for this class was generated from the following file: