obs_1_simple.cpp

Go to the documentation of this file.
00001 /** @file syn_1_simple.cpp
00002 
00003 Tutorial, std monolitic synthesis. 
00004 
00005 
00006 This tutorial uses a very simple example to illustrate the 
00007 std monolithic controller synthesis
00008 as originally proposed by Ramadge and Wonham.
00009 
00010 
00011 @ingroup Tutorials 
00012 
00013 @include syn_1_simple.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   System plant, spec;
00033   EventSet highAlph, obsAlph;
00034   // The first plant/spec violates the condition
00035   plant.Read("data/generator1.gen");
00036   plant.GraphWrite("data/generator1.png");
00037   spec.Read("data/generator1.gen");
00038   highAlph.Read("data/highAlph1.alph");
00039   obsAlph.Read("data/obs1.alph");
00040   bool result = LocalObservationConsistency(plant,spec,highAlph,obsAlph);
00041   std::cout << "result for generator1 is: " << result << std::endl;
00042   // The second plant/spec fulfills the condition
00043   plant.Read("data/generator2.gen");
00044   plant.GraphWrite("data/generator2.png");
00045   spec.Read("data/generator2.gen");
00046   result = LocalObservationConsistency(plant,spec,highAlph,obsAlph);
00047   std::cout << "result for generator2 is: " << result << std::endl;
00048 
00049   return 0;
00050 }
00051 

libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen