mirror of
https://github.com/gsi-upm/soil
synced 2025-08-24 12:02:20 +00:00
v1.0.0rc11
This commit is contained in:
@@ -63,11 +63,11 @@ class City(EventedEnvironment):
|
||||
|
||||
def init(self):
|
||||
self.grid = MultiGrid(width=self.width, height=self.height, torus=False)
|
||||
if not self.agents:
|
||||
if not self.get_agents():
|
||||
self.add_agents(Driver, k=self.n_cars)
|
||||
self.add_agents(Passenger, k=self.n_passengers)
|
||||
|
||||
for agent in self.agents:
|
||||
for agent in self.get_agents():
|
||||
self.grid.place_agent(agent, (0, 0))
|
||||
self.grid.move_to_empty(agent)
|
||||
|
||||
|
Reference in New Issue
Block a user