syn_1_simple.cpp File Reference

Tutorial, std monolitic synthesis. More...

#include "libfaudes.h"

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

Tutorial, std monolitic synthesis.

This tutorial uses a very simple example to illustrate the std monolithic controller synthesis as originally proposed by Ramadge and Wonham.

/** @file syn_1_simple.cpp
Tutorial, std monolitic synthesis.
This tutorial uses a very simple example to illustrate the
std monolithic controller synthesis
as originally proposed by Ramadge and Wonham.
@ingroup Tutorials
@include syn_1_simple.cpp
*/
#include "libfaudes.h"
// we make the faudes namespace available to our program
using namespace faudes;
/////////////////
// main program
/////////////////
int main() {
// Compose plant dynamics from two very simple machines
Generator tempgen, machinea, machineb;
System cplant;
tempgen.Read("data/verysimplemachine.gen");
tempgen.Version("1",machinea);
tempgen.Version("2",machineb);
Parallel(machinea,machineb,cplant);
// Declare controllable events
EventSet contevents;
contevents.Insert("alpha_1");
contevents.Insert("alpha_2");
cplant.SetControllable(contevents);
// Write to file
cplant.Write("tmp_cplant12.gen");
// Report to console
std::cout << "################################\n";
std::cout << "# tutorial, plant model \n";
cplant.DWrite();
std::cout << "################################\n";
// Read specification
Generator specification;
specification.Read("data/buffer.gen");
InvProject(specification,cplant.Alphabet());
specification.Name("simple machines specification");
// Write to file
specification.Write("tmp_specification12.gen");
// Report to console
std::cout << "################################\n";
std::cout << "# tutorial, specification \n";
specification.DWrite();
std::cout << "################################\n";
// Run synthesis algorithm
System supervisor;
SupConNB(cplant,specification,supervisor);
supervisor.Name("simple machines supervisor");
supervisor.Write("tmp_supervisor12.gen");
// Report to console
std::cout << "################################\n";
std::cout << "# tutorial, supervisor\n";
supervisor.DWrite();
std::cout << "################################\n";
return 0;
}
bool Insert(const Idx &rIndex)
Add an element by index.
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
int main(int argc, char *argv[])
NameSet EventSet
Convenience typedef for plain event sets.
Definition: cfl_nameset.h:531
vGenerator Generator
Plain generator, api typedef for generator with no attributes.
TcGenerator< AttributeVoid, AttributeVoid, AttributeCFlags, AttributeVoid > System
Convenience typedef for std System.
void Parallel(const Generator &rGen1, const Generator &rGen2, Generator &rResGen)
Parallel composition.
void InvProject(Generator &rGen, const EventSet &rProjectAlphabet)
Inverse projection.
void SupConNB(const Generator &rPlantGen, const EventSet &rCAlph, const Generator &rSpecGen, Generator &rResGen)
Nonblocking Supremal Controllable Sublanguage.
Definition: syn_supcon.cpp:757
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.

Definition in file syn_1_simple.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 30 of file syn_1_simple.cpp.

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