syn_3_reduction.cpp
Go to the documentation of this file.
1 /** @file syn_3_reduction.cpp
2 
3 Tutorial, std monolitic synthesis.
4 
5 
6 This tutorial uses two simple examples to illustrate the
7 application of supervisor reduction as initially proposed
8 by Su and Wonham
9 
10 
11 @ingroup Tutorials
12 
13 @include syn_3_reduction.cpp
14 
15 */
16 
17 #include "libfaudes.h"
18 
19 
20 // we make the faudes namespace available to our program
21 using namespace faudes;
22 
23 
24 
25 
26 /////////////////
27 // main program
28 /////////////////
29 
30 int main() {
31 
32  // Needed generators
33  System plant1, sup1, plant2, sup2, reduced1, reduced2;
34 
35  // First example for supervisor reduction
36  plant1.Read("data/plant1.gen");
37  plant1.Write("tmp_syn_3_plant1.gen");
38  sup1.Read("data/sup1.gen");
39  sup1.Write("tmp_syn_3_sup1.gen");
40  bool success = SupReduce(plant1,sup1,reduced1);
41  reduced2.Write("tmp_syn_3_reduced1.gen");
42  // Report to console
43  std::cout << "##############################################\n";
44  std::cout << "# tutorial, supervisor reduction successful: " << success << std::endl;
45  reduced1.DWrite();
46  std::cout << "##############################################\n";
47 
48  // Second example for supervisor reduction
49  plant2.Read("data/plant2.gen");
50  plant2.Write("tmp_syn_3_plant2.gen");
51  sup2.Read("data/sup2.gen");
52  sup2.Write("tmp_syn_3_sup2.gen");
53  success = SupReduce(plant2,sup2,reduced2);
54  reduced2.Write("tmp_syn_3_reduced2.gen");
55  // Report to console
56  std::cout << "##############################################\n";
57  std::cout << "# tutorial, supervisor reduction successful: " << success << std::endl;
58  reduced2.DWrite();
59  std::cout << "##############################################\n";
60  return 0;
61 }
62 
Generator with controllability attributes.
void DWrite(const Type *pContext=0) const
Write configuration data to console, debugging format.
Definition: cfl_types.cpp:225
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
Read configuration data from file with label specified.
Definition: cfl_types.cpp:261
void Write(const Type *pContext=0) const
Write configuration data to console.
Definition: cfl_types.cpp:139
bool SupReduce(const System &rPlantGen, const System &rSupGen, System &rReducedSup)
Supervisor Reduction algorithm.
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
int main()

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