Ejemplo n.º 1
0
 def __on_wolf_die(self, wolf, type):
     if wolf.logged :
         return
     wolf.logged = True
     timestamp = time.time() - self.beginTime
     livetime = time.time() - wolf.born_time
     print "wolf", type
     LiveLog.append('wolf', timestamp, wolf.generation, livetime, type)
Ejemplo n.º 2
0
 def __on_rabbit_die(self, rabbit, type):
     if rabbit.logged :
         return
     rabbit.logged = True
     timestamp = time.time() - self.beginTime
     livetime = time.time() - rabbit.born_time
     print "rabbit", type
     LiveLog.append('rabbit', timestamp, rabbit.generation, livetime, type)
Ejemplo n.º 3
0
 def __on_new_wolf(self, wolf):
     self.wolves.append(wolf)
     timestamp = time.time() - self.beginTime
     PhenotypeLog.append('wolf', timestamp, wolf.generation, wolf.phenotype)
     LiveLog.append('wolf', timestamp, wolf.generation, 0, LiveLog.BIRTH)
Ejemplo n.º 4
0
 def __on_new_rabit(self, rabbit):
     self.rabbits.append(rabbit)
     timestamp = time.time() - self.beginTime
     PhenotypeLog.append('rabbit', timestamp, rabbit.generation, rabbit.phenotype)
     LiveLog.append('rabbit', timestamp, rabbit.generation, 0, LiveLog.BIRTH)