hydr 0.3.0

Hydrology and hydraulic simulation on numr runtimes
Documentation
//! Original-bit inputs and frozen sampled-control histories.
use super::types::{Case, Decision, Sample, Timer};
use hydr::structures::{ControlCommand, ControlLatch, ControlPending};

pub const CASES: &[Case] = &[
    Case {
        family: "relay",
        id: "late_sample_allowance_boundary",
        lower: f64::from_bits(0x3ff0000000000000),
        upper: f64::from_bits(0x4000000000000000),
        high_delay: f64::from_bits(0x3ff0000000000000),
        low_delay: f64::from_bits(0x3ff0000000000000),
        maximum_gap: f64::from_bits(0x3ff8000000000000),
        lateness: f64::from_bits(0x3fe0000000000000),
        low_command: ControlCommand::PumpStoppedIsolated,
        high_command: ControlCommand::PumpRunning {
            speed_ratio: f64::from_bits(0x3ff0000000000000),
        },
        start: f64::from_bits(0x0000000000000000),
        end: f64::from_bits(0x4014000000000000),
        decision_times: &[
            f64::from_bits(0x3ff0000000000000),
            f64::from_bits(0x4004000000000000),
            f64::from_bits(0x400c000000000000),
            f64::from_bits(0x4014000000000000),
        ],
        initial_latch: ControlLatch::Low,
        initial_pending: None,
        antecedent: None,
        initial_transition: None,
        binding: "success",
        binding_element: None,
        decisions: &[
            Decision {
                sample: Sample {
                    observed: f64::from_bits(0x3ff0000000000000),
                    available: f64::from_bits(0x3ff0000000000000),
                    stage: f64::from_bits(0x4000000000000000),
                },
                expected: "success",
                latch: ControlLatch::Low,
                pending: Some(ControlPending {
                    target: ControlLatch::High,
                    since_s: f64::from_bits(0x3ff0000000000000),
                }),
                transition_count: 0,
                transitioned: false,
                qualifies: true,
                accepted_time: f64::from_bits(0x3ff0000000000000),
                timer: Some(Timer {
                    started: f64::from_bits(0x3ff0000000000000),
                    delay: f64::from_bits(0x3ff0000000000000),
                    high: f64::from_bits(0x0000000000000000),
                    low: f64::from_bits(0x0000000000000000),
                    ready: false,
                    allowed: Some((
                        f64::from_bits(0x3ff8000000000000),
                        f64::from_bits(0x0000000000000000),
                    )),
                    overflow: false,
                    within: true,
                }),
            },
            Decision {
                sample: Sample {
                    observed: f64::from_bits(0x4004000000000000),
                    available: f64::from_bits(0x4004000000000000),
                    stage: f64::from_bits(0x4000000000000000),
                },
                expected: "success",
                latch: ControlLatch::High,
                pending: None,
                transition_count: 1,
                transitioned: true,
                qualifies: true,
                accepted_time: f64::from_bits(0x4004000000000000),
                timer: Some(Timer {
                    started: f64::from_bits(0x3ff0000000000000),
                    delay: f64::from_bits(0x3ff0000000000000),
                    high: f64::from_bits(0x3ff8000000000000),
                    low: f64::from_bits(0x0000000000000000),
                    ready: true,
                    allowed: Some((
                        f64::from_bits(0x3ff8000000000000),
                        f64::from_bits(0x0000000000000000),
                    )),
                    overflow: false,
                    within: true,
                }),
            },
            Decision {
                sample: Sample {
                    observed: f64::from_bits(0x400c000000000000),
                    available: f64::from_bits(0x400c000000000000),
                    stage: f64::from_bits(0x3ff0000000000000),
                },
                expected: "success",
                latch: ControlLatch::High,
                pending: Some(ControlPending {
                    target: ControlLatch::Low,
                    since_s: f64::from_bits(0x400c000000000000),
                }),
                transition_count: 1,
                transitioned: false,
                qualifies: true,
                accepted_time: f64::from_bits(0x400c000000000000),
                timer: Some(Timer {
                    started: f64::from_bits(0x400c000000000000),
                    delay: f64::from_bits(0x3ff0000000000000),
                    high: f64::from_bits(0x0000000000000000),
                    low: f64::from_bits(0x0000000000000000),
                    ready: false,
                    allowed: Some((
                        f64::from_bits(0x3ff8000000000000),
                        f64::from_bits(0x0000000000000000),
                    )),
                    overflow: false,
                    within: true,
                }),
            },
            Decision {
                sample: Sample {
                    observed: f64::from_bits(0x4014000000000000),
                    available: f64::from_bits(0x4014000000000000),
                    stage: f64::from_bits(0x3ff0000000000000),
                },
                expected: "success",
                latch: ControlLatch::Low,
                pending: None,
                transition_count: 2,
                transitioned: true,
                qualifies: true,
                accepted_time: f64::from_bits(0x4014000000000000),
                timer: Some(Timer {
                    started: f64::from_bits(0x400c000000000000),
                    delay: f64::from_bits(0x3ff0000000000000),
                    high: f64::from_bits(0x3ff8000000000000),
                    low: f64::from_bits(0x0000000000000000),
                    ready: true,
                    allowed: Some((
                        f64::from_bits(0x3ff8000000000000),
                        f64::from_bits(0x0000000000000000),
                    )),
                    overflow: false,
                    within: true,
                }),
            },
        ],
    },
    Case {
        family: "relay",
        id: "explicit_initial_high_reversed_commands",
        lower: f64::from_bits(0x3ff0000000000000),
        upper: f64::from_bits(0x4000000000000000),
        high_delay: f64::from_bits(0x0000000000000000),
        low_delay: f64::from_bits(0x0000000000000000),
        maximum_gap: f64::from_bits(0x3ff0000000000000),
        lateness: f64::from_bits(0x0000000000000000),
        low_command: ControlCommand::PumpRunning {
            speed_ratio: f64::from_bits(0x3fe0000000000000),
        },
        high_command: ControlCommand::PumpStoppedIsolated,
        start: f64::from_bits(0x0000000000000000),
        end: f64::from_bits(0x4008000000000000),
        decision_times: &[
            f64::from_bits(0x3ff0000000000000),
            f64::from_bits(0x4000000000000000),
            f64::from_bits(0x4008000000000000),
        ],
        initial_latch: ControlLatch::High,
        initial_pending: None,
        antecedent: None,
        initial_transition: None,
        binding: "success",
        binding_element: None,
        decisions: &[
            Decision {
                sample: Sample {
                    observed: f64::from_bits(0x3ff0000000000000),
                    available: f64::from_bits(0x3ff0000000000000),
                    stage: f64::from_bits(0x4004000000000000),
                },
                expected: "success",
                latch: ControlLatch::High,
                pending: None,
                transition_count: 0,
                transitioned: false,
                qualifies: false,
                accepted_time: f64::from_bits(0x3ff0000000000000),
                timer: None,
            },
            Decision {
                sample: Sample {
                    observed: f64::from_bits(0x4000000000000000),
                    available: f64::from_bits(0x4000000000000000),
                    stage: f64::from_bits(0x3ff0000000000000),
                },
                expected: "success",
                latch: ControlLatch::Low,
                pending: None,
                transition_count: 1,
                transitioned: true,
                qualifies: true,
                accepted_time: f64::from_bits(0x4000000000000000),
                timer: Some(Timer {
                    started: f64::from_bits(0x4000000000000000),
                    delay: f64::from_bits(0x0000000000000000),
                    high: f64::from_bits(0x0000000000000000),
                    low: f64::from_bits(0x0000000000000000),
                    ready: true,
                    allowed: Some((
                        f64::from_bits(0x0000000000000000),
                        f64::from_bits(0x0000000000000000),
                    )),
                    overflow: false,
                    within: true,
                }),
            },
            Decision {
                sample: Sample {
                    observed: f64::from_bits(0x4008000000000000),
                    available: f64::from_bits(0x4008000000000000),
                    stage: f64::from_bits(0x4000000000000000),
                },
                expected: "success",
                latch: ControlLatch::High,
                pending: None,
                transition_count: 2,
                transitioned: true,
                qualifies: true,
                accepted_time: f64::from_bits(0x4008000000000000),
                timer: Some(Timer {
                    started: f64::from_bits(0x4008000000000000),
                    delay: f64::from_bits(0x0000000000000000),
                    high: f64::from_bits(0x0000000000000000),
                    low: f64::from_bits(0x0000000000000000),
                    ready: true,
                    allowed: Some((
                        f64::from_bits(0x0000000000000000),
                        f64::from_bits(0x0000000000000000),
                    )),
                    overflow: false,
                    within: true,
                }),
            },
        ],
    },
];