Multi-Result Set Calculation Node for Rete Network Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional Rete networks in rule engines are inefficient when performing multiple calculations on the same set of facts, requiring multiple rules and resulting in verbose and complex network structures.
Innovation Solution
The introduction of a multi-result set calculation node within the Rete network allows for a single node to perform multiple calculations on the same set of facts, simplifying the network and syntax, and extending the accumulate node to support multiple functions, enabling the creation of multi-dimensional tuples to store and propagate results efficiently.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If multiple accumulate nodes are used to perform multiple calculations on the same set of facts, then calculation completeness is improved, but network complexity increases
Solution Approach 1:
The patent merges multiple accumulate nodes into a single accumulate node that can perform multiple calculations simultaneously. The node maintains multiple result sets (first result set, second result set, etc.) corresponding to different calculations, allowing it to compute sum, average, min, max and other statistics on the same input facts in one pass rather than requiring separate nodes for each calculation.
Solution Approach 2:
The accumulate node is extended to have universal functionality by enabling it to perform multiple different calculations on the same data. The node can be configured with multiple aggregate functions (sum, average, min, max, etc.) and maintains multiple result sets, making a single node capable of replacing multiple specialized nodes.
2Adaptability or versatility
If multiple accumulate nodes are used to perform multiple calculations, then all required calculations can be completed, but the number of nodes and memory structures increases
Solution Approach 1:
Multiple accumulate nodes are merged into one unified node that handles all calculations. The single node maintains multiple result sets internally, reducing the total node count while preserving the ability to perform multiple calculations on the same input data.
3Reliability
If consecutive patterns are used for multiple calculations, then all calculation results can be obtained, but the rule syntax becomes verbose
Solution Approach 1:
The accumulate node is enhanced with universal calculation capability, allowing a single pattern to specify multiple aggregate functions. The syntax enables declaring multiple result variables (e.g., sum, average, min, max) within one accumulate clause, eliminating the need for multiple consecutive patterns and reducing verbosity.
Data Source
AI summary
Some embodiments of a method to support multi-result set calculation in a rule engine have been presented. A rule engine can compile a set of rules to build a network for evaluating facts against the rules. The rules include at least one rule requiring multiple calculations to be executed for the same set of facts. The rule engine can create a single multi-result set calculation node for this rule in the network. The multi-result set calculation node can generate a set of results and add the set of results to a tuple to be propagated to a second node connected to an output of the multi-result set calculation node.


