|
| 1 | +============================= |
| 2 | +IMDP (``class IMDP``) |
| 3 | +============================= |
| 4 | + |
| 5 | +.. cpp:class:: IMDP : public MDP |
| 6 | + |
| 7 | + Interval MDP class for abstraction, controller synthesis, and data management. |
| 8 | + Inherits all functionality from :cpp:class:`MDP`. |
| 9 | + |
| 10 | + Defined in ``src/IMDP.h`` with implementations in ``src/IMDP.cpp``. |
| 11 | + |
| 12 | + Constructor |
| 13 | + ----------- |
| 14 | + |
| 15 | + Inherits the :cpp:class:`MDP` constructor: |
| 16 | + |
| 17 | + .. code-block:: cpp |
| 18 | +
|
| 19 | + IMDP imdp(dim_x, dim_u, dim_w); |
| 20 | +
|
| 21 | + Optimization Algorithm |
| 22 | + ---------------------- |
| 23 | + |
| 24 | + .. cpp:function:: void setAlgorithm(nlopt::algorithm alg) |
| 25 | + |
| 26 | + Set the nonlinear optimization algorithm used during abstraction. |
| 27 | + |
| 28 | + :param alg: An NLopt algorithm (default: ``nlopt::LN_SBPLX``). |
| 29 | + |
| 30 | + See `NLopt Algorithms <https://nlopt.readthedocs.io/en/latest/NLopt_Algorithms/>`_ |
| 31 | + for all options. |
| 32 | + |
| 33 | + Abstraction |
| 34 | + =========== |
| 35 | + |
| 36 | + Transition Matrix |
| 37 | + ----------------- |
| 38 | + |
| 39 | + .. cpp:function:: void minTransitionMatrix() |
| 40 | + |
| 41 | + Compute the minimal transition probability matrix for state-to-state transitions. |
| 42 | + |
| 43 | + .. cpp:function:: void maxTransitionMatrix() |
| 44 | + |
| 45 | + Compute the maximal transition probability matrix for state-to-state transitions. |
| 46 | + |
| 47 | + .. cpp:function:: void transitionMatrixBounds() |
| 48 | + |
| 49 | + Compute both min and max transition matrices efficiently. |
| 50 | + Exploits sparsity: if max is zero, min is skipped. Use this instead of |
| 51 | + calling ``minTransitionMatrix()`` and ``maxTransitionMatrix()`` separately. |
| 52 | + |
| 53 | + Target Transition Vector |
| 54 | + ------------------------ |
| 55 | + |
| 56 | + .. cpp:function:: void minTargetTransitionVector() |
| 57 | + |
| 58 | + Compute the minimal transition probability vector to the target region. |
| 59 | + |
| 60 | + .. cpp:function:: void maxTargetTransitionVector() |
| 61 | + |
| 62 | + Compute the maximal transition probability vector to the target region. |
| 63 | + |
| 64 | + .. cpp:function:: void targetTransitionVectorBounds() |
| 65 | + |
| 66 | + Compute both min and max target vectors efficiently with sparsity exploitation. |
| 67 | + |
| 68 | + Avoid Transition Vector |
| 69 | + ----------------------- |
| 70 | + |
| 71 | + .. cpp:function:: void minAvoidTransitionVector() |
| 72 | + |
| 73 | + Compute the minimal transition probability vector to outside the state space |
| 74 | + (including the avoid region). |
| 75 | + |
| 76 | + .. cpp:function:: void maxAvoidTransitionVector() |
| 77 | + |
| 78 | + Compute the maximal transition probability vector to outside the state space. |
| 79 | + |
| 80 | + .. note:: |
| 81 | + |
| 82 | + Avoid vectors are always required, even when no avoid region is defined, as they |
| 83 | + capture transitions out of the state space. |
| 84 | + |
| 85 | + Controller Synthesis |
| 86 | + ==================== |
| 87 | + |
| 88 | + All synthesis functions take ``IMDP_lower``: |
| 89 | + |
| 90 | + - ``true`` --- pessimistic (worst-case noise first, then fix for upper bound) |
| 91 | + - ``false`` --- optimistic (best-case noise first, then fix for lower bound) |
| 92 | + |
| 93 | + Standard Synthesis |
| 94 | + ------------------ |
| 95 | + |
| 96 | + .. cpp:function:: void infiniteHorizonReachController(bool IMDP_lower) |
| 97 | + |
| 98 | + Synthesize a reachability (or reach-avoid) controller over an infinite horizon |
| 99 | + using the interval iteration algorithm. |
| 100 | + |
| 101 | + .. cpp:function:: void infiniteHorizonSafeController(bool IMDP_lower) |
| 102 | + |
| 103 | + Synthesize a safety controller over an infinite horizon. |
| 104 | + |
| 105 | + .. cpp:function:: void finiteHorizonReachController(bool IMDP_lower, size_t timeHorizon) |
| 106 | + |
| 107 | + Synthesize a reachability (or reach-avoid) controller for a finite number of steps |
| 108 | + using value iteration. |
| 109 | + |
| 110 | + .. cpp:function:: void finiteHorizonSafeController(bool IMDP_lower, size_t timeHorizon) |
| 111 | + |
| 112 | + Synthesize a safety controller for a finite number of steps. |
| 113 | + |
| 114 | + Sorted Synthesis (GPU-Compatible) |
| 115 | + --------------------------------- |
| 116 | + |
| 117 | + Sorted variants eliminate the GLPK dependency and support GPU execution |
| 118 | + (implemented in ``src/GPU_synthesis.cpp``): |
| 119 | + |
| 120 | + .. cpp:function:: void infiniteHorizonReachControllerSorted(bool IMDP_lower) |
| 121 | + .. cpp:function:: void infiniteHorizonSafeControllerSorted(bool IMDP_lower) |
| 122 | + .. cpp:function:: void finiteHorizonReachControllerSorted(bool IMDP_lower, size_t timeHorizon) |
| 123 | + .. cpp:function:: void finiteHorizonSafeControllerSorted(bool IMDP_lower, size_t timeHorizon) |
| 124 | + |
| 125 | + .. cpp:function:: void finiteHorizonReachControllerSortedStoreMDP(bool IMDP_lower, size_t timeHorizon) |
| 126 | + |
| 127 | + Sorted finite-horizon reachability with intermediate MDP data storage. |
| 128 | + |
| 129 | + Save Functions |
| 130 | + ============== |
| 131 | + |
| 132 | + .. cpp:function:: void saveMinTransitionMatrix() |
| 133 | + .. cpp:function:: void saveMaxTransitionMatrix() |
| 134 | + .. cpp:function:: void saveMinTargetTransitionVector() |
| 135 | + .. cpp:function:: void saveMaxTargetTransitionVector() |
| 136 | + .. cpp:function:: void saveMinAvoidTransitionVector() |
| 137 | + .. cpp:function:: void saveMaxAvoidTransitionVector() |
| 138 | + .. cpp:function:: void saveController() |
| 139 | + |
| 140 | + Save the synthesized controller to ``controller.h5``. |
| 141 | + |
| 142 | + Load Functions |
| 143 | + ============== |
| 144 | + |
| 145 | + .. cpp:function:: void loadMinTransitionMatrix(string filename) |
| 146 | + .. cpp:function:: void loadMaxTransitionMatrix(string filename) |
| 147 | + .. cpp:function:: void loadMinTargetTransitionVector(string filename) |
| 148 | + .. cpp:function:: void loadMaxTargetTransitionVector(string filename) |
| 149 | + .. cpp:function:: void loadMinAvoidTransitionVector(string filename) |
| 150 | + .. cpp:function:: void loadMaxAvoidTransitionVector(string filename) |
| 151 | + .. cpp:function:: void loadController(string filename) |
| 152 | + |
| 153 | + Load a previously saved controller from HDF5. |
0 commit comments