obs_1_simple.cpp
Go to the documentation of this file.
1 /** @file syn_1_simple.cpp
2 
3 Tutorial, std monolitic synthesis.
4 
5 
6 This tutorial uses a very simple example to illustrate the
7 std monolithic controller synthesis
8 as originally proposed by Ramadge and Wonham.
9 
10 
11 @ingroup Tutorials
12 
13 @include syn_1_simple.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  System plant, spec;
33  EventSet highAlph, obsAlph;
34  // The first plant/spec violates the condition
35  plant.Read("data/generator1.gen");
36  plant.GraphWrite("data/generator1.png");
37  spec.Read("data/generator1.gen");
38  highAlph.Read("data/highAlph1.alph");
39  obsAlph.Read("data/obs1.alph");
40  bool result = LocalObservationConsistency(plant,spec,highAlph,obsAlph);
41  std::cout << "result for generator1 is: " << result << std::endl;
42  // The second plant/spec fulfills the condition
43  plant.Read("data/generator2.gen");
44  plant.GraphWrite("data/generator2.png");
45  spec.Read("data/generator2.gen");
46  result = LocalObservationConsistency(plant,spec,highAlph,obsAlph);
47  std::cout << "result for generator2 is: " << result << std::endl;
48 
49  return 0;
50 }
51 
Set of indices with symbolic names.
Definition: cfl_nameset.h:69
Generator with controllability attributes.
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 GraphWrite(const std::string &rFileName, const std::string &rOutFormat="", const std::string &rDotExec="dot") const
Produce graphical representation of this generator.
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
bool LocalObservationConsistency(const System &rPlantGen, const System &rSpecGen, const EventSet &rHighAlph, const EventSet &rObsAlph)
Supervisor Reduction algorithm.
int main()

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