- All Known Implementing Classes:
IterateStop.Converged,IterateStop.Rounds,IterateStop.Stable
public sealed interface IterateStop
permits IterateStop.Rounds, IterateStop.Stable, IterateStop.Converged
When an
IterateNode stops.
The three permits are three different claims about the result, not three spellings of one:
IterateStop.Rounds—ROUNDS n: apply the step exactlyntimes. Repetition, with no claim that anything settled; it always finishes.IterateStop.Stable—UNTIL STABLE MAX n ROUNDS: stop when a round's output equals its input as a set.IterateStop.Converged—UNTIL c, … WITHIN ε PER k, … MAX n ROUNDS: stop when no row's value in any of the named columns moved by more thanεsince the previous round, rows being paired across rounds by the key columns.
The two UNTIL forms carry a mandatory round cap: unlike FIX,
a replace-each-round iteration can run for ever even over a finite set of
values, so a convergence test without a cap is refused by the grammar.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordUNTIL c, … WITHIN ε PER k, … MAX n ROUNDS— stop when, for every key, every named column changed by at mosttolerancesince the previous round, and no key appeared or disappeared.static final recordROUNDS n— apply the step exactlyntimes;ROUNDS 0is the base unchanged.static final recordUNTIL STABLE MAX n ROUNDS— stop at the first round whose output equals its input. -
Method Summary
Modifier and TypeMethodDescriptiondefault Stringclause()The clause as a report shows it —ROUNDS 10,UNTIL STABLE MAX 50 ROUNDS,UNTIL rank WITHIN 0.0001 PER node MAX 100 ROUNDS.introunds()The round cap the iteration may not exceed, or — forIterateStop.Rounds— the exact number of rounds it runs.
-
Method Details
-
rounds
int rounds()The round cap the iteration may not exceed, or — forIterateStop.Rounds— the exact number of rounds it runs.- Returns:
- a non-negative round count
-
clause
The clause as a report shows it —ROUNDS 10,UNTIL STABLE MAX 50 ROUNDS,UNTIL rank WITHIN 0.0001 PER node MAX 100 ROUNDS. Names are written as they were given, without the quoting a script needs for a reserved word; the pretty-printer is what produces re-parseable text.- Returns:
- the stop clause for display
-