Advertisement

Forward Chaining Question

Started by May 24, 2007 10:04 AM
2 comments, last by Daniel L 17 years, 6 months ago
Hey, anyone know a good way using forward chaining technique to make a default rule that fires if no other rules conditions are met? I know i can do this by listing all the conditions of the other rules in a rule but with not but its a bit messy. Thanks,
Chett - "I look forward to helping all of you one day, but right now im just a noob learning his way through the perils of game Development."
I'm not sure what you mean by "using forward chaining technique", but if it's in a program then this should be very easy. Use an else or keep a boolean variable that becomes true when any other rule fires and do the last rule only if that variable is still false. You could also just put the "else" rule at the bottom with no conditions if earlier rules will cause the system to stop checking later rules.
Advertisement
haha, i posted this at like 3am, allmost forgot about it.. Yeah thats pretty obvious just using a boolean to triger it a rule where the only condition is the boolean, i didnt want to go too specific because this is for an assignment, so was very much just looking for a general idea not an answer, thanks a lot !
Chett - "I look forward to helping all of you one day, but right now im just a noob learning his way through the perils of game Development."
If it's a set of conditions that changes between one area of your program and another, I'd define a function to test the conditions, otherwise I'd just set a boolean once and check that.

Sounds so simple, I'm wondering if I misunderstood you. Otherwise, get some sleep! :)

This topic is closed to new replies.

Advertisement