Interface IterateStop

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 exactly n times. 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 Classes
    Modifier and Type
    Interface
    Description
    static final record 
    UNTIL c, … WITHIN ε PER k, … MAX n ROUNDS — stop when, for every key, every named column changed by at most tolerance since the previous round, and no key appeared or disappeared.
    static final record 
    ROUNDS n — apply the step exactly n times; ROUNDS 0 is the base unchanged.
    static final record 
    UNTIL STABLE MAX n ROUNDS — stop at the first round whose output equals its input.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    The clause as a report shows it — ROUNDS 10, UNTIL STABLE MAX 50 ROUNDS, UNTIL rank WITHIN 0.0001 PER node MAX 100 ROUNDS.
    int
    The round cap the iteration may not exceed, or — for IterateStop.Rounds — the exact number of rounds it runs.
  • Method Details

    • rounds

      int rounds()
      The round cap the iteration may not exceed, or — for IterateStop.Rounds — the exact number of rounds it runs.
      Returns:
      a non-negative round count
    • clause

      default String 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