Ejemplo n.º 1
0
    def __init__(self, startingEnergy, senseOfSmell, smellRatio, endurance):
        '''Creates a new critter with the specified energy level, sense of smell (as a radius), and smell strength.'''
        self.__type__ = "Critter"
        
        #Initialize all the parameters contained in the Organism superclass
        Organism.__init__(self, startingEnergy, int(startingEnergy/smellRatio), METABOLISM)

        #Set sense of smell radius, hunger and mating thresholds, and energy-to-smell ratio
        self.smellRatio = smellRatio
        self.sense = senseOfSmell
        self.hungerThreshold = HUNGER_THRESHOLD
        self.matingThreshold = HUNGER_THRESHOLD + endurance

        #Sets self.hungry based on energy
        self.hungry = True
        self.checkHunger()
Ejemplo n.º 2
0
 def __init__(self, s, i, a, w, t):
     Organism.__init__(self, s, i, a, w, t)
Ejemplo n.º 3
0
 def __init__(self, world, position, power):
     Organism.__init__(self, world, position, power, 0)
Ejemplo n.º 4
0
 def __init__(self, s, a, w, p, t):
     Organism.__init__(self, s, 0, a, w, t)
     self.__probability = p
Ejemplo n.º 5
0
 def __init__(self, startingEnergy):
     '''Creates a new Fruit with the specified amount of energy.'''
     self.__type__ = "Fruit"
     Organism.__init__(self, startingEnergy, startingEnergy, DECAY_RATE)