Need help visualizing agents of a different class #2147
Unanswered
harlmannnn
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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