tp_3_parallel.cpp
Go to the documentation of this file.
1 /** @file tp_3_parallel.cpp
2 
3 Tutorial, timed parallel composition.
4 Demonstratates synchronous composition of two timed automata by function faudes::TParallel
5 
6 @ingroup Tutorials
7 
8 @include tp_3_parallel.cpp
9 
10 */
11 
12 
13 #include "libfaudes.h"
14 #include "tp_include.h"
15 
16 
17 // for simplicity we make the faudes namespace available to our program
18 
19 using namespace faudes;
20 
21 
22 
23 /////////////////
24 // main program
25 /////////////////
26 
27 int main() {
28 
29  // read two generators ...
30  TimedGenerator g1("data/tsimplemachine.gen");
31  TimedGenerator g2("data/tbuffer.gen");
32 
33  // ... and perform parallel composition
34  TimedGenerator gres;
35  TParallel(g1,g2,gres);
36 
37  // Report
38  std::cout << "######################################\n";
39  std::cout << "# t simple machine with buffer \n";
40  gres.DWrite();
41  std::cout << "######################################\n";
42 
43  // Save to file
44  gres.Write("tmp_tmachinewithbuffer.gen");
45 
46  // Test protocol
47  FAUDES_TEST_DUMP("composition",gres.ToText());
48 
49  return 0;
50 }
51 
52 
53 

libFAUDES 2.26g --- 2015.08.17 --- c++ api documentaion by doxygen