libFAUDES

Sections

Index

mtc_parallel.h

Go to the documentation of this file.
00001 /** @file mtc_parallel.h
00002 
00003 Methods for parallel composition of multitasking generators
00004 
00005 */
00006 
00007 /* FAU Discrete Event Systems Library (libfaudes)
00008 
00009    Copyright (C) 2008  Matthias Singer
00010    Copyright (C) 2007  Thomas Moor
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_MTCPARALLEL_H
00029 #define FAUDES_MTCPARALLEL_H
00030 
00031 #include "corefaudes.h"
00032 #include "mtc_generator.h"
00033 #include <stack>
00034 
00035 namespace faudes {
00036 
00037 /**
00038  * Parallel composition of two colored marking generators, controllability status is observed
00039  *
00040  * @param rGen1
00041  *   First mtcGenerator for parallel composition
00042  *
00043  * @param rGen2
00044  *   Second mtcGenerator for parallel composition
00045  *
00046  * @param rResGen
00047  *   mtcGenerator in which the result of the parallel composition is saved
00048  *
00049  * <h4>Example: Parallel composition of two colored marking generators</h4>
00050  * <table border=0> <tr> <td>
00051  *   <table width=100%>
00052  *     <tr> <td> <center> mtcGenerators for composition </center> </td> </tr>
00053  *     <tr> <td> @image html tmp_mtc_functions_4a_system.png </td> </tr>
00054        <tr> <td> @image html tmp_mtc_functions_4b_system.png </td> </tr>
00055  *     <tr> <td> <center> The left mtcGenerator contains only one colored state, state 2, whereas the right one possesses two color labels - one for each state. </center> </td> </tr>
00056  *   </table>
00057  *   </td> </tr>
00058  *   <tr> <td>
00059  *   <table width=100%>
00060  *     <tr> <td> <center> Result of the parallel composition </center> </td> </tr>
00061  *     <tr> <td> @image html tmp_mtc_functions_4c_parallel.png </td> </tr>
00062  *     <tr> <td> <center> The composed mtcGenerator contains all colors that appear in both single mtcGenerators.
00063 
00064 The single states are labeled with a color when both states to combine are labeled with it. A color label is also added when it occurs in one of the two currently regarded states to compose and, at the same time, it does not appear in the second single mtcGenerator. </center> </td> </tr>
00065  *   </table>
00066  *   </td> </tr>
00067  * </table>
00068  *
00069  * @ingroup MultitaskingPlugin
00070  */
00071 void mtcParallel(const mtcGenerator& rGen1, const mtcGenerator& rGen2,
00072     mtcGenerator& rResGen);
00073 
00074 /**
00075  * Parallel composition of two mtcGenerators
00076  *
00077  * @param rGen1
00078  *   First mtcGenerator for parallel composition
00079  *
00080  * @param rGen2
00081  *   Second mtcGenerator for parallel composition
00082  *
00083  * @param rReverseCompositionMap
00084  *
00085  * @param rResGen
00086  *   Generator in which the result of the parallel composition is saved
00087  */
00088 void mtcParallel(const mtcGenerator& rGen1, const mtcGenerator& rGen2,
00089     std::map< std::pair<Idx,Idx>, Idx>& rReverseCompositionMap, 
00090     mtcGenerator& rResGen);
00091 
00092 /**
00093  * Compose the color set for a state combined from two states in two distinct automata
00094  *
00095  * @param rGen1
00096  *   First mtcGenerator for parallel composition
00097  *
00098  * @param stdidx1
00099  *   Index to first mtcGenerator's current state
00100  *
00101  * @param colors1
00102  *   Color set of first mtcGenerator
00103  *
00104  * @param rGen2
00105  *   Second mtcGenerator for parallel composition
00106  *
00107  * @param stdidx2
00108  *   Index to second mtcGenerator's current state
00109  *
00110  * @param colors2
00111  *   Color set of second mtcGenerator
00112  *
00113  * @param composedSet
00114  *   Color set where composition colors will be inserted
00115  *
00116  * @exception Exception
00117  *   - Index not member of set (id 200)
00118  *   - Index not found in set (id 201)
00119  */
00120 void ComposedColorSet(const mtcGenerator& rGen1, const Idx stdidx1, ColorSet& colors1,
00121                       const mtcGenerator& rGen2, const Idx stdidx2, ColorSet& colors2,
00122                       ColorSet& composedSet);
00123 
00124 } // namespace faudes
00125 
00126 #endif

libFAUDES 2.16b --- 2010-9-8 --- c++ source docu by doxygen 1.6.3