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

Update EventQueueABM to multi-agent + make plotting and run model agnostic #1001

Merged
merged 75 commits into from
Mar 15, 2024

Conversation

Datseris
Copy link
Member

@Datseris Datseris commented Mar 10, 2024

This PR changes the EventQueueABM to use exclusively the @multiagent macro and the kindof shenanigans. That is because one cannot use multiple dispatch anyways in EventQueueABM to decide the event, so there is no obvious benefit in using Union type agents.

The PR also re-organizes the codebase.

Additionally, this PR makes the plotting and data collection codes model agnostic. Detaches them entirely from the internals of the AgentBasedModel type that is passed into the plotting recipe.

IT does the same for data collection and run!.

TODOs:

  • Finish Rock Paper Scissors example, make sure it works (without plotting)
  • Update plotting (working on it now)
  • Update tests
  • Ensure all other examples and visualizations work as expected.

@Tortar
Copy link
Member

Tortar commented Mar 10, 2024

allkinds should be available as soon as JuliaRegistries/General#102631 is merged

@Tortar
Copy link
Member

Tortar commented Mar 11, 2024

I think replicate! should be already good as it is, you just need to pass pos as a kwarg: replicate!(agent, model; pos=new_pos)

@Tortar
Copy link
Member

Tortar commented Mar 11, 2024

Released a new version of MixedStructTypes with the new function kindconstructor, which seems to me a good name because it is specific and explicit enough. If you find any instances of MixedStructTypes.constructor inside Agents, you should change that to the new name

@Datseris Datseris changed the title Finish/update EventQueueABM to multi-agent Update EventQueueABM to multi-agent + make plotting model agnostic Mar 11, 2024
@Datseris Datseris marked this pull request as ready for review March 15, 2024 10:48
Copy link
Member

@Tortar Tortar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great improvements!! I approve.

@Tortar
Copy link
Member

Tortar commented Mar 15, 2024

the test failure is no sense in the last commit, I just bumped the Agents.jl version

trying to rerun now

@Tortar
Copy link
Member

Tortar commented Mar 15, 2024

I try to merge if this resolves it, otherwise we make another PR

@Tortar Tortar merged commit 19464e6 into main Mar 15, 2024
1 of 5 checks passed
@Tortar Tortar deleted the annv6 branch March 15, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants