Forward Chaining Question
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,
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.
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 !
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! :)
Sounds so simple, I'm wondering if I misunderstood you. Otherwise, get some sleep! :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement