Recurrence.rate: def of bend-kit-scheduler@0.4.1.0 Import: import bend-kit-scheduler@0.4.1.0/recurrence.bend as Recurrence Lines 41-46 of bend-kit-scheduler@0.4.1.0/recurrence.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-scheduler@0.4.1.0/recurrence.bend&start_line=41&end_line=46 import Base # A tick equal to completion is overdue. The already-completed previous tick # is excluded. A positive period keeps all arithmetic exact, without overflow. def rate(+previous: Nat, +completion: Nat, +period: Nat, policy: Missed) -> Plan: +overdue = Nat.div(Nat.sub(completion, previous), period) Planned{ticks(limit(policy, overdue), previous, period), Nat.add(previous, Nat.mul(1n+overdue, period))} Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bend-kit-scheduler@0.4.1.0/recurrence.bend&name=Missed https://jend.leeeet.dev/definition.txt?path=bend-kit-scheduler@0.4.1.0/recurrence.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=bend-kit-scheduler@0.4.1.0/recurrence.bend&name=limit https://jend.leeeet.dev/definition.txt?path=bend-kit-scheduler@0.4.1.0/recurrence.bend&name=ticks