LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.supervisor.receding Namespace Reference

Classes

class  _Pending
 
class  Plan
 
class  ProposalContext
 
class  RecedingConfig
 
class  RecedingSupervisor
 
class  Source
 

Functions

np.ndarray realised_robustness (RecedingProblem problem, np.ndarray Y)
 

Variables

 Variant = Literal["shield", "always_on", "policy_only", "raw_trigger", "no_delay_comp"]
 
 Proposer = Callable[[ProposalContext], np.ndarray]
 

Detailed Description

Receding-horizon runtime assurance loop of the L4DC paper (LIRRA, Algorithm 1).

Per planning step ``k`` (period ``dt``), with measured synthesis-model state ``x_k``:

1. ``k = 0`` (``t = 0-``): solve the receding I-STL problem from ``x_0``; the plan is the
   first cached plan.
2. A solve whose result is due at ``k`` is validated (:func:`check_plan`, independent of the
   solver) and installed as the cached plan.
3. Otherwise the policy proposes ``N`` inputs rooted at ``x_k``; the proposal is accepted iff
   it is a feasible point of the synthesis problem (:func:`check_plan`); an accepted
   proposal becomes the cached plan.
4. If it is rejected, the vehicle flies the cached plan and a solve is requested, rooted at
   the cached nominal state ``d`` steps ahead (delay compensation, ``d`` = worst-case
   latency in steps, enforced by the Gurobi time limit). The shifted cached plan is a
   feasible MIP start of that request.

The mission reference ``(x_nom, u_nom)`` of every request and proposal is the nominal patrol
either rerooted at the plan's root state or clock-indexed from the episode start
(``RecedingConfig.reference``, :mod:`rl_stl.policies.nominal`). Clock indexing is by absolute
step, so a delay-compensated request rooted at ``k + d`` tracks ``x_nom(k + d + i)``.

Execution is nominal tube MPC: the command is ``u = u_hat_k + K (x_k - x_hat_k)`` around the
cached nominal ``(x_hat, u_hat)``; past the plan's end the terminal controller extends the
nominal inside its face set. Under the tube assumption (realised error inside ``Z``) the
cached plan is always a valid certificate, so no step is without a certified input.

Variants (``RecedingConfig.variant``) implement the paper baselines:

``shield``           the method above;
``always_on``        solve at every step (NAHS RTA), no policy;
``policy_only``      fly the proposal's first input unchecked;
``raw_trigger``      accept a proposal iff its nominal robustness (no tube, no terminal set,
                     no bounds) is ``>= delta``; otherwise as ``shield``;
``no_delay_comp``    as ``shield`` but the solve is rooted at the measured ``x_k`` and its plan
                     is time-aligned on arrival (``d`` steps late), without re-validation.

Function Documentation

◆ realised_robustness()

np.ndarray rl_stl.supervisor.receding.realised_robustness ( RecedingProblem  problem,
np.ndarray  Y 
)
Nominal robustness of psi at every window start of a measured output trace ``Y``.

Variable Documentation

◆ Proposer

rl_stl.supervisor.receding.Proposer = Callable[[ProposalContext], np.ndarray]

◆ Variant

rl_stl.supervisor.receding.Variant = Literal["shield", "always_on", "policy_only", "raw_trigger", "no_delay_comp"]