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

Ordered execution of Init/Step/Exit/ExitCondition functions #708

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

ptheywood
Copy link
Member

Use std::vector instead of std::set for insertion-ordered execution of host functions.

This means that init/step/exit functiond and exit condition functions are executed in the order they are added to the model, rather then the previous sorted by function pointer order.

Closes #707

This may potentially influence the results of models, so is a potentailly breaking change.

Copy link
Member

@Robadob Robadob left a comment

Choose a reason for hiding this comment

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

Looks good.

Could be worth updating docs to specify the order thing, I had assumed there was a note about lack of order. But apparently not.

https://docs.flamegpu.com/guide/3-behaviour-definition/6-host-functions.html

@Robadob Robadob self-requested a review October 8, 2021 08:50
Copy link
Member

@Robadob Robadob left a comment

Choose a reason for hiding this comment

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

https://github.com/FLAMEGPU/FLAMEGPU2/blob/master/include/flamegpu/model/ModelDescription.h

The doc comments for add init/step/exit all have a @note about order not being guarnteed. This should be updated

@ptheywood
Copy link
Member Author

Could be worth updating docs to specify the order thing, I had assumed there was a note about lack of order. But apparently not.

I'd assumed it was in the docs not docblocks too, and was going to sort after it was merged. Will update the docblocks and open a PR against the userguide too.

@ptheywood ptheywood requested a review from Robadob October 8, 2021 09:42
Copy link
Member

@Robadob Robadob left a comment

Choose a reason for hiding this comment

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

gj

@ptheywood
Copy link
Member Author

Related Docs PR is in: FLAMEGPU/FLAMEGPU2-docs#63.

Should be merged after this has passed CI and been merged.

@ptheywood ptheywood changed the title Ordered execution of Init/Step/Exit/ExifCondition functions Ordered execution of Init/Step/Exit/ExitCondition functions Oct 13, 2021
@ptheywood ptheywood added this to the v2.0.0-alpha.2 milestone Oct 13, 2021
@mondus mondus merged commit 7f24b3d into master Oct 13, 2021
@mondus mondus deleted the ordered-host-fns branch October 13, 2021 12:05
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.

Ordered Init/Step/Exit/ExitCondition Functions
3 participants