Decrease the Number of Times the Rules Are Solved
This is one solution proposed to optimize the evaluation of Quality Rules Reuse rule base.
Tip:
It is highly recommended that you use the > operator when working with 2 identical types. |
WireA : Wire;WireB : Wire
|
This syntax is not recommended. In this example, the same type (wire) is used twice to compute the distance between two wires. The rule is executed n*n times, n being the number of wires in the document. For example, if there are three wires (wire1,wire2, and wire3), the following combinations are possible: wire1/wire1, wire1/wire2, wire1/wire3, wire2/wire1, wire2/wire2, wire2/wire3, wire3/wire1, wire3/wire2, wire3/wire3 (the rule goes through each combination). |
|
WireA : Wire;WireB : Wire
Message ("Problem")
|
This syntax is recommended. The combination wire1/wire1 is not useful to compute the distance, and the distance between wire1/wire2, and wire2/wire1 is identical. The only way to optimize the rule is to add the following statement: WireA>WireB. The rule is then solved n*(n+1)/2 times.
|