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 #include "libfaudes.h"
13 
14 
15 // for simplicity we make the faudes namespace available to our program
16 using namespace faudes;
17 
18 
19 
20 /////////////////
21 // main program
22 /////////////////
23 
24 int 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)
Test protocol record macro ("mangle" filename for platform independance)
Definition: cfl_helper.h:483
Generator with timing extensions.
void DWrite(const Type *pContext=0) const
Write configuration data to console, debugging format.
Definition: cfl_types.cpp:225
std::string ToText(const std::string &rLabel="", const Type *pContext=0) const
Write configuration data to a formated string.
Definition: cfl_types.cpp:185
void Write(const Type *pContext=0) const
Write configuration data to console.
Definition: cfl_types.cpp:139
void TParallel(const TGEN1 &rGen1, const TGEN2 &rGen2, TGENR &rResGen)
Parallel composition of timed generators.
Definition: tp_tparallel.h:90
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
int main()

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