Skip to content

Commit

Permalink
Merge pull request #9 from frankthelen/feature-specificity
Browse files Browse the repository at this point in the history
Feature specificity
  • Loading branch information
frankthelen committed Jan 17, 2018
2 parents 1c59966 + cb2fffb commit ce0cc99
Show file tree
Hide file tree
Showing 6 changed files with 2,886 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ Thumbs.db
node_modules
coverage
*/config/local.js
package-lock.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ or through getters and getters if applicable, e.g., `facts.user.getSalery()`.
If there is more than one rule ready to fire, i.e., the conflict set is greater 1, the following conflict resolution strategies are applied (in this order):
* Refraction -- Each rule will fire only once, at most, during any one match-resolve-act cycle.
* Priority -- Rules with higher priority will fire first. Set the rule's property `priority` to an integer value. Default priority is `0`. Negative values are supported.
* Specificity -- Rules which are more specific will fire first. For example, if there is rule R1 with premises P1, P2, and rule R2 with premises P1, P2, and P3. R2 is more specific than R1 and will fire first. R2 is more specific than R1 because it has *all* premises of R1 and additional ones.
* Order of rules -- The rules that were registered first will fire first.

### Final rules
Expand Down Expand Up @@ -372,7 +373,6 @@ const rools = new Rools({
## Todos

Some of the features for future releases are:
* Conflict resolution by specificity
* Activation groups
* Agenda groups
* Extend rules
Loading

0 comments on commit ce0cc99

Please sign in to comment.