Closed dylan-munson closed 2 months ago
Issue seems to be a misplaced parenthesis: the second line in the block of code should read:
for (_, x, y)
_, (x, y)
is correct. If your versions works for you, it means your Mesa version is outdated.
Yes, I did realize my Mesa version was outdated and updating fixed the issue in the original code. Thank you!
Following error is thrown when trying to run the sugarscape_g1mt model out of the box:
File ~/mesa-examples-main/examples/sugarscape_g1mt/sugarscape_g1mt/model.py:97 in __init__
for _,(x,y) in self.grid.coord_iter():
Problem area of code is thus:
agent_id = 0
for _, (x, y) in self.grid.coord_iter():
max_sugar = sugar_distribution[x, y]
max_spice = spice_distribution[x, y]
resource = Resource(agent_id, self, (x, y), max_sugar, max_spice)
self.schedule.add(resource)
self.grid.place_agent(resource, (x, y))
agent_id += 1
Note that this region of code differs from the Complexity Explorer example.