Printing of reactions
This commit is contained in:
26
rs.cc
26
rs.cc
@@ -101,6 +101,16 @@ Process RctSys::getProcessID(std::string processName)
|
|||||||
return processes_names[processName];
|
return processes_names[processName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string RctSys::getProcessName(Process processID)
|
||||||
|
{
|
||||||
|
if (processID < processes_ids.size())
|
||||||
|
return processes_ids[processID];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FERROR("No such process ID: " << processID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RctSys::pushReactant(std::string entityName)
|
void RctSys::pushReactant(std::string entityName)
|
||||||
{
|
{
|
||||||
if (!hasEntity(entityName))
|
if (!hasEntity(entityName))
|
||||||
@@ -155,12 +165,20 @@ std::string RctSys::entitiesToStr(const Entities &entities)
|
|||||||
void RctSys::showReactions(void)
|
void RctSys::showReactions(void)
|
||||||
{
|
{
|
||||||
cout << "# Reactions:" << endl;
|
cout << "# Reactions:" << endl;
|
||||||
for (auto r = reactions.begin(); r != reactions.end(); ++r)
|
|
||||||
|
for (unsigned int proc_id = 0; proc_id < processes_ids.size(); ++proc_id)
|
||||||
{
|
{
|
||||||
cout << " * (R={" << entitiesToStr(r->rctt) << "},"
|
cout << endl;
|
||||||
<< "I={" << entitiesToStr(r->inhib) << "},"
|
cout << " . proc = \"" << getProcessName(proc_id) << "\":" << endl;
|
||||||
<< "P={" << entitiesToStr(r->prod) << "})" << endl;
|
for (const auto &r : proc_reactions[proc_id])
|
||||||
|
{
|
||||||
|
cout << " * (R={" << entitiesToStr(r.rctt) << "},"
|
||||||
|
<< "I={" << entitiesToStr(r.inhib) << "},"
|
||||||
|
<< "P={" << entitiesToStr(r.prod) << "})" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
cout << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RctSys::pushStateEntity(std::string entityName)
|
void RctSys::pushStateEntity(std::string entityName)
|
||||||
|
|||||||
1
rs.hh
1
rs.hh
@@ -43,6 +43,7 @@ class RctSys
|
|||||||
void addProcess(std::string processName);
|
void addProcess(std::string processName);
|
||||||
bool hasProcess(std::string processName);
|
bool hasProcess(std::string processName);
|
||||||
Process getProcessID(std::string processName);
|
Process getProcessID(std::string processName);
|
||||||
|
std::string getProcessName(Process processID);
|
||||||
|
|
||||||
void addReactionForCurrentProcess(Reaction reaction);
|
void addReactionForCurrentProcess(Reaction reaction);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user