Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.cmm.msu.ru/hg/petri_dish/rev/eec3dd65336c
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 17:27:33 2012
Кодировка:
petri_dish: eec3dd65336c

petri_dish

changeset 16:eec3dd65336c

Petri.py module0.3
author Smirnova Victoria
date Wed, 15 Dec 2010 03:05:11 +0300
parents 5cc5069458a9
children 15d7afe555a4
files Petri.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/Petri.py	Wed Dec 15 03:04:54 2010 +0300
     1.2 +++ b/Petri.py	Wed Dec 15 03:05:11 2010 +0300
     1.3 @@ -1,8 +1,11 @@
     1.4  class Petri (object):
     1.5 -    def __init__ (self, num, bacteria, radius):
     1.6 +    def __init__ (self, num, bacteria, radius, delta, bact_r, full_lifetime):
     1.7          self.num=num
     1.8          self.bacteria=bacteria
     1.9          self.radius=radius
    1.10 +        self.delta=delta
    1.11 +        self.bact_r=bact_r
    1.12 +        self.full_lifetime=full_lifetime
    1.13          
    1.14      def step (self, delta_t, env):
    1.15          for bact in self.bacteria:
    1.16 @@ -14,14 +17,14 @@
    1.17              collide=bact.check_collision
    1.18              if collide==False:
    1.19                  if bact.reprod('a', env, p_max)==True:
    1.20 -                    bact.asexual(self.bacteria, delta_t, self.radius)
    1.21 +                    bact.asexual(self.bacteria, delta_t, self.radius, self.delta, self.bact_r, self.full_lifetime)
    1.22                      continue
    1.23 -                bact.move(self.delta_t, self.radius)
    1.24 +                bact.move(self.delta_t, self.radius, self.delta, self.bact_r)
    1.25                  continue
    1.26              if bact.reprod('s', env)==True:
    1.27 -                bact.sexual(collide, self.bacteria, delta_t, self.radius)
    1.28 +                bact.sexual(collide, self.bacteria, delta_t, self.radius, self.delta, self.bact_r, self.full_lifetime)
    1.29                  continue
    1.30 -            bact.collision(collide, delta_t, self.radius)
    1.31 +            bact.collision(collide, delta_t, self.radius, self.delta, self.bact_r)
    1.32              
    1.33                  
    1.34