Initial RS states vs initial CA states (they are incompatible)
This commit is contained in:
10
rs.cc
10
rs.cc
@@ -122,6 +122,10 @@ void RctSys::pushStateEntity(std::string entityName)
|
||||
|
||||
void RctSys::commitInitState(void)
|
||||
{
|
||||
if (ctx_aut != nullptr)
|
||||
{
|
||||
FERROR("Initial RS states must not be used with context automaton");
|
||||
}
|
||||
initStates.insert(tmpState);
|
||||
tmpState.clear();
|
||||
}
|
||||
@@ -181,6 +185,10 @@ void RctSys::printSystem(void)
|
||||
void RctSys::ctxAutEnable(void)
|
||||
{
|
||||
assert(ctx_aut == nullptr);
|
||||
if (initStatesDefined())
|
||||
{
|
||||
FERROR("Initial states must not be defined if using context automaton");
|
||||
}
|
||||
ctx_aut = new CtxAut(opts, this);
|
||||
}
|
||||
|
||||
@@ -208,3 +216,5 @@ void RctSys::ctxAutPushNamedContextEntity(std::string entityName)
|
||||
Entity entity_id = getEntityID(entityName);
|
||||
ctx_aut->pushContextEntity(entity_id);
|
||||
}
|
||||
|
||||
/** EOF **/
|
||||
|
||||
2
rs.hh
2
rs.hh
@@ -75,6 +75,8 @@ class RctSys
|
||||
void ctxAutAddTransition(std::string srcStateName, std::string dstStateName);
|
||||
void ctxAutPushNamedContextEntity(std::string entity_name);
|
||||
|
||||
bool initStatesDefined(void) { return initStates.size() != 0; }
|
||||
|
||||
private:
|
||||
Reactions reactions;
|
||||
EntitiesSets initStates;
|
||||
|
||||
5
symrs.cc
5
symrs.cc
@@ -399,7 +399,8 @@ void SymRS::encode(void)
|
||||
VERB("Encoding done");
|
||||
}
|
||||
|
||||
BDD SymRS::encActStrEntity(std::string name) const {
|
||||
BDD SymRS::encActStrEntity(std::string name) const
|
||||
{
|
||||
int id = getMappedStateToActID(rs->getEntityID(name));
|
||||
if (id < 0)
|
||||
{
|
||||
@@ -409,3 +410,5 @@ BDD SymRS::encActStrEntity(std::string name) const {
|
||||
return encActEntity(getMappedStateToActID(rs->getEntityID(name)));
|
||||
}
|
||||
}
|
||||
|
||||
/** EOF **/
|
||||
|
||||
Reference in New Issue
Block a user