syn_3_reduction.cpp
Go to the documentation of this file.
1/** @file syn_3_reduction.cpp
2
3Tutorial, std monolitic synthesis.
4
5
6This tutorial uses two simple examples to illustrate the
7application of supervisor reduction as initially proposed
8by 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
21using namespace faudes;
22
23
24
25
26/////////////////
27// main program
28/////////////////
29
30int 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
void DWrite(const Type *pContext=0) const
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
void Write(const Type *pContext=0) const
bool SupReduce(const System &rPlantGen, const System &rSupGen, System &rReducedSup)
int main()

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen