From 96ce97299c1d6c82951ff0c550fcb34d5ee241e6 Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Thu, 31 Oct 2024 19:51:47 -0700 Subject: [PATCH] Corrected description of minSpacing parameter for actions --- docs/writing-reactors/actions.mdx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/writing-reactors/actions.mdx b/docs/writing-reactors/actions.mdx index 2b76a0683..1a7053ef6 100644 --- a/docs/writing-reactors/actions.mdx +++ b/docs/writing-reactors/actions.mdx @@ -174,16 +174,12 @@ For a **physical** action, the preliminary time is similar, except that _t_ is r If a `` has been declared, then it gives a minimum logical time interval between the tags of two subsequently scheduled events. If the preliminary time is closer than `` to the time of the previously -scheduled event (if there is one), then `` (if supported by the target) +scheduled event (if there is one), or if the preliminary time is earlier than +the previously scheduled event, then the time will be modified to enforce +the minimum spacing. The `` argument (if supported by the target) determines how the minimum spacing constraint is enforced. Note that "previously scheduled" here means specifically the tag resulting from -the most recent call to `lf_schedule` for the same action. -:::warning -Since calls to `lf_schedule` can specify arbitrary extra delays, -`` does not necessarily result in events with minimum spacing between them. -If your calls to `lf_schedule` result in monotonically increasing tags, however, you will -get events with minimum spacing between them. -::: +the most recent call to the schedule function for the same action. @@ -200,11 +196,16 @@ Note that while the `"defer"` policy is conservative in the sense that it does n -> The `` argument is currently not supported. +> The `` argument is currently not supported by cpp, ts, or rs. +For example, suppose the minimum spacing of a logical action is 10 ms and the policy is `"defer"`. +Suppose that in a reaction to `startup`, the logical action is scheduled with a delay of +100 ms, then again with a delay of 99 ms, and a third time with a delay of 101 ms. +The logical action will trigger at elapsed times 100 ms, 110 ms, and 120 ms. + ## Testing an Action for Presence {/* This looks like crap but what can you do?*/}