Learn R Programming

resLIK (version 0.1.2)

rlcs_control: RLCS Control Surface

Description

The Control Surface integrates inputs from multiple reliability sensors (ResLik, TCS, Agreement) to issue a standardized control signal (PROCEED, DEFER, ABSTAIN). It uses a deterministic, rule-based logic to ensure safety and predictability.

Usage

rlcs_control(reslik, tcs = NULL, agreement = NULL, thresholds = list())

Value

A character vector of signals (same length as input batch).

Arguments

reslik

List. The output from the reslik() function.

tcs

List (Optional). The output from the tcs() function.

agreement

List (Optional). The output from the agreement() function.

thresholds

List. Custom thresholds to override defaults:

  • reslik_max_disc (default 3.0)

  • tcs_consistency (default 0.2)

  • agreement (default 0.3)

Details

Deterministic Control Surface

The logic implements a "Conservative OR" strategy:

  • ABSTAIN: Triggered if ResLik discrepancy exceeds reslik_max_disc. This indicates the input is fundamentally invalid (e.g., sensor failure).

  • DEFER: Triggered if TCS consistency is below tcs_consistency OR Agreement is below agreement. This indicates valid but unstable or conflicting data.

  • PROCEED: Default state if no negative flags are raised.

Examples

Run this code
# Mock Inputs
res_pass <- list(diagnostics = list(discrepancy = c(0.1), max_discrepancy = 0.1))
res_fail <- list(diagnostics = list(discrepancy = c(5.0), max_discrepancy = 5.0))
tcs_pass <- list(consistency = c(0.9))
tcs_fail <- list(consistency = c(0.1))

# Scenario 1: All Good
rlcs_control(res_pass, tcs_pass)

# Scenario 2: ResLik Fail -> ABSTAIN
rlcs_control(res_fail, tcs_pass)

# Scenario 3: TCS Fail -> DEFER
rlcs_control(res_pass, tcs_fail)

Run the code above in your browser using DataLab