Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualisation: Allow different shapes agent portrayals#2164 #2171

Closed
wants to merge 3 commits into from

Conversation

Aryan1Mahahjan
Copy link

Hi, this is Draft Solution to #2164.

I was thinking about using the below, which use the Encode function attribute

The added code snippet checks for shape and fill keys in agent data. If present, it adds them to the encoding_dict using the corresponding keys shape and fill. This allows you to define visual properties like circle shapes and filled elements for agents in your visualization.

Draft: Addition of 2 keys in enconding_dict: shape(str) and fill(bool)

Copy link

github-actions bot commented Jul 6, 2024

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
Schelling small 🔵 +0.9% [+0.6%, +1.2%] 🔵 +0.7% [+0.5%, +0.9%]
Schelling large 🔵 +1.2% [+0.8%, +1.5%] 🔵 +0.6% [+0.2%, +1.1%]
WolfSheep small 🔵 +0.5% [-0.7%, +1.8%] 🔵 +0.7% [+0.4%, +1.0%]
WolfSheep large 🔵 +0.4% [+0.2%, +0.6%] 🔵 +0.3% [+0.2%, +0.5%]
BoidFlockers small 🔵 +3.4% [+2.5%, +4.2%] 🔵 +3.6% [+3.0%, +4.4%]
BoidFlockers large 🔴 +4.0% [+3.0%, +5.0%] 🔴 +3.9% [+3.4%, +4.4%]

@Aryan1Mahahjan
Copy link
Author

Commit Issue with pytest:

I'm having trouble committing changes. When I try to commit, I see an error message related to pytest. Here's the output:

image

@EwoutH
Copy link
Member

EwoutH commented Jul 6, 2024

Thanks for the PR!

Weird, seems totally unrelated to these changes or our CI. How are you committing?

@EwoutH EwoutH added the enhancement Release notes label label Jul 6, 2024
@EwoutH EwoutH requested a review from rht July 6, 2024 07:18
@rht
Copy link
Contributor

rht commented Jul 6, 2024

Regarding with the typos, we need to add .venv to .gitignore, because it is a common name for a local virtualenv folder.
Regarding with the PR, it would be great to have a screenshot showcasing that it works in action, by modifying the Schelling_experimental example.

@Aryan1Mahahjan
Copy link
Author

I reset my project to an earlier state using Git.

Now, I'm trying to re-install required dependencies like ruff and pytest, but I'm unable to activate the virtual environment (.venv). This prevents me from installing the packages currently.

@rht
Copy link
Contributor

rht commented Jul 6, 2024

Now, I'm trying to re-install required dependencies like ruff and pytest, but I'm unable to activate the virtual environment (.venv). This prevents me from installing the packages currently.

Can you share the error messages?

@Aryan1Mahahjan
Copy link
Author

image
I did not have this issue when installing the test last time.

@EwoutH EwoutH mentioned this pull request Jul 7, 2024
@rht
Copy link
Contributor

rht commented Jul 7, 2024

Your .venv is probably gone (the other possibility is that .venv exists but .venv/bin/activate is not executable, but doesn't have to be executable anyway). You likely have to recreate the virtualenv from scratch.

@EwoutH
Copy link
Member

EwoutH commented Jul 8, 2024

Maybe it's easiest to reinstall at this point.

@Aryan1Mahahjan
Copy link
Author

So, Majority of the tests are passing.
image
There is a 1 failed test and 1 Error.
image

@EwoutH
Copy link
Member

EwoutH commented Jul 9, 2024

In CI all the tests are passing, so and the warnings are unrelated to this PR. So test-wise we’re good!

Could you update the title of the PR and add a screenshot of how it now looks to the first PR message?

@Aryan1Mahahjan Aryan1Mahahjan changed the title Draft: Visualisation: Allow different shapes agent portrayals#2164 Visualisation: Allow different shapes agent portrayals#2164 Jul 9, 2024
@Aryan1Mahahjan
Copy link
Author

image

image

@EwoutH
Copy link
Member

EwoutH commented Jul 9, 2024

Sorry, I mean a screenshot of how the visualisation looks with different shapes, to show that it works.

@Aryan1Mahahjan
Copy link
Author

Sorry, I mean a screenshot of how the visualisation looks with different shapes, to show that it works.

How should show or generate visualization looks with different is their a test or dataset to show?

@EwoutH
Copy link
Member

EwoutH commented Jul 10, 2024

You could adapt an example model, like: https://github.com/projectmesa/mesa-examples/tree/main/examples/boltzmann_wealth_model_experimental

Or create a simple model yourself.

@EwoutH
Copy link
Member

EwoutH commented Aug 12, 2024

@Aryan1Mahahjan would you still like to work on this?

@EwoutH
Copy link
Member

EwoutH commented Aug 27, 2024

This now has been solved in #2214.

@EwoutH EwoutH closed this Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants