[rules-users] asking the best next question to have as many rules fire as possible

Fred Kwakkel fkwakkel at qubiz.eu
Mon Jul 7 16:30:59 EDT 2008


Hi, 

We are building with a team an application for matching "green customers" to
"green companies" based on rules that match customer (wanting to save
energy, money and climate) to green companies that offer "products to save
energy, money and climate" 

We are evaluation if drools would be a good tool for this.

Now my question: (how) will drools (or any other rule engine) be able to
support the process of "asking the best next question to have as many rules
fire as possible"? but without having to code in each rule some relationship
with other rules in the rule base explicitely, because that would make the
rule base very hard to maintain when we have hundreds or maybe even
thousands of rules in the future.

Let's take an example: 

R1 a rule that tells me to visit "www.isoleer.nu" to isolate my house WHEN I
own (and don't rent the house) AND the type of house is "house at corner"
(fire: savings 8 Euro / month, error margin +/- 10%)

R2 a rule that tells me to "buy a new hot-water boiler at www.warmwater.nl"
WHEN I own a house AND my current hot-water-boil is-of-type "XX1" "XX2" or
"XX3" (fire: saving 7 +/-10% Euro when is-of-type "XX1", savings 12 Euro +/-
8% when is-of-type "XX2" or "XX3")

R3 a rule that tells me to go to "www.drive-diesel.nl" WHEN I own a car, AND
drive more than 40.000 Km per year (fire: savings per month #Km/year * 1.20,
marge 15%)

R4 a rule that tells me to go to "www.drive-benzine.nl" WHEN I own a car,
AND drive less then 40.000 Km per year (fire: saving per month #Km/year
*/1.20, marge 20%)

R5 a rule that tells me to visit "mercedez-benz.com" WHEN I plan the buy a
new car AND my income > 100.000 Euro / year (NO savings per month)

R6 a rule that tells me to vist "www.smart-car.nl" WHEN I own a car (savings
per month 10 Euro, marge 50%)

R7 a rule that tells me to visit "www.smar-car.nl" WHEN I own a car AND
use-it-to "Drive to work" (savings per month 15 Euro, marge 25%)

I think the best path to answering questions (taking into account rules
R1..R7 from previous email) would be something like:

1. Do you own a car? (yes,no) -> because this might lead to R6 to fire
immediately
1.1. (If do-you-own-a-car=yes) -> Then R6 will fire
1.1.1 How many Km / year? (0-...) -> because this will lead to R3 or R4 fire
1.1.1.2 (if km-per-year > 40.000) Then R3 will fire
1.1.1.3 (if km-per-year < 40.000) Then R4 will fire
1.2 (If do-you-own-a-car=no) -> Then R6 will NOT fire SO it is USELESS to
ask "km-per-year" or "use-car-to"
1.2.1 ... etc.

However, this means the order to ask the questions can not be predetermined, 
but depends on anwers to earlier questions.

How can this be done with a rule engine (like drools?) in a way that the
rules are still well maintainable and rule base can grow.

Thank you for your help and tips!

-- Fred Kwakkel (fkwakkel at qubiz.eu)
-- 
View this message in context: http://www.nabble.com/asking-the-best-next-question-to-have-as-many-rules-fire-as-possible-tp18255231p18255231.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list