Adds initial support to chained rules

This commit is contained in:
Felipe Zimmerle
2015-07-21 10:49:43 -03:00
parent 9c066e3198
commit 4f20f5bf74
8 changed files with 122 additions and 4 deletions

View File

@@ -36,7 +36,9 @@ using actions::Action;
Rule::Rule(Operator *_op,
std::vector<Variable *> *_variables,
std::vector<Action *> *_actions)
: variables(_variables),
: chained(false),
chainedRule(NULL),
variables(_variables),
op(_op),
rule_id(0),
phase(-1) {
@@ -111,6 +113,10 @@ bool Rule::evaluate(Assay *assay) {
assay->debug(4, "Running action: " + a->action);
a->evaluate(assay);
}
if (this->chained && this->chainedRule != NULL) {
this->chainedRule->evaluate(assay);
}
} else {
assay->debug(4, "Rule returned 0.");
}