40 HioPlant g2(
"data/2_hiogenerators/hio_simplemachine_A.gen");
44 g1.
Read(
"data/2_hiogenerators/simplemachine_A.gen");
47 Generator g4(
"data/2_hiogenerators/simplemachine_A.gen");
61 EventSet ypEvents,upEvents,yeEvents,ueEvents;
68 HioPlant g9(g4,ypEvents,upEvents,yeEvents,ueEvents);
72 g1.
Write(
"tmp_hiosimplemachine_A1.gen");
73 g2.
Write(
"tmp_hiosimplemachine_A2.gen");
74 g3.
Write(
"tmp_hiosimplemachine_A3.gen");
75 g5.
Write(
"tmp_hiosimplemachine_A5.gen");
76 g6.
Write(
"tmp_hiosimplemachine_A6.gen");
77 g9.
Write(
"tmp_hiosimplemachine_A9.gen");
79 g1.
Write(
"tmp_hiosimplemachine_A.gen");
83 std::cout <<
"######################################\n";
84 std::cout <<
"# hio simple machine\n";
86 std::cout <<
"######################################\n";
92 std::cout <<
"######################################\n";
95 std::cout <<
"# IsHioPlantForm A: expect to fail for missing attributes\n";
102 std::cout <<
"# IsHioPlantForm B: expect to pass\n";
115 g2.
Write(
"tmp_hiosimplemachine_A_broken.gen");
116 g2.
GraphWrite(
"tmp_hiosimplemachine_A_broken.png");
118 std::cout <<
"# IsHioPlantForm C: expect to fail for missing input transitions\n";
124 g2.
Write(
"tmp_hiosimplemachine_A_fixed.gen");
126 std::cout <<
"# IsHioPlantForm D: expect to pass\n";
132 g2.
Write(
"tmp_hiosimplemachine_A_repaired.gen");
134 std::cout <<
"######################################\n";
149 std::cout<<std::endl;
152 std::cout <<
"######################################\n";
153 std::cout <<
"# QYpYe,QUp and QUe of simple machine:\n";
157 std::cout <<
"######################################\n";
177 std::cout <<
"######################################\n";
178 std::cout <<
"# IsHioPlantForm:\n";
181 std::cout <<
"######################################\n";
184 std::cout<<std::endl<<std::endl;
191 c1.
Name(
"HioController");
211 std::cout<<std::endl<<
"######################################\n";
212 std::cout<<
"######################################\n";
213 std::cout<<
"####### I/O CONTROLLER: #########\n";
219 c1.
Write(
"tmp_hiocontroller_incomplete.gen");
220 c1.
Read(
"tmp_hiocontroller_incomplete.gen");
223 c1.
GraphWrite(
"tmp_hiocontroller_incomplete.png");
231 c1.
Write(
"tmp_hiocontroller_repaired.gen");
232 c1.
GraphWrite(
"tmp_hiocontroller_repaired.png");
233 std::cout<<
"######################################\n";
234 std::cout<<std::endl<<std::endl;
242 e1.
Name(
"HioEnvironment");
262 std::cout<<std::endl<<
"######################################\n";
263 std::cout<<
"######################################\n";
264 std::cout<<
"####### I/O ENVIRONMENT: #########\n";
269 e1.
Write(
"tmp_hioenvironment_incomplete.gen");
270 e1.
Read(
"tmp_hioenvironment_incomplete.gen");
273 e1.
GraphWrite(
"tmp_hioenvironment_incomplete.png");
282 e1.
Write(
"tmp_hioenvironment_repaired.gen");
283 e1.
GraphWrite(
"tmp_hioenvironment_repaired.png");
284 std::cout<<
"######################################\n";
285 std::cout<<std::endl<<std::endl;
291 cnstr1.
Name(
"HioConstraint");
304 std::cout<<std::endl<<
"######################################\n";
305 std::cout<<
"######################################\n";
306 std::cout<<
"####### I/O CONSTRAINT: #########\n";
307 std::cout<<
"#######\n";
310 yEvents.
Name(
"####### HioConstraint: Y-Events");
316 cnstr1.
Write(
"tmp_hioconstraint_incomplete.gen");
317 cnstr1.
Read(
"tmp_hioconstraint_incomplete.gen");
320 cnstr1.
GraphWrite(
"tmp_hioconstraint_incomplete.png");
329 cnstr1.
Write(
"tmp_hioconstraint_repaired.gen");
330 cnstr1.
GraphWrite(
"tmp_hioconstraint_repaired.png");
331 std::cout<<
"######################################\n";
#define FAUDES_TEST_DUMP(mes, dat)
Test protocol record macro ("mangle" filename for platform independance)
Set of indices with symbolic names.
void InsUEvent(Idx index)
Add an existing U-event to generator.
void InsYEvent(Idx index)
Add an existing Y-event to generator.
EventSet YEvents(void) const
Get EventSet with Y-events.
void InsYcEvent(Idx index)
Add an existing Yc-event to generator.
void InsYpEvent(Idx index)
Add an existing Yp-event to generator.
void InsUcEvent(Idx index)
Add an existing Uc-event to generator.
void InsUpEvent(Idx index)
Add an existing Up-event to generator.
void InsYeEvent(Idx index)
Add an existing Ye-event to generator.
void InsUeEvent(Idx index)
Add an existing Ue-event to generator.
void InsUlEvent(Idx index)
Add an existing Ul-event to generator.
void InsYlEvent(Idx index)
Add an existing Yl-event to generator.
void SetYp(Idx index)
Mark event as Yp-event (by index)
void SetYe(Idx index)
Mark event as Ye-event (by index)
EventSet UeEvents(void) const
Get EventSet with Ue-events.
StateSet QUpStates(void) const
Get StateSet with QUp-states.
EventSet UpEvents(void) const
Get EventSet with Up-events.
StateSet QUeStates(void) const
Get StateSet with QUe-states.
void SetUp(Idx index)
Mark event Up-event(by index)
StateSet QYpYeStates(void) const
Get StateSet with QYpYe-states.
EventSet YpEvents(void) const
Get EventSet with Yp-events.
EventSet YeEvents(void) const
Get EventSet with Ye-events.
void SetUe(Idx index)
Mark event as Ue-event (by index)
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator
Iterator on transition.
virtual TaGenerator & Assign(const Type &rSrc)
Copy from other faudes Type (try to cast to agenerator or pass to base)
bool SetTransition(Idx x1, Idx ev, Idx x2)
Add a transition to generator by indices.
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
Read configuration data from file with label specified.
void Write(const Type *pContext=0) const
Write configuration data to console.
Base class of all FAUDES generators.
Idx InsMarkedState(void)
Create new anonymous state and set as marked state.
TransSet::Iterator TransRelBegin(void) const
Iterator to Begin() of transition relation.
void ClrTransition(Idx x1, Idx ev, Idx x2)
Remove a transition by indices.
void Name(const std::string &rName)
Set the generator's name.
TransSet::Iterator TransRelEnd(void) const
Iterator to End() of transition relation.
void SetMarkedState(Idx index)
Set an existing state as marked state by index.
Idx InsInitState(void)
Create new anonymous state and set as initial state.
void GraphWrite(const std::string &rFileName, const std::string &rOutFormat="", const std::string &rDotExec="dot") const
Produce graphical representation of this generator.
std::string EventName(Idx index) const
Event name lookup.
const std::string & Name(void) const
Return name of TBaseSet.
void HioFreeInput(const Generator &rGen, const EventSet &rInput, const EventSet &rOutput, Generator &rResGen, const std::string &rErrState1, const std::string &rErrState2, Idx &rErrState1Idx, Idx &rErrState2Idx)
HioFreeInput: extend generator by obviously missing input transitions.
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
bool IsHioConstraintForm(HioConstraint &rHioConstraint, StateSet &rQY, StateSet &rQU, EventSet &rErrEvSet, TransSet &rErrTrSet, StateSet &rErrStSet, std::string &rReportStr)
IsHioConstraintForm: check if rHioConstraint is in I/O-constraint form and assign state attributes.
bool IsHioEnvironmentForm(HioEnvironment &rHioEnvironment, StateSet &rQYe, StateSet &rQUe, StateSet &rQUl, StateSet &rQYlUe, EventSet &rErrEvSet, TransSet &rErrTrSet, StateSet &rErrStSet, std::string &rReportStr)
IsHioEnvironmentForm: check if rHioEnvironment is in I/O-environment form and assign state attributes...
bool IsHioControllerForm(HioController &rHioController, StateSet &rQUc, StateSet &rQYP, StateSet &rQUp, StateSet &rQYcUp, EventSet &rErrEvSet, TransSet &rErrTrSet, StateSet &rErrStSet, std::string &rReportStr)
IsHioControllerForm: check if rHioController is in I/O-controller form and assign state attributes.
bool IsHioPlantForm(HioPlant &rHioPlant, StateSet &rQYpYe, StateSet &rQUp, StateSet &rQUe, EventSet &rErrEvSet, TransSet &rErrTrSet, StateSet &rErrStSet, std::string &rReportStr)
IsHioPlantForm: check if rHioPlant is in I/O-plant form and assign state attributes.