ó
X<c           @   s<   d  Z  d d l Z d d d „  ƒ  YZ d d d „  ƒ  YZ d S(	   s³   Evolution Strategies for a Population.

Evolver classes manage a population of individuals, and are responsible
for taking care of the transition from one generation to the next.
iÿÿÿÿNt   SteadyStateEvolverc           B   s   e  Z d  Z d „  Z RS(   s‡   Evolve a population in place.

    This implements a Steady State GA, where the population of individuals
    is evolved in place.
    c         C   s   t  d ƒ ‚ d  S(   Ns   Need to code this.(   t   NotImplementedError(   t   self(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/GA/Evolver.pyt   __init__   s    (   t   __name__t
   __module__t   __doc__R   (    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/GA/Evolver.pyR    	   s   t   GenerationEvolverc           B   s    e  Z d  Z d „  Z d „  Z RS(   s    Evolve a population from generation to generation.

    This implements a Generational GA, in which the population moves from
    generation to generation.
    c         C   s   | |  _  | |  _ d S(   s  Initialize the evolver.

        Arguments:

        o starting_population -- An initial set of individuals to begin
        the evolution process from. This should be a list of Organism
        objects.

        o selector -- A Selection object that implements selection, along
        with mutation and crossover to select a new population from a
        given population.
        N(   t   _populationt	   _selector(   R   t   starting_populationt   selector(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/GA/Evolver.pyR      s    	c         C   s›   x‘ | |  j  ƒ s“ y: |  j j |  j  ƒ |  _  x |  j  D] } | j ƒ  q7 WWq t k
 r |  j  j ƒ  x |  j  D] } | GHqs Wt j ƒ  q Xq W|  j  S(   s8  Evolve the population through multiple generations.

        Arguments:

        o stoppping_criteria -- A function which, when passed the current
        individuals in the population, will determine when to stop
        the evolution process.

        Returns:

        o The final evolved population.
        (   R   R	   t   selectt   recalculate_fitnesst   KeyboardInterruptt   sortt   syst   exit(   R   t   stopping_criteriat   organismt   org(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/GA/Evolver.pyt   evolve(   s    	(   R   R   R   R   R   (    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/GA/Evolver.pyR      s   	(    (    (   R   R   R    R   (    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/GA/Evolver.pyt   <module>   s   	