mtc_parallel.h
Go to the documentation of this file.
1 /** @file mtc_parallel.h
2 
3 Methods for parallel composition of multitasking generators
4 
5 */
6 
7 /* FAU Discrete Event Systems Library (libfaudes)
8 
9  Copyright (C) 2008 Matthias Singer
10  Copyright (C) 2007 Thomas Moor
11  Exclusive copyright is granted to Klaus Schmidt
12 
13  This library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU Lesser General Public
15  License as published by the Free Software Foundation; either
16  version 2.1 of the License, or (at your option) any later version.
17 
18  This library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Lesser General Public License for more details.
22 
23  You should have received a copy of the GNU Lesser General Public
24  License along with this library; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
26 
27 
28 #ifndef FAUDES_MTCPARALLEL_H
29 #define FAUDES_MTCPARALLEL_H
30 
31 #include "corefaudes.h"
32 #include "mtc_generator.h"
33 #include <stack>
34 
35 namespace faudes {
36 
37 /**
38  * Parallel composition of two colored marking generators, controllability status is observed
39  *
40  * @param rGen1
41  * First MtcSystem for parallel composition
42  *
43  * @param rGen2
44  * Second MtcSystem for parallel composition
45  *
46  * @param rResGen
47  * MtcSystem in which the result of the parallel composition is saved
48  *
49  * <h4>Example: Parallel composition of two colored marking generators</h4>
50  * <table border=0> <tr> <td>
51  * <table width=100%>
52  * <tr> <td> <center> MtcSystems for composition </center> </td> </tr>
53  * <tr> <td> @image html tmp_mtc_functions_4a_system.png </td> </tr>
54  <tr> <td> @image html tmp_mtc_functions_4b_system.png </td> </tr>
55  * <tr> <td> <center> The left MtcSystem contains only one colored state, state 2, whereas the right one possesses two color labels - one for each state. </center> </td> </tr>
56  * </table>
57  * </td> </tr>
58  * <tr> <td>
59  * <table width=100%>
60  * <tr> <td> <center> Result of the parallel composition </center> </td> </tr>
61  * <tr> <td> @image html tmp_mtc_functions_4c_parallel.png </td> </tr>
62  * <tr> <td> <center> The composed MtcSystem contains all colors that appear in both single MtcSystems.
63 
64 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 MtcSystem. </center> </td> </tr>
65  * </table>
66  * </td> </tr>
67  * </table>
68  *
69  * @ingroup MultitaskingPlugin
70  */
71 extern FAUDES_API void mtcParallel(const MtcSystem& rGen1, const MtcSystem& rGen2,
72  MtcSystem& rResGen);
73 
74 /**
75  * Parallel composition of two MtcSystems
76  *
77  * @param rGen1
78  * First MtcSystem for parallel composition
79  *
80  * @param rGen2
81  * Second MtcSystem for parallel composition
82  *
83  * @param rReverseCompositionMap
84  *
85  * @param rResGen
86  * Generator in which the result of the parallel composition is saved
87  */
88 extern FAUDES_API void mtcParallel(const MtcSystem& rGen1, const MtcSystem& rGen2,
89  std::map< std::pair<Idx,Idx>, Idx>& rReverseCompositionMap,
90  MtcSystem& rResGen);
91 
92 /**
93  * Compose the color set for a state combined from two states in two distinct automata
94  *
95  * @param rGen1
96  * First MtcSystem for parallel composition
97  *
98  * @param stdidx1
99  * Index to first MtcSystem's current state
100  *
101  * @param colors1
102  * Color set of first MtcSystem
103  *
104  * @param rGen2
105  * Second MtcSystem for parallel composition
106  *
107  * @param stdidx2
108  * Index to second MtcSystem's current state
109  *
110  * @param colors2
111  * Color set of second MtcSystem
112  *
113  * @param composedSet
114  * Color set where composition colors will be inserted
115  *
116  * @exception Exception
117  * - Index not member of set (id 200)
118  * - Index not found in set (id 201)
119  */
120 extern FAUDES_API void ComposedColorSet(const MtcSystem& rGen1, const Idx stdidx1, ColorSet& colors1,
121  const MtcSystem& rGen2, const Idx stdidx2, ColorSet& colors2,
122  ColorSet& composedSet);
123 
124 } // namespace faudes
125 
126 #endif
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
Includes all libFAUDES headers, no plugins.
void mtcParallel(const MtcSystem &rGen1, const MtcSystem &rGen2, MtcSystem &rResGen)
Parallel composition of two colored marking generators, controllability status is observed.
Methods for handling multitasking generators.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
void ComposedColorSet(const MtcSystem &rGen1, const Idx sidx1, ColorSet &rColors1, const MtcSystem &rGen2, const Idx sidx2, ColorSet &rColors2, ColorSet &composedSet)
Compose the color set for a state combined from two states in two distinct automata.
TmtcGenerator< AttributeVoid, AttributeColoredState, AttributeCFlags, AttributeVoid > MtcSystem

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