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 
45 namespace faudes {
46  /**
47  * Calculate a colored natural observer by extending a given high-level alphabet.
48  * This function extends a given high-level alphabet such that the corresponding natural
49  * projection becomes a colored observer for a given colored marking generator.
50  * The function calls the function ExtendHighAlphabet in the Observer plugin.
51  *
52  * @param rGen
53  * input colored marking generator
54  * @param rHighAlph
55  * high-level alphabet that is extended towards a colored observer
56  * @return
57  * number of states of the high-level colored marking generator
58  *
59  * <h4>Example: Computation of an Lm-observer</h4>
60  * <table border=0> <tr> <td> <table>
61  * <tr> <td> Original generator </td> </tr>
62  * <tr>
63  * <td> @image html tmp_mtc_cb4mh1d1_1_sup.png </td>
64  * </tr>
65  * <tr>
66  * <td> Original high-level alphabet (rHighAlph): cb4-cb12, cb12-cb4, cb11-cb4, cb4-cb11 </td> </tr>
67  * </table> </td> </tr> <tr> <td> <table width=100%>
68  * <tr> <td> Result of calcNaturalObserver(rGenObs, rHighAlph); </td> </tr>
69  * <tr> <td> New high-level alphabet (rNewHighAlph): cb4-cb12, cb12-cb4, cb11-cb4, cb4-cb11, mh1end </td> </tr>
70  * <tr> <td> @image html tmp_mtc_cb4mh1d1_2.png </td> </tr>
71  * </table> </td> </tr> </table>
72  *
73  * @ingroup MultitaskingPlugin
74  */
75  extern FAUDES_API Idx calcNaturalObserver(const MtcSystem& rGen, EventSet& rHighAlph);
76 
77  /**
78  * Lm-observer computation.
79  * This function modifies a given generator and an associated natural projection
80  * such that the resulting natural projection is an Lm-observer for the language marked by
81  * the resulting generator.
82  * This function evaluates the observer algorithm as described in
83  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
84  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
85  *
86  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
87  * rGenObs must be a deterministic generator.
88  * There are no further restrictions on parameters.
89  *
90  * @param rGenObs
91  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
92  * @param rHighAlph
93  * Initial abstraction alphabet
94  * @param rNewHighAlph
95  * Modified abstraction alphabet such that the abstraction is an Lm-observer
96  * @param rMapRelabeledEvents
97  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
98  *
99  * @ingroup ObserverPlugin
100  */
101  void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
102 
103  /**
104  * Lm-observer computation.
105  * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents).
106  * It modifies a given generator and an associated natural projection
107  * such that the resulting natural projection is an Lm-observer for the language marked by
108  * the resulting generator.
109  * This function evaluates the observer algorithm as described in
110  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
111  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
112  *
113  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
114  * rGenObs must be a deterministic generator
115  * no further restrictions on parameters.
116  *
117  * @param rGenObs
118  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
119  * @param rControllableEvents
120  * Set of controllable events
121  * @param rHighAlph
122  * Initial abstraction alphabet
123  * @param rNewHighAlph
124  * Modified abstraction alphabet such that the abstraction is an Lm-observer
125  * @param rMapRelabeledEvents
126  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
127  */
128  extern FAUDES_API void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
129 
130  /**
131  * Lm-observer computation.
132  * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents).
133  * It modifies a given generator and an associated natural projection
134  * such that the resulting natural projection is an Lm-observer for the language marked by
135  * the resulting generator.
136  * This function evaluates the observer algorithm as described in
137  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
138  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
139  *
140  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
141  * rGenObs must be a deterministic generator.
142  * There are no further restrictions on parameters.
143  *
144  * @param rGenObs
145  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
146  * @param rControllableEvents
147  * Set of controllable events
148  * @param rHighAlph
149  * Initial abstraction alphabet
150  * @param rNewHighAlph
151  * Modified abstraction alphabet such that the abstraction is an Lm-observer
152  * @param rMapChangedTrans
153  * Maps the original relabeled transitions to the new events
154  */
155  extern FAUDES_API void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
156 
157  /**
158  * Computation of the dynamic system for an Lm-observer.
159  * This function computes the dynamic system that is needed for evaluating the observer
160  * algorithm.
161  *
162  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
163  * rGen must be a deterministic generator.
164  * There are no further restrictions on parameters.
165  *
166  * @param rGen
167  * Generator for which the dynamic system is computed
168  * @param rHighAlph
169  * Abstraction alphabet
170  * @param rGenDyn
171  * Generator representing the dynamic system
172  */
173  extern FAUDES_API void calculateDynamicSystemObs(const MtcSystem& rGen, EventSet& rHighAlph, Generator& rGenDyn);
174 
175 
176 }
177 
178 
179 #endif
180 
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
Includes all libFAUDES headers, no plugins.
NameSet EventSet
Convenience typedef for plain event sets.
Definition: cfl_nameset.h:531
vGenerator Generator
Plain generator, api typedef for generator with no attributes.
void calcAbstAlphObs(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
Lm-observer computation.
Int calcNaturalObserver(const Generator &rGen, EventSet &rHighAlph)
Lm(G)-observer computation by adding events to the high-level alphabet.
Methods for handling multitasking generators.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
TmtcGenerator< AttributeVoid, AttributeColoredState, AttributeCFlags, AttributeVoid > MtcSystem
void calculateDynamicSystemObs(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
Computation of the dynamic system for Delta_obs (local reachability of a marked state).
Includes all observer plugin headers.

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen