tp_3_parallel.cpp
Go to the documentation of this file.
1/** @file tp_3_parallel.cpp
2
3Tutorial, timed parallel composition.
4Demonstratates 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#include "libfaudes.h"
13
14
15// for simplicity we make the faudes namespace available to our program
16using namespace faudes;
17
18
19
20/////////////////
21// main program
22/////////////////
23
24int main() {
25
26 // read two generators ...
27 TimedGenerator g1("data/tsimplemachine.gen");
28 TimedGenerator g2("data/tbuffer.gen");
29
30 // ... and perform parallel composition
31 TimedGenerator gres;
32 TParallel(g1,g2,gres);
33
34 // Report
35 std::cout << "######################################\n";
36 std::cout << "# t simple machine with buffer \n";
37 gres.DWrite();
38 std::cout << "######################################\n";
39
40 // Save to file
41 gres.Write("tmp_tmachinewithbuffer.gen");
42
43 // Test protocol
44 FAUDES_TEST_DUMP("composition",gres.ToText());
45
46 return 0;
47}
48
49
50
#define FAUDES_TEST_DUMP(mes, dat)
Definition cfl_utils.h:505
void DWrite(const Type *pContext=0) const
std::string ToText(const std::string &rLabel="", const Type *pContext=0) const
void Write(const Type *pContext=0) const
void TParallel(const TGEN1 &rGen1, const TGEN2 &rGen2, TGENR &rResGen)
int main()

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