|
|
||||||
|
Tutorial, std monolitic synthesis. More... #include "libfaudes.h" Go to the source code of this file.
Detailed DescriptionTutorial, 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;
}
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 vGenerator Generator Plain generator, api typedef for generator with no attributes. Definition: cfl_generator.h:3240 TcGenerator< AttributeVoid, AttributeVoid, AttributeCFlags, AttributeVoid > System Convenience typedef for std System. Definition: cfl_cgenerator.h:921 void Parallel(const Generator &rGen1, const Generator &rGen2, Generator &rResGen) Parallel composition. Definition: cfl_parallel.cpp:32 void InvProject(Generator &rGen, const EventSet &rProjectAlphabet) Inverse projection. Definition: cfl_project.cpp:1479 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 Definition in file syn_1_simple.cpp. Function Documentation◆ main()
Definition at line 30 of file syn_1_simple.cpp. libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen |