Printing of the state constraints in the context automaton

This commit is contained in:
Artur Meski
2018-09-23 13:12:33 +01:00
parent 206996a700
commit ac97db8ead
2 changed files with 8 additions and 1 deletions

View File

@@ -107,6 +107,7 @@ void CtxAut::addTransition(std::string srcStateName, std::string dstStateName, S
new_transition.ctx = tmpProcEntities; new_transition.ctx = tmpProcEntities;
// tmpEntities.clear(); // tmpEntities.clear();
tmpProcEntities.clear(); tmpProcEntities.clear();
new_transition.state_constr = stateConstr;
new_transition.dst_state = getStateID(dstStateName); new_transition.dst_state = getStateID(dstStateName);
transitions.push_back(new_transition); transitions.push_back(new_transition);
} }
@@ -118,7 +119,11 @@ void CtxAut::showTransitions(void)
for (const auto &t : transitions) { for (const auto &t : transitions) {
cout << " * [" << getStateName(t.src_state) << " -> " << getStateName( cout << " * [" << getStateName(t.src_state) << " -> " << getStateName(
t.dst_state) t.dst_state)
<< "]: { " << parent_rctsys->procEntitiesToStr(t.ctx) << "}" << endl; << "]: { " << parent_rctsys->procEntitiesToStr(t.ctx) << "}";
if (t.state_constr != nullptr) {
cout << " " << t.state_constr->toStr();
}
cout << endl;
} }
} }

View File

@@ -56,9 +56,11 @@ typedef std::vector<ReactionCond> ReactionConds;
typedef std::map<Entity, ReactionConds> DecompReactions; typedef std::map<Entity, ReactionConds> DecompReactions;
typedef std::vector<int> StateEntityToAction; typedef std::vector<int> StateEntityToAction;
class StateConstr;
struct CtxAutTransition { struct CtxAutTransition {
State src_state; State src_state;
EntitiesForProc ctx; EntitiesForProc ctx;
StateConstr *state_constr;
State dst_state; State dst_state;
}; };