syn_3_reduction.cppGo to the documentation of this file.00001 /** @file syn_3_reduction.cpp 00002 00003 Tutorial, std monolitic synthesis. 00004 00005 00006 This tutorial uses two simple examples to illustrate the 00007 application of supervisor reduction as initially proposed 00008 by Su and Wonham 00009 00010 00011 @ingroup Tutorials 00012 00013 @include syn_3_reduction.cpp 00014 00015 */ 00016 00017 #include "libfaudes.h" 00018 00019 00020 // we make the faudes namespace available to our program 00021 using namespace faudes; 00022 00023 00024 00025 00026 ///////////////// 00027 // main program 00028 ///////////////// 00029 00030 int main() { 00031 00032 // Needed generators 00033 System plant1, sup1, plant2, sup2, reduced1, reduced2; 00034 00035 // First example for supervisor reduction 00036 plant1.Read("data/plant1.gen"); 00037 plant1.Write("tmp_syn_3_plant1.gen"); 00038 sup1.Read("data/sup1.gen"); 00039 sup1.Write("tmp_syn_3_sup1.gen"); 00040 bool success = SupReduce(plant1,sup1,reduced1); 00041 reduced2.Write("tmp_syn_3_reduced1.gen"); 00042 // Report to console 00043 std::cout << "##############################################\n"; 00044 std::cout << "# tutorial, supervisor reduction successful: " << success << std::endl; 00045 reduced1.DWrite(); 00046 std::cout << "##############################################\n"; 00047 00048 // Second example for supervisor reduction 00049 plant2.Read("data/plant2.gen"); 00050 plant2.Write("tmp_syn_3_plant2.gen"); 00051 sup2.Read("data/sup2.gen"); 00052 sup2.Write("tmp_syn_3_sup2.gen"); 00053 success = SupReduce(plant2,sup2,reduced2); 00054 reduced2.Write("tmp_syn_3_reduced2.gen"); 00055 // Report to console 00056 std::cout << "##############################################\n"; 00057 std::cout << "# tutorial, supervisor reduction successful: " << success << std::endl; 00058 reduced2.DWrite(); 00059 std::cout << "##############################################\n"; 00060 return 0; 00061 } 00062 libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen |