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

Order of exitCondition functions. #270

Closed
ptheywood opened this issue May 15, 2020 · 4 comments · Fixed by #412
Closed

Order of exitCondition functions. #270

ptheywood opened this issue May 15, 2020 · 4 comments · Fixed by #412

Comments

@ptheywood
Copy link
Member

ptheywood commented May 15, 2020

Exit conditions are not executed in the order they are added to the model.

This is unintuivite (although not sure why anyone would actually have two which are order dependent..., i'm abusing it for testing purposes)

This should be well documented or changed to preserve order of adding to the model.

i.e.

FLAMEGPU_EXIT_CONDITION(exitCondition_a) {
    printf("a\n");
    return CONTINUE;
}
FLAMEGPU_EXIT_CONDITION(exitCondition_b) {
    printf("b\n");
    return CONTINUE;
}
// ...
model.addExitCondition(exitCondition_b);
model.addExitCondition(exitCondition_a);
// ...

will produce

a
b

I.e. it appears to be order of definition, not order of adding to the model.

Edit it does not appear to always be order of deinition either:

FLAMEGPU_EXIT_CONDITION(exitCondition_testGetStepCounter) {
printf("a\n");
return CONTINUE;
}
FLAMEGPU_EXIT_CONDITION(exitCondition_increase_expectStepCounter) {
printf("b\n");
return CONTINUE
}
// ...
model.addExitCondition(exitCondition_testGetStepCounter);
model.addExitCondition(exitCondition_increase_expectStepCounter);
// ...
b
a

Edit: Currently, regular exit conditions are called prior to any python(maybe RTC?) exit conditions, which would also warrent documentation.

@Robadob
Copy link
Member

Robadob commented May 15, 2020 via email

@ptheywood
Copy link
Member Author

In which case it needs clearly documenting.

@Robadob
Copy link
Member

Robadob commented May 15, 2020

Happy for you to add layers to init/exit functions if you think it's justified.

@Robadob
Copy link
Member

Robadob commented Jun 27, 2020

In which case it needs clearly documenting.

Related to issue #268 which also calls for Exit condition documentation (for a different reason).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants