Changeset 21:f55481ff4bb5
- Timestamp:
- 12/20/10 02:38:11 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bacteria.py
r20 r21 ˆà 27 27 return Falseˆà 28 28 ˆà ˆà 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 ˆà 29 34 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):ˆà 31 36 self.velocity = self.velocity.angleToCoord(-(pi/2 -ˆà 32 37 self.velocity.angle()))ˆà òÀæ òÀæ ˆà 46 51 ˆà 47 52 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)):ˆà 49 55 pos1=self.position + vector.Vector(-(bact_r + 0.75*delta),0)ˆà 50 56 vel1=vector.Vector(1,0).angleToCoord(self.velocity.angle())ˆà òÀæ òÀæ ˆà 62 68 full_lifetime):ˆà 63 69 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)))):ˆà 66 72 bacteria.append(Bacteria(center +ˆà 67 73 vector.Vector(-(bact_r*sqrt(2) + 0.75*delta),0),ˆà
Note: See TracChangeset
for help on using the changeset viewer.