Printing of entities per proc
This commit is contained in:
14
rs.cc
14
rs.cc
@@ -119,6 +119,20 @@ std::string RctSys::getProcessName(Process processID)
|
||||
}
|
||||
}
|
||||
|
||||
void RctSys::printEntitiesPerProc(const EntitiesForProc &proc_entities)
|
||||
{
|
||||
for (const auto &pe : proc_entities) {
|
||||
std::string proc_name = getProcessName(pe.first);
|
||||
cout << proc_name << ": ";
|
||||
|
||||
for (const auto &ent : pe.second) {
|
||||
cout << getEntityName(ent) << " ";
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void RctSys::pushReactant(std::string entityName)
|
||||
{
|
||||
if (!hasEntity(entityName)) {
|
||||
|
||||
2
rs.hh
2
rs.hh
@@ -49,6 +49,8 @@ class RctSys
|
||||
Process getProcessID(std::string processName);
|
||||
std::string getProcessName(Process processID);
|
||||
|
||||
void printEntitiesPerProc(const EntitiesForProc &proc_entities);
|
||||
|
||||
void addReactionForCurrentProcess(Reaction reaction);
|
||||
|
||||
void pushReactant(std::string entityName);
|
||||
|
||||
19
symrs.cc
19
symrs.cc
@@ -74,30 +74,19 @@ void SymRS::mapProcEntities(void)
|
||||
// collect entities that can be produced
|
||||
// locally by the process with proc_id
|
||||
|
||||
SET_ADD(usedEntities[proc_id], rct.prod);
|
||||
SET_ADD(usedProducts[proc_id], rct.prod);
|
||||
}
|
||||
}
|
||||
|
||||
// Context automaton
|
||||
// for ()
|
||||
|
||||
printUsedEntitiesPerProc();
|
||||
// for (const )
|
||||
// usedCtxEntities
|
||||
|
||||
rs->printEntitiesPerProc(usedProducts);
|
||||
}
|
||||
|
||||
void SymRS::printUsedEntitiesPerProc(void)
|
||||
{
|
||||
for (const auto &proc_entities : usedEntities) {
|
||||
std::string proc_name = rs->getProcessName(proc_entities.first);
|
||||
cout << proc_name << ": ";
|
||||
|
||||
for (const auto &ent : proc_entities.second) {
|
||||
cout << rs->getEntityName(ent) << " ";
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
|
||||
BDD SymRS::encEntity_raw(Entity entity, bool succ) const
|
||||
{
|
||||
|
||||
5
symrs.hh
5
symrs.hh
@@ -235,7 +235,8 @@ class SymRS
|
||||
unsigned int totalActions;
|
||||
unsigned int totalCtxAutStateVars;
|
||||
|
||||
EntitiesForProc usedEntities;
|
||||
EntitiesForProc usedProducts;
|
||||
EntitiesForProc usedCtxEntities;
|
||||
|
||||
BDD encEntity_raw(Entity entity, bool succ) const;
|
||||
BDD encEntity(Entity entity) const
|
||||
@@ -298,8 +299,6 @@ class SymRS
|
||||
void mapProcEntities(void);
|
||||
void encode(void);
|
||||
|
||||
void printUsedEntitiesPerProc(void);
|
||||
|
||||
int getMappedStateToActID(int stateID) const
|
||||
{
|
||||
assert(stateID < static_cast<int>(totalRctSysStateVars));
|
||||
|
||||
Reference in New Issue
Block a user