mtc_observercomputation.h

Go to the documentation of this file.
00001 /** @file op_observercomputation.h 
00002 
00003 Methods to compute natural projections that exhibit the obsrver 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 and the natural observer algorithm is presented in
00008 Feng, Lei   and Wonham, W., "On the Computation of Natural Observers in Discrete-Event Systems", Discrete Event Dynamic Systems, 2009. 
00009 In addition, methods to compute natural projections that exhibit
00010 output control consistency (OCC) and local control consistency (LCC) are provided. See for example
00011 K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
00012 Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 
00013 */
00014 
00015 /* FAU Discrete Event Systems Library (libfaudes)
00016 
00017    Copyright (C) 2006  Bernd Opitz
00018    Exclusive copyright is granted to Klaus Schmidt
00019 
00020    This library is free software; you can redistribute it and/or
00021    modify it under the terms of the GNU Lesser General Public
00022    License as published by the Free Software Foundation; either
00023    version 2.1 of the License, or (at your option) any later version.
00024 
00025    This library is distributed in the hope that it will be useful,
00026    but WITHOUT ANY WARRANTY; without even the implied warranty of
00027    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00028    Lesser General Public License for more details.
00029 
00030    You should have received a copy of the GNU Lesser General Public
00031    License along with this library; if not, write to the Free Software
00032    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00033 
00034 #ifndef FAUDES_MTCOBSERVERVERCOMPUTATION_H
00035 #define FAUDES_MTCOBSERVERVERCOMPUTATION_H
00036 
00037 #include "corefaudes.h"
00038 #include "op_include.h"
00039 #include "mtc_generator.h"
00040 //#include "mtc_debug.h"
00041 
00042 
00043 
00044 using namespace faudes;
00045 
00046 namespace faudes {
00047   /**
00048   * Calculate a colored natural observer by extending a given high-level alphabet.
00049   * This function extends a given high-level alphabet such that the corresponding natural
00050   * projection becomes a colored observer for a given colored marking generator. 
00051   * The function calls the function ExtendHighAlphabet in the Observer plugin. 
00052   *
00053   * @param rGen
00054   *  input colored marking generator
00055   * @param rHighAlph
00056   *  high-level alphabet that is extended towards a colored observer
00057   * @return
00058   *  number of states of the high-level colored marking generator
00059   *
00060   * <h4>Example: Computation of an Lm-observer</h4>
00061   * <table border=0> <tr> <td> <table>
00062   * <tr> <td> Original generator </td>  </tr>
00063   * <tr>
00064   * <td> @image html tmp_mtc_cb4mh1d1_1_sup.png </td>
00065   * </tr>
00066   * <tr>
00067       * <td> Original high-level alphabet (rHighAlph): cb4-cb12, cb12-cb4, cb11-cb4, cb4-cb11 </td> </tr>
00068   * </table> </td> </tr> <tr> <td> <table width=100%>
00069   * <tr> <td> Result of calcNaturalObserver(rGenObs, rHighAlph); </td> </tr>
00070   * <tr> <td> New high-level alphabet (rNewHighAlph): cb4-cb12, cb12-cb4, cb11-cb4, cb4-cb11, mh1end </td> </tr>
00071   * <tr> <td> @image html tmp_mtc_cb4mh1d1_2.png </td> </tr>
00072   * </table> </td> </tr> </table>
00073   *
00074   * @ingroup MultitaskingPlugin 
00075   */
00076   Idx calcNaturalObserver(const MtcSystem& rGen, EventSet& rHighAlph);
00077 
00078   /**
00079   * Lm-observer computation.
00080   * This function modifies a given generator and an associated natural projection
00081   * such that the resulting natural projection is an Lm-observer for the language marked by 
00082   * the resulting generator. 
00083   * This function evaluates the observer algorithm as described in 
00084   * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 
00085   * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 
00086   *
00087   * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
00088   * rGenObs must be a deterministic generator.
00089   * There are no further restrictions on parameters.
00090   *
00091   * @param rGenObs
00092   *    Low-level generator. It is modified by the algorithm by relabeling transitions and events
00093   * @param rHighAlph
00094   *    Initial abstraction alphabet
00095   * @param rNewHighAlph
00096   *    Modified abstraction alphabet such that the abstraction is an Lm-observer
00097   * @param rMapRelabeledEvents
00098   *    Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
00099   *
00100   * @ingroup ObserverPlugin
00101   */
00102   void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >&  rMapRelabeledEvents);
00103 
00104    /**
00105   * Lm-observer computation.
00106   * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >&  rMapRelabeledEvents).
00107   * It modifies a given generator and an associated natural projection
00108   * such that the resulting natural projection is an Lm-observer for the language marked by 
00109   * the resulting generator. 
00110   * This function evaluates the observer algorithm as described in 
00111   * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 
00112   * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 
00113   *
00114   * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
00115   * rGenObs must be a deterministic generator
00116   * no further restrictions on parameters.
00117     *
00118     * @param rGenObs
00119     *    Low-level generator. It is modified by the algorithm by relabeling transitions and events
00120     * @param rControllableEvents
00121     *    Set of controllable events 
00122     * @param rHighAlph
00123     *    Initial abstraction alphabet
00124     * @param rNewHighAlph
00125     *    Modified abstraction alphabet such that the abstraction is an Lm-observer
00126     * @param rMapRelabeledEvents
00127     *    Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
00128     */
00129   void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >&  rMapRelabeledEvents);
00130 
00131    /**
00132   * Lm-observer computation.
00133   * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >&  rMapRelabeledEvents).
00134   * It modifies a given generator and an associated natural projection
00135   * such that the resulting natural projection is an Lm-observer for the language marked by 
00136   * the resulting generator. 
00137   * This function evaluates the observer algorithm as described in 
00138   * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems," 
00139   * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004. 
00140   *
00141   * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
00142   * rGenObs must be a deterministic generator.
00143   * There are no further restrictions on parameters.
00144     *
00145     * @param rGenObs
00146     *    Low-level generator. It is modified by the algorithm by relabeling transitions and events
00147     * @param rControllableEvents
00148     *    Set of controllable events 
00149     * @param rHighAlph
00150     *    Initial abstraction alphabet
00151     * @param rNewHighAlph
00152     *    Modified abstraction alphabet such that the abstraction is an Lm-observer
00153     * @param rMapChangedTrans
00154     *    Maps the original relabeled transitions to the new events
00155     */
00156   void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
00157 
00158    /**
00159     * Computation of the dynamic system for an Lm-observer.
00160     * This function computes the dynamic system that is needed for evaluating the observer 
00161     * algorithm.
00162     *
00163     * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
00164   * rGen must be a deterministic generator.
00165   * There are no further restrictions on parameters.
00166   *
00167     * @param rGen
00168     *    Generator for which the dynamic system is computed
00169     * @param rHighAlph
00170     *    Abstraction alphabet
00171     * @param rGenDyn
00172     *    Generator representing the dynamic system
00173     */
00174     void calculateDynamicSystemObs(const MtcSystem& rGen, EventSet& rHighAlph, Generator& rGenDyn);
00175 
00176 
00177 }
00178 
00179 
00180 #endif 
00181  

libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen