I’m using CLIPS for a university project, it’s a question driven expert system, and I need to ask randomly a few initial questions, so I wrote this group of rules, and (set-strategy random):
(defrule ask-age
(not (age ?))
=>
(bind ?answer (question “What’s your age?”))
(assert (age ?answer)))
(defrule ask-gender
(not (age ?))
=>
(bind ?answer (question “What’s your gender?”))
(assert (gender ?answer)))
(defrule ask-main-symptom
(not (main-symptom ? TRUE))
=>
(bind ?answer (question “What’s the main symptom?”))
(assert (main-symptom ?answer TRUE)))
Based upon the knowledge about the main symptom, another group of rules gets activated, and I need to change the conflict resolution strategy. Is it correct to put (set-strategy complexity) in ask-main-symptom rule, after (assert (main-symptom ?answer TRUE))? There is a better way?
(defrule ask-main-symptom
(not (main-symptom ? TRUE))
=>
(bind ?answer (question “What’s the main symptom?”))
(assert (main-symptom ?answer TRUE))
(set-strategy complexity))