|
QuISP
|
#include <RuleSet.h>

Public Member Functions | |
| RuleSet (const std::string &name="", const std::vector< Rule > &rules=std::vector< Rule >(), const Program &termination_cond=Program{"never terminate", {}}, bool debugging=false) | |
| void | finalize () |
| analyzes its rules and instructions to collect informations for execution. | |
Public Attributes | |
| std::set< QNodeAddr > | partners |
| the partner(connection participating nodes) QNodeAddrs used in this RuleSet. | |
| std::unordered_map< QNodeAddr, RuleId > | partner_initial_rule_table |
| This contains a list of pairs of the rule_id and partner's QNodeAddr. | |
| std::unordered_map< std::pair< QNodeAddr, RuleId >, RuleId > | next_rule_table = {} |
| contains the next rule ids corresponding to the current partner and rule id like: (partner_addr, current_rule_id): next_rule_id | |
| unsigned long | id |
| the RuleSet id | |
| int | owner_addr |
| the owner's QNode address. | |
| std::string | name |
| the RuleSet name for debugging. | |
| std::vector< Rule > | rules |
| the Rules in this RuleSet. Each Rule has Condition and Action. | |
| Program | termination_condition |
| the Program to check the RuleSet is terminated or not. | |
| bool | debugging = false |
Static Protected Member Functions | |
| static void | collectPartners (const RuleId rule_id, const InstructionTypes &instr, std::set< QNodeAddr > &partners, std::unordered_map< QNodeAddr, std::vector< RuleId > > &partner_rules) |
| an internal method to traverse the given Rule's whole Program to collect their partners. | |
The RuleSet.
The responder QNode creates a set of RuleSets for each QNode in the path. The RuleSet contains a list of Rules. The Runtime receives the given RuleSet and executes it. The Runtime and the Ruleset will be deleted when the RuleSet is terminated.
|
inline |
|
inlinestaticprotected |
| void quisp::runtime::RuleSet::finalize | ( | ) |
analyzes its rules and instructions to collect informations for execution.
| bool quisp::runtime::RuleSet::debugging = false |
| unsigned long quisp::runtime::RuleSet::id |
the RuleSet id
| std::string quisp::runtime::RuleSet::name |
the RuleSet name for debugging.
| std::unordered_map<std::pair<QNodeAddr, RuleId>, RuleId> quisp::runtime::RuleSet::next_rule_table = {} |
contains the next rule ids corresponding to the current partner and rule id like: (partner_addr, current_rule_id): next_rule_id
| int quisp::runtime::RuleSet::owner_addr |
the owner's QNode address.
| std::set<QNodeAddr> quisp::runtime::RuleSet::partners |
the partner(connection participating nodes) QNodeAddrs used in this RuleSet.
| std::vector<Rule> quisp::runtime::RuleSet::rules |
| Program quisp::runtime::RuleSet::termination_condition |