Skip to content

Commit 031c97b

Browse files
rhttpike3
authored andcommitted
benchmark Flocking: Change import structure
1 parent 8def52e commit 031c97b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

benchmarks/Flocking/flocking.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77

88
import numpy as np
99

10-
from mesa import Agent, Model
11-
from mesa.space import ContinuousSpace
12-
from mesa.time import RandomActivation
10+
import mesa
1311

1412

15-
class Boid(Agent):
13+
class Boid(mesa.Agent):
1614
"""
1715
A Boid-style flocker agent.
1816
@@ -90,7 +88,7 @@ def step(self):
9088
self.model.space.move_agent(self, new_pos)
9189

9290

93-
class BoidFlockers(Model):
91+
class BoidFlockers(mesa.Model):
9492
"""
9593
Flocker model class. Handles agent creation, placement and scheduling.
9694
"""
@@ -125,8 +123,8 @@ def __init__(
125123
self.vision = vision
126124
self.speed = speed
127125
self.separation = separation
128-
self.schedule = RandomActivation(self)
129-
self.space = ContinuousSpace(width, height, True)
126+
self.schedule = mesa.time.RandomActivation(self)
127+
self.space = mesa.space.ContinuousSpace(width, height, True)
130128
self.factors = {"cohere": cohere, "separate": separate, "match": match}
131129
self.make_agents()
132130

0 commit comments

Comments
 (0)