op_observercomputation.hGo to the documentation of this file.00001 /** @file op_observercomputation.h 00002 00003 Methods to compute natural projections that exhibit the observer property. 00004 The observer algorithm is elaborated in 00005 K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event 00006 Systems," Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00007 In addition, methods to compute natural projections that exhibit 00008 output control consistency (OCC) and local control consistency (LCC) are provided. See for example 00009 K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00010 Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00011 Furthermore, an algorithm for computing natural observers without changing event labels as 00012 presented in 00013 Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems," 00014 Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006 00015 is implemented. 00016 */ 00017 00018 /* FAU Discrete Event Systems Library (libfaudes) 00019 00020 Copyright (C) 2006 Bernd Opitz 00021 Exclusive copyright is granted to Klaus Schmidt 00022 00023 This library is free software; you can redistribute it and/or 00024 modify it under the terms of the GNU Lesser General Public 00025 License as published by the Free Software Foundation; either 00026 version 2.1 of the License, or (at your option) any later version. 00027 00028 This library is distributed in the hope that it will be useful, 00029 but WITHOUT ANY WARRANTY; without even the implied warranty of 00030 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00031 Lesser General Public License for more details. 00032 00033 You should have received a copy of the GNU Lesser General Public 00034 License along with this library; if not, write to the Free Software 00035 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00036 00037 #include "corefaudes.h" 00038 #include "op_debug.h" 00039 #include "op_bisimulation.h" 00040 #include <map> 00041 #include <vector> 00042 #include <stack> 00043 00044 #ifndef FAUDES_OP_OBSERVERCOMPUTATION_H 00045 #define FAUDES_OP_OBSERVERCOMPUTATION_H 00046 00047 00048 00049 namespace faudes { 00050 00051 // ================================================================================================ 00052 // Functions that compute dynamic systems for different properties related to nonblocking and 00053 // maximally permissive hierarchical control 00054 // ================================================================================================ 00055 00056 00057 /** 00058 * Computation of the dynamic system for Delta_sigma (reachable states after the occurrence of one high-level event). 00059 * This function computes the part of the dynamic system that is needed for evaluating the observer 00060 * algorithm for closed languages. 00061 * 00062 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00063 * rGen must be a deterministic generator. 00064 * There are no further restrictions on parameters. 00065 * 00066 * @param rGen 00067 * Generator for which the dynamic system is computed 00068 * @param rHighAlph 00069 * Abstraction alphabet 00070 * @param rGenDyn 00071 * Generator representing the dynamic system 00072 */ 00073 void calculateDynamicSystemClosedObs(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn); 00074 // 00075 /** 00076 * Computation of the dynamic system for Delta_obs (local reachability of a marked state). 00077 * This function computes the part of the dynamic system that is needed for evaluating the observer 00078 * algorithm for marked languages. 00079 * 00080 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00081 * rGen must be a deterministic generator. 00082 * There are no further restrictions on parameters. 00083 * 00084 * @param rGen 00085 * Generator for which the dynamic system is computed 00086 * @param rHighAlph 00087 * Abstraction alphabet 00088 * @param rGenDyn 00089 * Generator representing the dynamic system 00090 */ 00091 void calculateDynamicSystemObs(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn); 00092 00093 /** 00094 * Computation of the dynamic system for Delta_msa (local fulfillment of the msa-observer property). 00095 * This function computes the part of the dynamic system that is needed for evaluating the observer 00096 * algorithm for msa-observers. 00097 * 00098 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00099 * rGen must be a deterministic generator. 00100 * There are no further restrictions on parameters. 00101 * 00102 * @param rGen 00103 * Generator for which the dynamic system is computed 00104 * @param rHighAlph 00105 * Abstraction alphabet 00106 * @param rGenDyn 00107 * Generator representing the dynamic system 00108 */ 00109 void calculateDynamicSystemMSA(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn); 00110 00111 /** 00112 * Check if the msa-observer conditions is fulfilled for a given state. 00113 * This function performs a forward reachability computation to determine 00114 * if the msa-observer condition is fulfilled for a given state. 00115 * 00116 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00117 * rGen must be a deterministic generator. 00118 * There are no further restrictions on parameters. 00119 * 00120 * @param rGen 00121 * Generator for which the dynamic system is computed 00122 * @param rHighAlph 00123 * Abstraction alphabet 00124 * @param currentState 00125 * Index of the state to be checked 00126 * @param rDoneStates 00127 * Set of already investigated states 00128 * @return 00129 * True if the condition is fulfilled, false otherwise 00130 */ 00131 bool recursiveCheckMSAForward(const Generator& rGen, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates); 00132 00133 /** 00134 * Check if the msa-observer conditions is fulfilled for a given state. 00135 * This function performs a backward reachability computation to determine 00136 * if the msa-observer condition is fulfilled for a given state. 00137 * 00138 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00139 * rGen must be a deterministic generator. 00140 * There are no further restrictions on parameters. 00141 * 00142 * @param rGen 00143 * Generator for which the dynamic system is computed 00144 * @param rRevTransSet 00145 * Reversely ordered transition relation 00146 * @param rHighAlph 00147 * Abstraction alphabet 00148 * @param currentState 00149 * Index of the state to be checked 00150 * @param rDoneStates 00151 * Set of already investigated states 00152 * @return 00153 * True if the condition is fulfilled, false otherwise 00154 */ 00155 bool recursiveCheckMSABackward(const Generator& rGen, const TransSetX2EvX1& rRevTransSet, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates); 00156 00157 /** 00158 * Computation of the dynamic system for Delta_lcc (fulfillment of the local control consistency property). 00159 * This function computes the part of the dynamic system that is needed for evaluating the observer 00160 * algorithm for local control consistency 00161 * 00162 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00163 * rGen must be a deterministic generator. 00164 * There are no further restrictions on parameters. 00165 * 00166 * @param rGen 00167 * Generator for which the dynamic system is computed 00168 * @param rControllableEvents 00169 * Set of controllable events 00170 * @param rHighAlph 00171 * Abstraction alphabet 00172 * @param rGenDyn 00173 * Generator representing the dynamic system 00174 */ 00175 void calculateDynamicSystemLCC(const Generator& rGen, const EventSet& rControllableEvents, const EventSet& rHighAlph, Generator& rGenDyn); 00176 00177 /** 00178 * Find states that fulfill the lcc condition. 00179 * This function performs a backward reachability computation to determine 00180 * states where the lcc condition is fulfilled 00181 * 00182 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00183 * rGen must be a deterministic generator. 00184 * There are no further restrictions on parameters. 00185 * 00186 * @param rRevTransSet 00187 * Reversely ordered transition relation 00188 * @param rControllableEvents 00189 * Set of controllable events 00190 * @param rHighAlph 00191 * Abstraction alphabet 00192 * @param currentState 00193 * Index of the start state of the backward reachability computation 00194 * @param rDoneStates 00195 * Set of already investigated states 00196 * @return 00197 * True if the condition is fulfilled, false otherwise 00198 */ 00199 void recursiveCheckLCC(const TransSetX2EvX1& rRevTransSet, const EventSet& rControllableEvents, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates); 00200 00201 // ================================================================================================ 00202 // Functions that extend a given abstraction alphabet to achieve the observer property 00203 // ================================================================================================ 00204 00205 00206 // \section ObserverF2 Functions that extend a given abstraction alphabet 00207 00208 00209 /** 00210 * L(G)-observer computation by adding events to the high-level alphabet. 00211 * This function extends a given high-level alphabet such that the resulting natural projection 00212 * is an L(G)-observer for the prefix-closed language of the given generator. 00213 * This function evaluates the natural observer algorithm as described in 00214 * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems," 00215 * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006 00216 * 00217 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00218 * rGenObs must be a deterministic generator. 00219 * There are no further restrictions on parameters. 00220 * 00221 * @param rGenObs 00222 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00223 * @param rHighAlph 00224 * Reference to the initial abstraction alphabet that is modified by the algorithm 00225 * @return 00226 * number of states of the high-level generator 00227 * 00228 * <h4>Example: Computation of an L(G)-observer</h4> 00229 * <table class="large_image_table"> <tr> <td> <table> 00230 * <tr> <td> Original generator </td> </tr> 00231 * <tr> 00232 * <td> @image html ex_natural_all.png </td> 00233 * </tr> 00234 * <tr> 00235 * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr> 00236 * </table> </td> </tr> <tr> <td> <table width=100%> 00237 * <tr> <td> Result of calcClosedObserver(rGenObs, rHighAlph); </td> </tr> 00238 * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, h </td> </tr> 00239 * <tr> <td> @image html ex_natural_closed_proj.png </td> </tr> 00240 * </table> </td> </tr> </table> 00241 * 00242 * @ingroup ObserverPlugin 00243 */ 00244 Idx calcClosedObserver(const Generator& rGenObs, EventSet& rHighAlph); 00245 00246 /** 00247 * Lm(G)-observer computation by adding events to the high-level alphabet. 00248 * This function extends a given high-level alphabet such that the resulting natural projection 00249 * is an Lm(G)-observer for the marked language of the given generator. 00250 * This function evaluates the natural observer algorithm as described in 00251 * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems," 00252 * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006 00253 * 00254 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00255 * rGenObs must be a deterministic generator. 00256 * There are no further restrictions on parameters. 00257 * 00258 * @param rGenObs 00259 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00260 * @param rHighAlph 00261 * Reference to the initial abstraction alphabet that is modified by the algorithm 00262 * @return 00263 * number of states of the high-level generator 00264 * 00265 * <h4>Example: Computation of an Lm(G)-observer</h4> 00266 * <table class="large_image_table"> <tr> <td> <table> 00267 * <tr> <td> Original generator </td> </tr> 00268 * <tr> 00269 * <td> @image html ex_natural_all.png </td> 00270 * </tr> 00271 * <tr> 00272 * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr> 00273 * </table> </td> </tr> <tr> <td> <table width=100%> 00274 * <tr> <td> Result of calcNaturalObserver(rGenObs, rHighAlph); </td> </tr> 00275 * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, delta, h </td> </tr> 00276 * <tr> <td> @image html ex_natural_obs_proj.png </td> </tr> 00277 * </table> </td> </tr> </table> 00278 * 00279 * @ingroup ObserverPlugin 00280 */ 00281 Int calcNaturalObserver(const Generator& rGenObs, EventSet& rHighAlph); 00282 00283 /** 00284 * Lm(G)-observer computation including local control consistency (LCC) by adding events to the high-level alphabet. 00285 * This function extends a given high-level alphabet such that the resulting natural projection 00286 * is an Lm(G)-observer and locally control consistent (lcc) for the marked language of the given generator. 00287 * This function evaluates the natural observer algorithm as described in 00288 * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems," 00289 * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006 00290 * and uses LCC as defined in 00291 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and 00292 * Modular Supervisory Control Approaches for Discrete Event Systems 00293 * 00294 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00295 * rGenObs must be a deterministic generator. 00296 * There are no further restrictions on parameters. 00297 * 00298 * @param rGen 00299 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00300 * @param rHighAlph 00301 * Reference to the initial abstraction alphabet that is modified by the algorithm 00302 * @param rControllableEvents 00303 * @return 00304 * number of states of the high-level generator 00305 * 00306 * <h4>Example: Computation of an Lm(G)-observer with LCC</h4> 00307 * <table class="large_image_table"> <tr> <td> <table> 00308 * <tr> <td> Original generator </td> </tr> 00309 * <tr> 00310 * <td> @image html ex_natural_all.png </td> 00311 * </tr> 00312 * <tr> 00313 * <td> Original high-level alphabet (rHighAlph): alpha, gamma; controllable events: a, f, g, h </td> </tr> 00314 * </table> </td> </tr> <tr> <td> <table width=100%> 00315 * <tr> <td> Result of calcNaturalObserverLCC(rGenObs, rControllableEvents, rHighAlph); </td> </tr> 00316 * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, delta, a, e, f, g, h </td> </tr> 00317 * <tr> <td> @image html ex_natural_obslcc_proj.png </td> </tr> 00318 * </table> </td> </tr> </table> 00319 * 00320 * @ingroup ObserverPlugin 00321 */ 00322 Int calcNaturalObserverLCC(const Generator& rGen, const EventSet& rControllableEvents, EventSet& rHighAlph); 00323 00324 /** 00325 * MSA-observer computation by adding events to the high-level alphabet. 00326 * This function extends a given high-level alphabet such that the resulting natural projection 00327 * is an MSA-observer for the marked language of the given generator. 00328 * This function adapts the natural observer algorithm as described in 00329 * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems," 00330 * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006 00331 * to the msa-obsever property. 00332 * 00333 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00334 * rGenObs must be a deterministic generator. 00335 * There are no further restrictions on parameters. 00336 * 00337 * @param rGen 00338 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00339 * @param rHighAlph 00340 * Reference to the initial abstraction alphabet that is modified by the algorithm 00341 * @return 00342 * number of states of the high-level generator 00343 * 00344 * <h4>Example: Computation of an msa-observer</h4> 00345 * <table class="large_image_table"> <tr> <td> <table> 00346 * <tr> <td> Original generator </td> </tr> 00347 * <tr> 00348 * <td> @image html ex_natural_all.png </td> 00349 * </tr> 00350 * <tr> 00351 * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr> 00352 * </table> </td> </tr> <tr> <td> <table width=100%> 00353 * <tr> <td> Result of calcMSAObserver(rGenObs, rHighAlph); </td> </tr> 00354 * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, h </td> </tr> 00355 * <tr> <td> @image html ex_natural_msa_proj.png </td> </tr> 00356 * </table> </td> </tr> </table> 00357 * 00358 * @ingroup ObserverPlugin 00359 */ 00360 Int calcMSAObserver(const Generator& rGen, EventSet& rHighAlph); 00361 00362 /** 00363 * MSA-observer computation including local control consistency (LCC) by adding events to the high-level alphabet. 00364 * This function extends a given high-level alphabet such that the resulting natural projection 00365 * is an MSA-observer and locally control consistent (lcc) for the marked language of the given generator. 00366 * This function adapts the natural observer algorithm as described in 00367 * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems," 00368 * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006 00369 * to the msa-obsever property and uses LCC as defined in 00370 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and 00371 * Modular Supervisory Control Approaches for Discrete Event Systems, 00372 * Workshop on Discrete Event Systems, 2008. 00373 * 00374 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00375 * rGenObs must be a deterministic generator. 00376 * There are no further restrictions on parameters. 00377 * 00378 * @param rGen 00379 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00380 * @param rControllableEvents 00381 * @param rHighAlph 00382 * Reference to the initial abstraction alphabet that is modified by the algorithm 00383 * @return 00384 * number of states of the high-level generator 00385 * 00386 * <h4>Example: Computation of an msa-observer with LCC</h4> 00387 * <table class="large_image_table"> <tr> <td> <table> 00388 * <tr> <td> Original generator </td> </tr> 00389 * <tr> 00390 * <td> @image html ex_natural_all.png </td> 00391 * </tr> 00392 * <tr> 00393 * <td> Original high-level alphabet (rHighAlph): alpha, gamma; controllable events: a, f, g, h </td> </tr> 00394 * </table> </td> </tr> <tr> <td> <table width=100%> 00395 * <tr> <td> Result of calcMSAObserverLCC(rGenObs, rControllableEvents, rHighAlph); </td> </tr> 00396 * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, a, e, f, g, h </td> </tr> 00397 * <tr> <td> @image html ex_natural_msalcc_proj.png </td> </tr> 00398 * </table> </td> </tr> </table> 00399 * 00400 * @ingroup ObserverPlugin 00401 */ 00402 Int calcMSAObserverLCC(const Generator& rGen, const EventSet& rControllableEvents, EventSet& rHighAlph); 00403 00404 /* 00405 00406 obsolet? 00407 00408 * Computation of the dynamic system for Delta_occ (fulfillment of the output control consistency property). 00409 * This function computes the part of the dynamic system that is needed for evaluating the observer 00410 * algorithm for output control consistency 00411 * 00412 * The alphabet rHighAlph has to be a subset of the alphabet of rGen. 00413 * rGen must be a deterministic generator. 00414 * There are no further restrictions on parameters. 00415 * 00416 * @param rGen 00417 * Generator for which the dynamic system is computed 00418 * @param rControllableEvents 00419 * Set of controllable events 00420 * @param rHighAlph 00421 * Abstraction alphabet 00422 * @param rGenDyn 00423 * Generator representing the dynamic system 00424 00425 void calculateDynamicSystemOCC(const Generator& rGen, EventSet& rControllableEvents, EventSet& rHighAlph, Generator& rGenDyn); 00426 00427 */ 00428 00429 /** 00430 * Extension of the high-level alphabet to achieve the Lm-observer property. 00431 * This algorithm extends the given high-level alphabet such that nondeterminism and unobservable 00432 * transitions in the quotient automaton computed with the current high-level alphabet are removed. 00433 * The function is called by calcNaturalObserver. 00434 * 00435 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00436 * rGenObs must be a deterministic generator. 00437 * There are no further restrictions on parameters. 00438 * 00439 * @param rGenObs 00440 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00441 * @param rHighAlph 00442 * Reference to the initial abstraction alphabet that is modified by the algorithm 00443 * @param rMapStateToPartition 00444 * Map from states in rGenObs to states (partitions) in the computed quotient automaton 00445 * 00446 * @ingroup ObserverPlugin 00447 */ 00448 void ExtendHighAlphabet(const Generator& rGenObs, EventSet& rHighAlph, std::map<Idx,Idx>& rMapStateToPartition); 00449 00450 /** 00451 * Check if the current alphabet splits all local automata with nondeterminims or unobservable transitions. 00452 * This algorithm verifies if nondetermisisms or unobservable transitions are resolved if the given events in 00453 * are added to the high-level alphabet. The function is called by ExtendHighAlphabet, 00454 * 00455 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00456 * rGenObs must be a deterministic generator. 00457 * There are no further restrictions on parameters. 00458 * 00459 * @param rGenObs 00460 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00461 * @param rSplitAlphabet 00462 * Reference to the current alphabet for splitting verification 00463 * @param rNondeterministicStates 00464 * vector with states where nondeterminism has to be resolved and the related event 00465 * @param entryState 00466 * current state that is investigated 00467 */ 00468 bool CheckSplit(const Generator& rGenObs, const EventSet& rSplitAlphabet, const std::vector<std::pair<StateSet, Idx> >& rNondeterministicStates, Idx entryState); 00469 00470 00471 // ================================================================================================ 00472 // Functions that modify the alphabet/transitions of the generator to achieve the observer property 00473 // ================================================================================================ 00474 00475 // \section ObserverF3 Functions that modify a given abstraction alphabet 00476 00477 00478 /** 00479 * L(G)-observer computation. 00480 * This function modifies a given generator and an associated natural projection 00481 * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of 00482 * the resulting generator. 00483 * This function evaluates the observer algorithm as described in 00484 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00485 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00486 * 00487 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00488 * rGenObs must be a deterministic generator. 00489 * There are no further restrictions on parameters. 00490 * 00491 * @param rGenObs 00492 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00493 * @param rHighAlph 00494 * Initial abstraction alphabet 00495 * @param rNewHighAlph 00496 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00497 * @param rMapRelabeledEvents 00498 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00499 * 00500 * <h4>Example: Computation of an L(G)-observer</h4> 00501 * <table class="large_image_table"> <tr> <td> <table> 00502 * <tr> <td> Generator with relabeled events </td> </tr> 00503 * <tr> 00504 * <td> @image html ex_relabel_closed_result.png </td> 00505 * </tr> 00506 * <tr> 00507 * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr> 00508 * </table> </td> </tr> <tr> <td> <table width=100%> 00509 * <tr> <td> Result of calcAbstAlphClosed(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr> 00510 * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr> 00511 * <tr> <td> @image html ex_relabel_closed_high.png</td> </tr> 00512 * </table> </td> </tr> </table> 00513 * 00514 * @ingroup ObserverPlugin 00515 */ 00516 void calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 00517 00518 /** 00519 * L(G)-observer computation. 00520 * This function is called by calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents). 00521 * It modifies a given generator and an associated natural projection 00522 * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of 00523 * the resulting generator. 00524 * This function evaluates the observer algorithm as described in 00525 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00526 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00527 * 00528 * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs 00529 * rGenObs must be a deterministic generator 00530 * no further restrictions on parameters. 00531 * 00532 * @param rGenObs 00533 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00534 * @param rControllableEvents 00535 * Set of controllable events 00536 * @param rHighAlph 00537 * Initial abstraction alphabet 00538 * @param rNewHighAlph 00539 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00540 * @param rMapRelabeledEvents 00541 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00542 */ 00543 void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 00544 00545 /** 00546 * L(G)-observer computation. 00547 * This function is called by void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents). 00548 * It modifies a given generator and an associated natural projection 00549 * such that the resulting natural projection is an Lm-observer for the prefix-closed language of 00550 * the resulting generator. 00551 * This function evaluates the observer algorithm as described in 00552 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00553 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00554 * 00555 * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs. 00556 * rGenObs must be a deterministic generator. 00557 * There are no further restrictions on parameters. 00558 * 00559 * @param rGenObs 00560 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00561 * @param rControllableEvents 00562 * Set of controllable events 00563 * @param rHighAlph 00564 * Initial abstraction alphabet 00565 * @param rNewHighAlph 00566 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00567 * @param rMapChangedTrans 00568 * Maps the original relabeled transitions to the new events 00569 */ 00570 void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans); 00571 00572 00573 /** 00574 * Lm-observer computation. 00575 * This function modifies a given generator and an associated natural projection 00576 * such that the resulting natural projection is an Lm-observer for the language marked by 00577 * the resulting generator. 00578 * This function evaluates the observer algorithm as described in 00579 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00580 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00581 * 00582 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00583 * rGenObs must be a deterministic generator. 00584 * There are no further restrictions on parameters. 00585 * 00586 * @param rGenObs 00587 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00588 * @param rHighAlph 00589 * Initial abstraction alphabet 00590 * @param rNewHighAlph 00591 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00592 * @param rMapRelabeledEvents 00593 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00594 * 00595 * <h4>Example: Computation of an Lm(G)-observer</h4> 00596 * <table class="large_image_table"> <tr> <td> <table> 00597 * <tr> <td> Generator with relabeled events </td> </tr> 00598 * <tr> 00599 * <td> @image html ex_relabel_obs_result.png </td> 00600 * </tr> 00601 * <tr> 00602 * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr> 00603 * </table> </td> </tr> <tr> <td> <table width=100%> 00604 * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr> 00605 * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr> 00606 * <tr> <td> @image html ex_relabel_obs_high.png </td> </tr> 00607 * </table> </td> </tr> </table> 00608 * 00609 * @ingroup ObserverPlugin 00610 */ 00611 void calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 00612 00613 /** 00614 * Lm-observer computation. 00615 * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents). 00616 * It modifies a given generator and an associated natural projection 00617 * such that the resulting natural projection is an Lm-observer for the language marked by 00618 * the resulting generator. 00619 * This function evaluates the observer algorithm as described in 00620 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00621 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00622 * 00623 * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs 00624 * rGenObs must be a deterministic generator 00625 * no further restrictions on parameters. 00626 * 00627 * @param rGenObs 00628 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00629 * @param rControllableEvents 00630 * Set of controllable events 00631 * @param rHighAlph 00632 * Initial abstraction alphabet 00633 * @param rNewHighAlph 00634 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00635 * @param rMapRelabeledEvents 00636 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00637 */ 00638 void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 00639 00640 /** 00641 * Lm-observer computation. 00642 * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents). 00643 * It modifies a given generator and an associated natural projection 00644 * such that the resulting natural projection is an Lm-observer for the language marked by 00645 * the resulting generator. 00646 * This function evaluates the observer algorithm as described in 00647 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00648 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00649 * 00650 * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs. 00651 * rGenObs must be a deterministic generator. 00652 * There are no further restrictions on parameters. 00653 * 00654 * @param rGenObs 00655 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00656 * @param rControllableEvents 00657 * Set of controllable events 00658 * @param rHighAlph 00659 * Initial abstraction alphabet 00660 * @param rNewHighAlph 00661 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00662 * @param rMapChangedTrans 00663 * Maps the original relabeled transitions to the new events 00664 */ 00665 void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans); 00666 00667 /** 00668 * MSA-observer computation. 00669 * This function modifies a given generator and an associated natural projection 00670 * such that the resulting natural projection is an msa-observer for the language marked by 00671 * the resulting generator. 00672 * This function evaluates the msa-observer algorithm as described in 00673 * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems," 00674 * Workshop on Discrete Event Systems, 2006. 00675 * 00676 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00677 * rGenObs must be a deterministic generator. 00678 * There are no further restrictions on parameters. 00679 * 00680 * @param rGenObs 00681 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00682 * @param rHighAlph 00683 * Initial abstraction alphabet 00684 * @param rNewHighAlph 00685 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00686 * @param rMapRelabeledEvents 00687 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00688 * 00689 * <h4>Example: Computation of an MSA-observer</h4> 00690 * <table class="large_image_table"> <tr> <td> <table> 00691 * <tr> <td> Generator with relabeled events </td> </tr> 00692 * <tr> 00693 * <td> @image html ex_relabel_msa_result.png </td> 00694 * </tr> 00695 * <tr> 00696 * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr> 00697 * </table> </td> </tr> <tr> <td> <table width=100%> 00698 * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr> 00699 * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr> 00700 * <tr> <td> @image html ex_relabel_msa_high.png </td> </tr> 00701 * </table> </td> </tr> </table> 00702 * 00703 * @ingroup ObserverPlugin 00704 */ 00705 void calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 00706 00707 /** 00708 * MSA-observer computation. 00709 * This function is called by calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents). 00710 * It modifies a given generator and an associated natural projection 00711 * such that the resulting natural projection is an MSA-observer for the language marked by 00712 * the resulting generator. 00713 * This function evaluates the observer algorithm as described in 00714 * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems," 00715 * Workshop on Discrete Event Systems, 2006. 00716 * 00717 * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs 00718 * rGenObs must be a deterministic generator 00719 * no further restrictions on parameters. 00720 * 00721 * @param rGenObs 00722 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00723 * @param rControllableEvents 00724 * Set of controllable events 00725 * @param rHighAlph 00726 * Initial abstraction alphabet 00727 * @param rNewHighAlph 00728 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00729 * @param rMapRelabeledEvents 00730 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00731 */ 00732 void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 00733 00734 /** 00735 * MSA-observer computation. 00736 * This function is called by void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents). 00737 * It modifies a given generator and an associated natural projection 00738 * such that the resulting natural projection is an MSA-observer for the language marked by 00739 * the resulting generator. 00740 * This function evaluates the observer algorithm as described in 00741 * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems," 00742 * Workshop on Discrete Event Systems, 2006. 00743 * 00744 * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs. 00745 * rGenObs must be a deterministic generator. 00746 * There are no further restrictions on parameters. 00747 * 00748 * @param rGenObs 00749 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00750 * @param rControllableEvents 00751 * Set of controllable events 00752 * @param rHighAlph 00753 * Initial abstraction alphabet 00754 * @param rNewHighAlph 00755 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00756 * @param rMapChangedTrans 00757 * Maps the original relabeled transitions to the new events 00758 */ 00759 void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans); 00760 00761 /** 00762 * Lm-observer computation including output control consistency (OCC). 00763 * This function modifies a given generator and an associated natural projection 00764 * such that the resulting natural projection is an Lm-observer for the language marked by 00765 * the resulting generator and at the same time fulfills the output control consistency 00766 * condition (OCC). 00767 * This function evaluates the observer algorithm as described in 00768 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00769 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00770 * with an extension to OCC as indicated in 00771 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00772 * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00773 * 00774 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00775 * rGenObs must be a deterministic generator. 00776 * There are no further restrictions on parameters. 00777 * 00778 * @param rGenObs 00779 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00780 * @param rHighAlph 00781 * Initial abstraction alphabet 00782 * @param rNewHighAlph 00783 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00784 * @param rMapRelabeledEvents 00785 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00786 * 00787 * <h4>Example: Computation of an Lm-observer with output control consistency (OCC)</h4> 00788 * <table class="large_image_table"> <tr> <td> <table> 00789 * <tr> <td> Generator with relabeled events </td> </tr> 00790 * <tr> 00791 * <td> @image html ex_observer_all.png </td> 00792 * </tr> 00793 * <tr> 00794 * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr> 00795 * </table> </td> </tr> <tr> <td> <table width=100%> 00796 * <tr> <td> Result of calcAbstAlphObsOCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr> 00797 * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_3, bNewHLevent_2, 00798 * cNewHLevent_2, eNewHLevent_3 </td> </tr> 00799 * <tr> <td> @image html ex_synthesis_occ_result.png </td> </tr> 00800 * </table> </td> </tr> </table> 00801 * 00802 * @ingroup ObserverPlugin 00803 */ 00804 // void calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx*/,std::set<Idx > > & rMapRelabeledEvents); 00805 00806 /* 00807 00808 * Lm-observer computation including output control consistency (OCC). 00809 * This function is called by calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents). 00810 * It modifies a given generator and an associated natural projection 00811 * such that the resulting natural projection is an Lm-observer for the language marked by 00812 * the resulting generator and at the same time fulfills the output control consistency 00813 * condition (OCC). 00814 * This function evaluates the observer algorithm as described in 00815 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00816 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00817 * with an extension to OCC as indicated in 00818 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00819 * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00820 * 00821 * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs. 00822 * rGenObs must be a deterministic generator. 00823 * There are no further restrictions on parameters. 00824 * 00825 * @param rGenObs 00826 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00827 * @param rControllableEvents 00828 * Set of controllable events 00829 * @param rHighAlph 00830 * Initial abstraction alphabet 00831 * @param rNewHighAlph 00832 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00833 * @param rMapChangedTrans 00834 * Maps the original relabeled transitions to the new events 00835 00836 void calcAbstAlphObsOCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans); 00837 */ 00838 00839 /** 00840 * Lm-observer computation including local control consistency (LCC). 00841 * This function modifies a given generator and an associated natural projection 00842 * such that the resulting natural projection is an Lm-observer for the language marked by 00843 * the resulting generator and at the same time fulfills the local control consistency 00844 * condition (LCC). 00845 * The function evaluates the observer algorithm as described in 00846 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00847 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00848 * with an extension to LCC as indicated in 00849 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00850 * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00851 * 00852 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00853 * rGenObs must be a deterministic generator. 00854 * There are no further restrictions on parameters. 00855 * 00856 * @param rGenObs 00857 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00858 * @param rHighAlph 00859 * Initial abstraction alphabet 00860 * @param rNewHighAlph 00861 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00862 * @param rMapRelabeledEvents 00863 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00864 * 00865 * <h4>Example: Computation of an Lm(G)-observer with local control consistency (LCC)</h4> 00866 * <table class="large_image_table"> <tr> <td> <table> 00867 * <tr> <td> Generator with relabeled events </td> </tr> 00868 * <tr> 00869 * <td> @image html ex_relabel_obslcc_result.png </td> 00870 * </tr> 00871 * <tr> 00872 * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr> 00873 * </table> </td> </tr> <tr> <td> <table width="100%"> 00874 * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr> 00875 * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1, 00876 * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr> 00877 * <tr> <td> @image html ex_relabel_obslcc_high.png </td> </tr> 00878 * </table> </td> </tr> </table> 00879 * 00880 * @ingroup ObserverPlugin 00881 */ 00882 void calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents); 00883 00884 /** 00885 * Lm-observer computation including local control consistency (LCC). 00886 * This function is called by calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents). 00887 * It modifies a given generator and an associated natural projection 00888 * such that the resulting natural projection is an Lm-observer for the language marked by 00889 * the resulting generator and at the same time fulfills the local control consistency 00890 * condition (LCC). 00891 * This function evaluates the observer algorithm as described in 00892 * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 00893 * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 00894 * with an extension to LCC as indicated in 00895 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00896 * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00897 * 00898 * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs. 00899 * rGenObs must be a deterministic generator. 00900 * There are no further restrictions on parameters. 00901 * 00902 * @param rGenObs 00903 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00904 * @param rControllableEvents 00905 * Set of controllable events 00906 * @param rHighAlph 00907 * Initial abstraction alphabet 00908 * @param rNewHighAlph 00909 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00910 * @param rMapChangedTrans 00911 * Maps the original relabeled transitions to the new events 00912 */ 00913 void calcAbstAlphObsLCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans); 00914 00915 /** 00916 * MSA-observer computation including local control consistency (LCC). 00917 * This function modifies a given generator and an associated natural projection 00918 * such that the resulting natural projection is an MSA-observer for the language marked by 00919 * the resulting generator and at the same time fulfills the local control consistency 00920 * condition (LCC). 00921 * This function evaluates the msa-observer algorithm as described in 00922 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and 00923 * Modular Supervisory Control Approaches for Discrete Event Systems, 00924 * Workshop on Discrete Event Systems, 2008. 00925 * with an extension to LCC as indicated in 00926 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00927 * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00928 * 00929 * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs. 00930 * rGenObs must be a deterministic generator. 00931 * There are no further restrictions on parameters. 00932 * 00933 * @param rGenObs 00934 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00935 * @param rHighAlph 00936 * Initial abstraction alphabet 00937 * @param rNewHighAlph 00938 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00939 * @param rMapRelabeledEvents 00940 * Maps the original events to sets of newly introduced events (accumulatoive, call clear before) 00941 * 00942 * <h4>Example: Computation of an MSA-observer with local control consistency (LCC)</h4> 00943 * <table class="large_image_table"> <tr> <td> <table> 00944 * <tr> <td> Generator with relabeled events </td> </tr> 00945 * <tr> 00946 * <td> @image html ex_relabel_msalcc_result.png </td> 00947 * </tr> 00948 * <tr> 00949 * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr> 00950 * </table> </td> </tr> <tr> <td> <table width=100%> 00951 * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr> 00952 * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1, 00953 * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr> 00954 * <tr> <td> @image html ex_relabel_msalcc_high.png </td> </tr> 00955 * </table> </td> </tr> </table> 00956 * 00957 * @ingroup ObserverPlugin 00958 */ 00959 void calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents); 00960 00961 /** 00962 * MSA-observer computation including local control consistency (LCC). 00963 * This function is called by calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents). 00964 * It modifies a given generator and an associated natural projection 00965 * such that the resulting natural projection is an MSA-observer for the language marked by 00966 * the resulting generator and at the same time fulfills the local control consistency 00967 * condition (LCC). 00968 * This function evaluates the observer algorithm as described in 00969 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and 00970 * Modular Supervisory Control Approaches for Discrete Event Systems, 00971 * Workshop on Discrete Event Systems, 2008. 00972 * with an extension to LCC as indicated in 00973 * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00974 * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00975 * 00976 * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs. 00977 * rGenObs must be a deterministic generator. 00978 * There are no further restrictions on parameters. 00979 * 00980 * @param rGenObs 00981 * Low-level generator. It is modified by the algorithm by relabeling transitions and events 00982 * @param rControllableEvents 00983 * Set of controllable events 00984 * @param rHighAlph 00985 * Initial abstraction alphabet 00986 * @param rNewHighAlph 00987 * Modified abstraction alphabet such that the abstraction is an Lm-observer 00988 * @param rMapChangedTrans 00989 * Maps the original relabeled transitions to the new events 00990 */ 00991 void calcAbstAlphMSALCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans); 00992 00993 /** 00994 * Relabeling algorithm for the computation of an Lm-observer. 00995 * This function checks the termination criterion of the observer algorithm. If required, transitions of 00996 * the input generator are relabeled. 00997 * 00998 * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenRelabel. 00999 * There are no further restrictions on parameters. 01000 * 01001 * @param rGenRelabel 01002 * Generator whose transitions are modified 01003 * @param rControllableEvents 01004 * Set of controllable events 01005 * @param rHighAlph 01006 * Abstraction alphabet 01007 * @param rNewPartitions 01008 * Vector containing the indices of the equivalence classes that partition the state space of rGenRelabel 01009 * @param rMapStateToPartition 01010 * Maps each state of rGenRelabel to an equivalence class that must also be contained in rNewPartitions 01011 * @param rMapChangedTransReverse 01012 * Maps the relabeled transitions to the original transitions 01013 * @param rMapChangedTrans 01014 * Maps the the modified original transitions to its new events 01015 * @param rMapRelabeledEvents 01016 * Maps the original events to the set of new events they were relabeled with 01017 */ 01018 bool relabel(Generator& rGenRelabel, EventSet& rControllableEvents, EventSet& rHighAlph, std::vector<Idx>& rNewPartitions, std::map<Idx,Idx>& rMapStateToPartition, std::map<Transition,Transition>& rMapChangedTransReverse, std::map<Transition,Idx>& rMapChangedTrans, std::map<Idx, EventSet>& rMapRelabeledEvents); 01019 01020 /** 01021 * Convenience function for relabeling events in a given generator. 01022 * This function inserts new events and respective transitions given by a relableing map 01023 * into a given generator. The function is used to adjust plant components to the relableing 01024 * from another plant component. 01025 * 01026 * Technical note: This version records newly inserted events incl. their respective controllability attribute 01027 * in the third parameter. T 01028 * 01029 * There are no restrictions on parameters. 01030 * 01031 * @param rGenPlant 01032 * Plant component automaton 01033 * @param rMapRelabeledEvents 01034 * Maps the original events to sets of newly introduced events 01035 * @param rNewEvents 01036 * Returns the newly inserted events (accumulative, call clear before) 01037 */ 01038 void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, Alphabet& rNewEvents); 01039 01040 /** 01041 * Convenience function for relabeling events in a given generator. 01042 * This function inserts new events and respective transitions given by a relableing map 01043 * into a given generator. 01044 * 01045 * Technical note: Recording of new events includes attributes, provided that the third parameter has a 01046 * compatible attribute type. 01047 * 01048 * There are no restrictions on parameters. 01049 * 01050 * @param rGenPlant 01051 * Plant component automaton 01052 * @param rMapRelabeledEvents 01053 * Maps the original events to sets of newly introduced events 01054 * @param rNewEvents 01055 * Returns the newly inserted events (accumulative, call clear before) 01056 */ 01057 void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, EventSet& rNewEvents); 01058 01059 /** 01060 * Convenience function for relabeling events in a given generator. 01061 * See insertRelabeledEvents(System&, const std::map<Idx, std::set<Idx> >&, Alphabet&) 01062 * 01063 * There are no restrictions on parameters. 01064 * 01065 * @param rGenPlant 01066 * Plant component automaton 01067 * @param rMapRelabeledEvents 01068 * maps the original events to sets of newly introduced events 01069 */ 01070 void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 01071 01072 01073 /** 01074 * Convenience function for relabeling events in a given generator. 01075 * See insertRelabeledEvents(Generator&, const std::map<Idx, std::set<Idx> >&, EventSet&) 01076 * 01077 * There are no restrictions on parameters. 01078 * 01079 * @param rGenPlant 01080 * Plant component automaton 01081 * @param rMapRelabeledEvents 01082 * maps the original events to sets of newly introduced events 01083 */ 01084 void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents); 01085 01086 01087 01088 /** 01089 * Rti convenience wrapper for relabeling maps. 01090 * 01091 * The observer plugin uses an STL map from integers to sets of integers 01092 * as re-labeling map. In order to support this data type in the libfaudes 01093 * run-time interface, we provide a wrapper class that is derived 01094 * from faudes Type. The implementation is minimla (no token io). 01095 * Later revisions may use a faudes set with set valued attributes. 01096 */ 01097 class EventRelabelMap : public Type { 01098 FAUDES_TYPE_DECLARATION(EventRelabelMap,EventRelabelMap,Type) 01099 public: 01100 // std faudes type 01101 EventRelabelMap(void); 01102 EventRelabelMap(const EventRelabelMap& rOther); 01103 virtual ~EventRelabelMap(void); 01104 virtual void Clear(void); 01105 // access data 01106 const std::map<Idx, std::set<Idx> >& StlMap(void) const; 01107 std::map<Idx, std::set<Idx> >& StlMap(void); 01108 void StlMap(const std::map<Idx, std::set<Idx> >& rMap); 01109 protected: 01110 // std faudes type 01111 virtual void DoAssign(const EventRelabelMap& rSrc); 01112 virtual bool DoEqual(const EventRelabelMap& rOther) const; 01113 // my data 01114 std::map<Idx, std::set<Idx> > mMap; 01115 }; 01116 01117 01118 /** 01119 * Rti convenience wrapper 01120 */ 01121 void calcAbstAlphObs( 01122 System& rGenObs, 01123 EventSet& rHighAlph, 01124 EventSet& rNewHighAlph, 01125 EventRelabelMap& rMapRelabeledEvents); 01126 01127 01128 /** 01129 * Rti convenience wrapper 01130 */ 01131 void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents, EventSet& rNewEvents); 01132 01133 /** 01134 * Rti convenience wrapper 01135 */ 01136 void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents); 01137 01138 01139 01140 01141 } // namespace 01142 01143 #endif 01144 libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen |