1
0
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:
J. Fernando Sánchez
2024-04-11 17:46:45 +02:00
parent f49be3af68
commit 25d042f16c
30 changed files with 5896 additions and 404 deletions

View File

@@ -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)