Skip to content

Visualization for Static Objects in Space #2853

@truoineo

Description

@truoineo

What's the problem this feature will solve?

Not sure if it is an issue of my limited experience with Mesa but I was doing a variant of Passino's Bacterial Foraging and could not figure out a way t visualize static environmental objects (hazards and resources) with Solara. The only way to do so was to make Resources and Hazards also being agents thus they will work with the agent_portrayal() function. This is, however, very counterintuitive especially when your space has many features that you want to have and making them all agents breaks the paradigm. I managed to resolve this by defining a custom Solara component that draws the objects and agents separately from the one created by the default renderer that onlys show agents moving around and nothing else, albeit incurring redundant computation.

Image

Left: The default visualization with only the agents in green circles
Right: The custom component I created with the static objects in green squares and red circles

Describe the solution you'd like

A new support for visualizing these static objects that belong to the environment itself.

Additional context
Space used: mesa.experimental.continuous_space

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions