libFAUDES
Sections
Index
|
mtc_project.hGo to the documentation of this file.00001 /** @file mtc_project.h 00002 00003 Methods for computing the natural projection of multitasking generators 00004 00005 */ 00006 00007 /* FAU Discrete Event Systems Library (libfaudes) 00008 00009 Copyright (C) 2008 Matthias Singer 00010 Copyright (C) 2006 Bernd Opitz 00011 Exclusive copyright is granted to Klaus Schmidt 00012 00013 This library is free software; you can redistribute it and/or 00014 modify it under the terms of the GNU Lesser General Public 00015 License as published by the Free Software Foundation; either 00016 version 2.1 of the License, or (at your option) any later version. 00017 00018 This library is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 Lesser General Public License for more details. 00022 00023 You should have received a copy of the GNU Lesser General Public 00024 License along with this library; if not, write to the Free Software 00025 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00026 00027 00028 #ifndef FAUDES_MTCPROJECT_H 00029 #define FAUDES_MTCPROJECT_H 00030 00031 #include "corefaudes.h" 00032 #include "mtc_generator.h" 00033 #include "mtc_statemin.h" 00034 #include <stack> 00035 #include <list> 00036 00037 namespace faudes { 00038 00039 00040 /** 00041 * Make generator deterministic. (function wrapper) 00042 * 00043 * @param rGen 00044 * Reference to generator 00045 * @param rResGen 00046 * Reference to resulting deterministic generator 00047 * 00048 * <h4>Example: Converting a nondeterministic MtcSystem to a deterministic one </h4> 00049 * <table border=0> <tr> <td> 00050 * <table width=100%> 00051 * <tr> <td> <center> Original MtcSystem gen</center> </td> </tr> 00052 * <tr> <td> @image html tmp_mtc_functions_2a_nondet.png </td> </tr> 00053 * <tr> <td> <center> The MtcSystem contains two initial states and, leaving from state 2, it has two transitions containing the same event b which are leading to two separate states. </center> </td> </tr> 00054 * </table> 00055 * </td> </tr> 00056 * <tr> <td> 00057 * <table width=100%> 00058 * <tr> <td> <center> Result of the deterministic operation </center> </td> </tr> 00059 * <tr> <td> @image html tmp_mtc_functions_2b_det.png </td> </tr> 00060 * <tr> <td> <center> Both initial states are combined to a single one. All color labels appearing in all original states are adapted to the new initial state. Furthermore, states are merged in that way that the generator's language stays the same, but the generator gets deterministic. </center> </td> </tr> 00061 * </table> 00062 * </td> </tr> 00063 * </table> 00064 * 00065 * @ingroup MultitaskingPlugin 00066 */ 00067 void mtcDeterministic(const MtcSystem& rGen, MtcSystem& rResGen); 00068 00069 /** 00070 * Make generator deterministic. (function wrapper) 00071 * 00072 * The second parameter is an empty std::map<Idx,StateSet> which holds all 00073 * the pairs of new states and their respective power states set. This 00074 * is used as a so called "entry state map" for deterministic projected 00075 * generators. 00076 * 00077 * @param rGen 00078 * Reference to generator 00079 * @param rEntryStatesMap 00080 * Entry state map 00081 * @param rResGen 00082 * Reference to resulting deterministic generator 00083 */ 00084 void mtcDeterministic(const MtcSystem& rGen, std::map<Idx,StateSet>& rEntryStatesMap, 00085 MtcSystem& rResGen); 00086 00087 /** 00088 * Make generator deterministic. (real function) 00089 * 00090 * Second and third parameter hold the subsets + deterministic states 00091 * in vectors 00092 * 00093 * The multiway merge algorithm is based on a propsal in 00094 * "Ted Leslie, Efficient Approaches to Subset Construction, 00095 * Computer Science, University of Waterloo, 1995" 00096 * 00097 * @param rGen 00098 * Reference to generator 00099 * @param rPowerStates 00100 * Vector that holds the power states 00101 * @param rDetStates 00102 * Vector that holds the corresponding deterministic states 00103 * @param rResGen 00104 * Reference to resulting deterministic generator 00105 */ 00106 void mtcDeterministic(const MtcSystem& rGen, std::vector<StateSet>& rPowerStates, 00107 std::vector<Idx>& rDetStates, MtcSystem& rResGen); 00108 00109 /** 00110 * Project generator to alphabet rProjectAlphabet 00111 * 00112 * @param rGen 00113 * Reference to generator 00114 * @param rProjectAlphabet 00115 * Projection alphabet 00116 * 00117 * @ingroup MultitaskingPlugin 00118 */ 00119 void mtcProjectNonDet(MtcSystem& rGen, const EventSet& rProjectAlphabet); 00120 00121 /** 00122 * Project generator to alphabet rProjectAlphabet 00123 * 00124 * @param rGen 00125 * Reference to generator 00126 * @param rProjectAlphabet 00127 * Projection alphabet 00128 * @param rResGen 00129 * Reference to result 00130 * 00131 * @ingroup MultitaskingPlugin 00132 */ 00133 void mtcProjectNonDet(const MtcSystem& rGen, const EventSet& rProjectAlphabet, MtcSystem& rResGen); 00134 00135 /** 00136 * Minimized Deterministic projection. This function does not modify the MtcSystem. It calls project, determine and statemin. 00137 * 00138 * @param rGen 00139 * Reference to generator 00140 * @param rProjectAlphabet 00141 * Projection alphabet 00142 * @param rResGen 00143 * Reference to resulting deterministic generator 00144 * 00145 * <h4>Example: Projection of an MtcSystem to a specified alphabet </h4> 00146 * <table border=0> <tr> <td> 00147 * <table width=100%> 00148 * <tr> <td> <center> Original MtcSystem gen</center> </td> </tr> 00149 * <tr> <td> @image html tmp_mtc_functions_3a_system.png </td> </tr> 00150 * <tr> <td> <center> The projection alphabet contains the events {a, b, d}. </center> </td> </tr> 00151 * </table> 00152 * </td> </tr> 00153 * <tr> <td> 00154 * <table width=100%> 00155 * <tr> <td> <center> Result of the projection </center> </td> </tr> 00156 * <tr> <td> @image html tmp_mtc_functions_3b_projected.png </td> </tr> 00157 * <tr> <td> <center> The resulting MtcSystem contains all events that appear in the oringinal MtcSystem and in the specified alphabet. Moreover, the resulting MtcSystem is deterministic. </center> </td> </tr> 00158 * </table> 00159 * </td> </tr> 00160 * </table> 00161 * 00162 * @ingroup MultitaskingPlugin 00163 */ 00164 void mtcProject(const MtcSystem& rGen, const EventSet& rProjectAlphabet, MtcSystem& rResGen); 00165 00166 /** 00167 * Minimized Deterministic projection. Does not modify generator. 00168 * Calls project, determine and statemin. See functions for details. 00169 * 00170 * @param rGen 00171 * Reference to generator 00172 * @param rProjectAlphabet 00173 * Projection alphabet 00174 * @param rEntryStatesMap 00175 * Reference to entry states map, see Deterministic(..) (result) 00176 * @param rResGen 00177 * Reference to resulting deterministic generator (result) 00178 */ 00179 void mtcProject(const MtcSystem& rGen, const EventSet& rProjectAlphabet, 00180 std::map<Idx,StateSet>& rEntryStatesMap, MtcSystem& rResGen); 00181 00182 /** 00183 * Inverse projection. This adds selfloop transition at every state for 00184 * all missing events. 00185 * 00186 * @param rGen 00187 * Reference to generator 00188 * @param rProjectAlphabet 00189 * Alphabet for inverse projection 00190 * 00191 * <h4>Example: Inverse projection of an MtcSystem for a specified alphabet which is larger than the MtcSystem's one. </h4> 00192 * <table border=0> <tr> <td> 00193 * <table width=100%> 00194 * <tr> <td> <center> Original MtcSystem </center> </td> </tr> 00195 * <tr> <td> @image html tmp_mtc_functions_5_spec.png </td> </tr> 00196 * <tr> <td> <center> The projection alphabet contains the events {a, b, c}. </center> </td> </tr> 00197 * </table> 00198 * </td> </tr> 00199 * <tr> <td> 00200 * <table width=100%> 00201 * <tr> <td> <center> Result of the projection </center> </td> </tr> 00202 * <tr> <td> @image html tmp_mtc_functions_5_spec_invpro.png </td> </tr> 00203 * <tr> <td> <center> Events, that are not part of the MtcSystem's alphabet are inserted as self-loops into every state. </center> </td> </tr> 00204 * </table> 00205 * </td> </tr> 00206 * </table> 00207 * 00208 * @ingroup MultitaskingPlugin 00209 */ 00210 void mtcInvProject(MtcSystem& rGen, const EventSet& rProjectAlphabet); 00211 00212 /** 00213 * RTI wrapper. See mtcInvProject(MtcSystem&, const EventSet&). 00214 */ 00215 void mtcInvProject(const MtcSystem& rGen, const EventSet& rProjectAlphabet, MtcSystem& rResGen); 00216 00217 } // namespace faudes 00218 00219 #endif |
libFAUDES 2.22s --- 2013.10.07 --- c++ source docu by doxygen