19 #include <unordered_map>
47 std::unordered_map<std::string, std::shared_ptr<Rule>>
ruleMap;
53 ruleMap = std::unordered_map<std::string, std::shared_ptr<Rule>>();
54 iterations = std::vector<std::shared_ptr<Iteration>>();
58 return "N" +
id.substr(1) +
"." + std::to_string(++
ruleId);
63 for (
auto&
rul : iter->getRules()) {
64 if (
rul.second->getName() ==
name) {
65 return rul.second->getId();
69 return "C" +
id.substr(1) +
"." + std::to_string(++
recursiveId);
93 std::chrono::microseconds result{};
95 result += iter->getRuntime();
101 std::chrono::microseconds result{};
103 result += iter->getCopytime();
111 result += iter->size();
123 for (
auto&
rul : iter->getRules()) {
124 result +=
rul.second->size();
163 std::ostringstream output;
165 <<
"],\n\n\"onRecRules\":[\n";
167 output <<
rul.second->toString();
169 output <<
"\n],\n\"iterations\":\n";
175 output << iter->toString();
178 std::string retStr = output.str();
180 return retStr.substr(0, retStr.size() - 2) +
"]\n}";
192 const std::unordered_map<std::string, std::shared_ptr<Rule>>&
getRuleMap()
const {
201 std::vector<std::shared_ptr<Rule>> temp = std::vector<std::shared_ptr<Rule>>();
203 for (
auto&
rul : iter->getRules()) {
204 temp.push_back(
rul.second);