Skip to content

StopWhenAll/StopWhenAy skips side-effecting children #632

Description

@lkdvos

all and any are short-circuiting, such that if subcriteria are stateful, they can be gated by earlier predicates returning true or false.

For example, sc = StopAfterIteration(100) & StopWhenChangeLess(M, 1e-9) would have the first condition fire for iterations 1:99, never updating the stored state in the second condition, and then for iteration 100 the second condition would compare the current state with the first state, instead of the 99th.

Note that this is true for both any, all and _fast_any.


Disclaimer, was surfaced during AI-assisted session

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions