Skip to content

JupyterViz questions and proposed enhancements #1772

@rlskoeser

Description

@rlskoeser

Hello and thanks for the great library.

I recognize that the JupyterViz is still experimental, but it seems like a great solution for allowing project collaborators to run simulations in Colab notebooks. I have questions about using it and also about submitting a PR with some improvements.

I am having some difficulty customizing the display - it took me a bit to figure out that the agent portrayal for color needs to be lowercase when previously it was uppercase. I haven't yet figured out how to change the size; previously I was using r for radius; I see size in the jupyterviz code but setting that in my agent portrayal doesn't seem to have any effect. I've looked at the code in mesa.experimental.jupyter_viz but I'm not clear on how that's generated; I guess it's part of a matplotlib figure?

I also wanted to use a Select input for a choice parameter and add an output that displays the current step. I have a fork of mesa where I've implemented these - should I open a pull request with these changes to get feedback? (I haven't written any tests or added documentation for the changes yet, but would do if these changes are welcome.)

I'm also interested in adding a reset button similar to the play/stop buttons, but I'm not sure how to programmatically restart the model; currently the only way to reset is to change one of the input parameters.

Another question: when running with jupyterviz, how should I access the model in order to get collected data? I figured out I could get it this way: page.args[0].model.datacollector.get_model_vars_dataframe() —  but that doesn't seem ideal!

related issues

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