Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many rules matching only one subject #64

Open
james-evidation opened this issue Aug 23, 2017 · 0 comments
Open

Many rules matching only one subject #64

james-evidation opened this issue Aug 23, 2017 · 0 comments

Comments

@james-evidation
Copy link

Hi,

I have many criteria as rules and I want to match a user to these criteria. e.g.

engine << ["user", "age", 20]
engine << ["user", "state", "CA"]
engine << ["user", "weight", 130]

and I have many rules like the following
forall {
has :A, "age", :Age
less :Age, 30
greater :Age, 20
has :A, "state", "CA"
}

At any point in time there will only be one user.
Is there a way to do this matching more efficiently without having to loop through each rule? Typically one would match a rule to many subjects but I want to do this the other way around, find which rules the subject agrees with.
I tried to have the criteria expressed as facts and the user attributes be rules but I have found it to be difficult to construct combinations.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant