mtc_observercomputation.h
Go to the documentation of this file.
1 /** @file op_observercomputation.h
2 
3 Methods to compute natural projections that exhibit the obsrver property.
4 The observer algorithm is elaborated in
5 K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event
6 Systems," Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
7 and the natural observer algorithm is presented in
8 Feng, Lei and Wonham, W., "On the Computation of Natural Observers in Discrete-Event Systems", Discrete Event Dynamic Systems, 2009.
9 In addition, methods to compute natural projections that exhibit
10 output control consistency (OCC) and local control consistency (LCC) are provided. See for example
11 K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
12 Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
13 */
14 
15 /* FAU Discrete Event Systems Library (libfaudes)
16 
17  Copyright (C) 2006 Bernd Opitz
18  Exclusive copyright is granted to Klaus Schmidt
19 
20  This library is free software; you can redistribute it and/or
21  modify it under the terms of the GNU Lesser General Public
22  License as published by the Free Software Foundation; either
23  version 2.1 of the License, or (at your option) any later version.
24 
25  This library is distributed in the hope that it will be useful,
26  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  Lesser General Public License for more details.
29 
30  You should have received a copy of the GNU Lesser General Public
31  License along with this library; if not, write to the Free Software
32  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
33 
34 #ifndef FAUDES_MTCOBSERVERVERCOMPUTATION_H
35 #define FAUDES_MTCOBSERVERVERCOMPUTATION_H
36 
37 #include "corefaudes.h"
38 #include "op_include.h"
39 #include "mtc_generator.h"
40 //#include "mtc_debug.h"
41 
42 
43 
44 using namespace faudes;
45 
46 namespace faudes {
47  /**
48  * Calculate a colored natural observer by extending a given high-level alphabet.
49  * This function extends a given high-level alphabet such that the corresponding natural
50  * projection becomes a colored observer for a given colored marking generator.
51  * The function calls the function ExtendHighAlphabet in the Observer plugin.
52  *
53  * @param rGen
54  * input colored marking generator
55  * @param rHighAlph
56  * high-level alphabet that is extended towards a colored observer
57  * @return
58  * number of states of the high-level colored marking generator
59  *
60  * <h4>Example: Computation of an Lm-observer</h4>
61  * <table border=0> <tr> <td> <table>
62  * <tr> <td> Original generator </td> </tr>
63  * <tr>
64  * <td> @image html tmp_mtc_cb4mh1d1_1_sup.png </td>
65  * </tr>
66  * <tr>
67  * <td> Original high-level alphabet (rHighAlph): cb4-cb12, cb12-cb4, cb11-cb4, cb4-cb11 </td> </tr>
68  * </table> </td> </tr> <tr> <td> <table width=100%>
69  * <tr> <td> Result of calcNaturalObserver(rGenObs, rHighAlph); </td> </tr>
70  * <tr> <td> New high-level alphabet (rNewHighAlph): cb4-cb12, cb12-cb4, cb11-cb4, cb4-cb11, mh1end </td> </tr>
71  * <tr> <td> @image html tmp_mtc_cb4mh1d1_2.png </td> </tr>
72  * </table> </td> </tr> </table>
73  *
74  * @ingroup MultitaskingPlugin
75  */
76  Idx calcNaturalObserver(const MtcSystem& rGen, EventSet& rHighAlph);
77 
78  /**
79  * Lm-observer computation.
80  * This function modifies a given generator and an associated natural projection
81  * such that the resulting natural projection is an Lm-observer for the language marked by
82  * the resulting generator.
83  * This function evaluates the observer algorithm as described in
84  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
85  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
86  *
87  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
88  * rGenObs must be a deterministic generator.
89  * There are no further restrictions on parameters.
90  *
91  * @param rGenObs
92  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
93  * @param rHighAlph
94  * Initial abstraction alphabet
95  * @param rNewHighAlph
96  * Modified abstraction alphabet such that the abstraction is an Lm-observer
97  * @param rMapRelabeledEvents
98  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
99  *
100  * @ingroup ObserverPlugin
101  */
102  void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
103 
104  /**
105  * Lm-observer computation.
106  * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents).
107  * It modifies a given generator and an associated natural projection
108  * such that the resulting natural projection is an Lm-observer for the language marked by
109  * the resulting generator.
110  * This function evaluates the observer algorithm as described in
111  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
112  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
113  *
114  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
115  * rGenObs must be a deterministic generator
116  * no further restrictions on parameters.
117  *
118  * @param rGenObs
119  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
120  * @param rControllableEvents
121  * Set of controllable events
122  * @param rHighAlph
123  * Initial abstraction alphabet
124  * @param rNewHighAlph
125  * Modified abstraction alphabet such that the abstraction is an Lm-observer
126  * @param rMapRelabeledEvents
127  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
128  */
129  void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
130 
131  /**
132  * Lm-observer computation.
133  * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents).
134  * It modifies a given generator and an associated natural projection
135  * such that the resulting natural projection is an Lm-observer for the language marked by
136  * the resulting generator.
137  * This function evaluates the observer algorithm as described in
138  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
139  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
140  *
141  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
142  * rGenObs must be a deterministic generator.
143  * There are no further restrictions on parameters.
144  *
145  * @param rGenObs
146  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
147  * @param rControllableEvents
148  * Set of controllable events
149  * @param rHighAlph
150  * Initial abstraction alphabet
151  * @param rNewHighAlph
152  * Modified abstraction alphabet such that the abstraction is an Lm-observer
153  * @param rMapChangedTrans
154  * Maps the original relabeled transitions to the new events
155  */
156  void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
157 
158  /**
159  * Computation of the dynamic system for an Lm-observer.
160  * This function computes the dynamic system that is needed for evaluating the observer
161  * algorithm.
162  *
163  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
164  * rGen must be a deterministic generator.
165  * There are no further restrictions on parameters.
166  *
167  * @param rGen
168  * Generator for which the dynamic system is computed
169  * @param rHighAlph
170  * Abstraction alphabet
171  * @param rGenDyn
172  * Generator representing the dynamic system
173  */
174  void calculateDynamicSystemObs(const MtcSystem& rGen, EventSet& rHighAlph, Generator& rGenDyn);
175 
176 
177 }
178 
179 
180 #endif
181 

libFAUDES 2.24g --- 2014.09.15 --- c++ api documentaion by doxygen