You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm struggling to understand how to visualize different classes of agents on the grid.
I have defined 2 portrayals, agent1_portrayal and agent2_portrayal, exactly like it's done in the docs.
Defining the grid like the following gives an error, Python says too many args are given to grid:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I'm struggling to understand how to visualize different classes of agents on the grid.
I have defined 2 portrayals, agent1_portrayal and agent2_portrayal, exactly like it's done in the docs.
Defining the grid like the following gives an error, Python says too many args are given to grid:
grid = mesa.visualization.CanvasGrid(agent1_portrayal, agent2_portrayal, 50, 50, 500, 500)
I then thought about using a tuple to pass the 2 portrayals as a single argument, like the following:
grid = mesa.visualization.CanvasGrid((agent1_portrayal, agent2_portrayal), 50, 50, 500, 500)
But, when the server launches, none of the agents are visualized.
I'm really struggling, I'd really appreciate some help. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions