Skip to main content

hydr_structures/structures/actuator/
position.rs

1//! Explicit finite-rate actuator position contracts.
2
3/// Finite represented opening and certified enclosure of the ideal response.
4#[derive(Clone, Copy, Debug, PartialEq)]
5pub struct GateActuatorPosition {
6    /// Represented actual opening in metres, inside its certified enclosure.
7    pub opening_m: f64,
8    /// Certified finite lower bound on ideal actual opening, in metres.
9    pub lower_opening_m: f64,
10    /// Certified finite upper bound on ideal actual opening, in metres.
11    pub upper_opening_m: f64,
12    /// Finite bound covering both center-to-endpoint distances, in metres.
13    pub absolute_error_m: f64,
14}
15
16/// Original target-episode epoch and complete inherited position uncertainty.
17#[derive(Clone, Copy, Debug, PartialEq)]
18pub struct GateActuatorAnchor {
19    /// Original accepted or retained event time in seconds.
20    pub time_s: f64,
21    /// Complete represented opening and inherited certified uncertainty.
22    pub position: GateActuatorPosition,
23}
24
25/// Exact finite time difference represented by high and signed low components.
26#[derive(Clone, Copy, Debug, PartialEq)]
27pub struct GateActuatorTimeExpansion {
28    /// Rounded high component of the original time difference.
29    pub high_s: f64,
30    /// Signed finite TwoSum residual completing the exact time difference.
31    pub low_s: f64,
32}
33
34/// Arrival classification relative to retained completion and support certificates.
35#[derive(Clone, Copy, Debug, PartialEq, Eq)]
36pub enum GateActuatorPhase {
37    /// Accepted time precedes the certified earliest arrival boundary.
38    BeforeWindow,
39    /// Accepted time lies inside the unresolved finite arrival window.
40    InsideWindow,
41    /// A retained analytic or forward-singleton proof certifies all-position completion.
42    Complete,
43    /// A lower certificate proves no arrival within remaining support.
44    BeyondHorizon,
45    /// Every admitted position lies strictly on the same zero-rate side.
46    Stalled,
47    /// Some enclosed positions cannot reach target while others can arrive or already equal it.
48    UnresolvedWithStalledSupport,
49}
50
51/// Certified opening support, independent of rounded center equality.
52#[derive(Clone, Copy, Debug, PartialEq, Eq)]
53pub enum GateActuatorSupport {
54    /// Canonical zero opening, zero singleton enclosure, and zero error.
55    ExactClosed,
56    /// The certified lower opening bound is strictly positive.
57    CertainlyPositive,
58    /// The certified interval includes both zero and positive support.
59    ClosureUnresolved,
60}
61
62/// Explicit current position, support, and effective arrival-window projection.
63#[derive(Clone, Debug, PartialEq)]
64pub struct GateActuatorOutput {
65    /// Index in the complete original structure context, never a compact subset index.
66    pub element: usize,
67    /// Exact actuator identity in immutable definition order.
68    pub actuator_id: String,
69    /// Exact identity of the bound original gate.
70    pub structure_id: String,
71    /// Original accepted or retained event time in seconds.
72    pub time_s: f64,
73    /// Original active target in metres, inside the actual gate range.
74    pub target_opening_m: f64,
75    /// Complete represented opening and inherited certified uncertainty.
76    pub position: GateActuatorPosition,
77    /// Current arrival/completion classification within declared support.
78    pub phase: GateActuatorPhase,
79    /// Certified closed, positive, or unresolved opening support.
80    pub support: GateActuatorSupport,
81    /// Effective finite earliest arrival bound, absent without a finite window.
82    pub arrival_lower_s: Option<f64>,
83    /// Effective finite latest arrival bound, tightened only by certified completion.
84    pub arrival_upper_s: Option<f64>,
85}