Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.cmm.msu.ru/trac/petri_dish/changeset/21
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Sun Apr 10 18:58:12 2016
Êîäèðîâêà: IBM-866
Changeset 21:f55481ff4bb5 òÀÓ Petri Dish

Changeset 21:f55481ff4bb5


Ignore:
Timestamp:
12/20/10 02:38:11 (5 years ago)
Author:
Yashina Ksenia <ksenia_yashina@òÀæ>
Branch:
default
Message:

fixed reproduction near dish walls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bacteria.py

    r20 r21 ˆà
    2727        return Falseˆà
    2828ˆà
    ˆà29    def check_dish_wall(self,position,radius,delta,bact_r):ˆà
    ˆà30        if abs(position) > radius - (bact_r + delta):ˆà
    ˆà31            return Trueˆà
    ˆà32        return Falseˆà
    ˆà33ˆà
    2934    def move(self, bacteria, delta_t, radius, delta, bact_r):ˆà
    30ˆà        if abs(self.position) > radius - (bact_r + delta):ˆà
    ˆà35        if self.check_dish_wall(self.position,radius,delta,bact_r):ˆà
    3136            self.velocity = self.velocity.angleToCoord(-(pi/2 -ˆà
    3237                                                         self.velocity.angle()))ˆà
    òÀæ òÀæ ˆà
    4651ˆà
    4752    def asexual(self, bacteria, delta_t, radius, delta, bact_r, full_lifetime):ˆà
    48ˆà        if self.find_place_a(bacteria, delta, bact_r):ˆà
    ˆà53        if self.find_place_a(bacteria, delta, bact_r)\ˆà
    ˆà54           and not(self.check_dish_wall(self.position,radius,delta,2*bact_r)):ˆà
    4955            pos1=self.position + vector.Vector(-(bact_r + 0.75*delta),0)ˆà
    5056            vel1=vector.Vector(1,0).angleToCoord(self.velocity.angle())ˆà
    òÀæ òÀæ ˆà
    6268                full_lifetime):ˆà
    6369        center = (self.position+other.position)*0.5ˆà
    64ˆà        if self.find_place_s(other, bacteria, delta, bact_r):ˆà
    65ˆà            center = (self.position + other.position)*0.5ˆà
    ˆà70        if self.find_place_s(other, bacteria, delta, bact_r) and\ˆà
    ˆà71           not(self.check_dish_wall(center,radius,delta,bact_r*(1+sqrt(2)))):ˆà
    6672            bacteria.append(Bacteria(center +ˆà
    6773                                     vector.Vector(-(bact_r*sqrt(2) + 0.75*delta),0),ˆà
Note: See TracChangeset for help on using the changeset viewer.