con_2_simple.cpp
Go to the documentation of this file.
1 /** @file con_2_simple.cpp
2 
3 Tutorial, coordination control for prefix-closed languages
4 
5 @ingroup Tutorials
6 
7 @include con_2_simple.cpp
8 
9 */
10 
11 #include "libfaudes.h"
12 
13 // we make the faudes namespace available to our program
14 using namespace faudes;
15 
16 /////////////////
17 // main program
18 /////////////////
19 
20 int main(void) {
21 
22  // Local systems g1, g2, g3, and a global specification spec
23  System g1, g2, g3, spec;
24  // Set of controllable events and the initial ek event set
25  EventSet ec, ek;
26  // Vectors of local systems and resulting supervisors
27  GeneratorVector gVector, resVector;
28  // Computer supervised coordinator
29  System coord;
30 
31  g1.Read("data/gen1.gen");
32  g2.Read("data/gen2.gen");
33  g3.Read("data/gen3.gen");
34  spec.Read("data/spec.gen");
35  ec.Read("data/ec.alph");
36  ek.Read("data/ek0.alph");
37 
38  gVector.Append(g1);
39  gVector.Append(g2);
40  gVector.Append(g3);
41 
42  bool result = SupConditionalControllable(spec,gVector,ec,ek,resVector,coord);
43 
44  FAUDES_TEST_DUMP("computed ok?",result);
45 
47 }
48 
#define FAUDES_TEST_DIFF()
Test protocol diff macro.
Definition: cfl_helper.h:493
#define FAUDES_TEST_DUMP(mes, dat)
Test protocol record macro ("mangle" filename for platform independance)
Definition: cfl_helper.h:483
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
virtual void Append(const Type &rElem)
Append specified entry.
int main(void)
bool SupConditionalControllable(const Generator &gen, const GeneratorVector &genVector, const EventSet &ACntrl, const EventSet &InitEk, GeneratorVector &supVector, Generator &Coord)
Conditionalcontrollability Checking Algorithm.
Definition: con_supcc.cpp:18
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.

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