Example #1
0
    def __init__(self, x, y, width, height):
        Boid.__init__(self, x, y, width, height)

        self.max_force_coe = 3
        self.max_speed = 15

        self.velocity = (np.random.rand(2) - 0.5) * self.max_speed

        self.perception = 30
        self.radius = 5
        self.color = 'r'
        self.eat_counter = 0
Example #2
0
    def __init__(self, x, y, width, height):
        Boid.__init__(self, x, y, width, height)

        self.max_force_coe = 0.7
        self.max_force_sep = 1
        self.max_force_esc = 10

        self.max_speed = 7
        self.perception = 50

        self.velocity = (np.random.rand(2) - 0.5)*self.max_speed
        
        self.radius = 2
        self.color = 'b'
Example #3
0
    def __init__(self, x, y, width, height):
        Boid.__init__(self, x, y, width, height)

        self.max_force_coe = 0.7
        self.max_force_sep = 1
        self.max_force_esc = 15

        self.max_speed = 5
        self.perception = 50

        self.radius = 2
        self.lastproc = 0
        self.birthdate = 0
        self.color = 'b'

        self.velocity = (np.random.rand(2) - 0.5)*10
Example #4
0
 def __init__(self, position=None, velocity=None, orientation=None):
     """ Initialize the GuiBoid graphical representation of the Boid. """
     QtGui.QGraphicsItem.__init__(self)
     Boid.__init__(self, position, velocity, orientation)
     self.color = self.randomColor()
     self.updateOnGui()
Example #5
0
class Predator(Boid):
    def __init__(self, (x, y), radius, (velocity_x, velocity_y)):
        Boid.__init__(self, (x, y), radius, (velocity_x, velocity_y))