Hi all.
I am trying to write a very simple expert system which acts as a car startup troublshooter. It currently comprises of a basic textual welcome screen and multiple questions to outline the common non-startup causes. The user has a choice to reply yes/no to these questions.
The response is assosiated with the symptom, then the symptom is then assosiated with the correct reply/solution to the promblem.
The problem is that i would like to be able to distinguish wether the questions are positive or negative to get the desired output. Currently, the system in designed to respond to negative replies i.e. 'yes' or 'y' which will trigger the appropriate reply. If the response is 'no' or 'n', the system will disgard the fault assosiated to the current question being asked.
For example, if the question is:
'can you turn the key in the ignition' and the user replies "no", the fault will be dismissed, unless the user replies "yes" to this question, the system will assert to the database as a 'fault', therefore giving the wrong solution at the end of the session.
My thought is that i should store with the question a value that reflects the "default" (or no fault) answer, so that the detection of "fault" can be made on that basis (user input differs from "default"). Any suggestions on how to acheive this?
The source code can be obtained here :
Any help will be greatly appreciated!
Thank you
I am trying to write a very simple expert system which acts as a car startup troublshooter. It currently comprises of a basic textual welcome screen and multiple questions to outline the common non-startup causes. The user has a choice to reply yes/no to these questions.
The response is assosiated with the symptom, then the symptom is then assosiated with the correct reply/solution to the promblem.
The problem is that i would like to be able to distinguish wether the questions are positive or negative to get the desired output. Currently, the system in designed to respond to negative replies i.e. 'yes' or 'y' which will trigger the appropriate reply. If the response is 'no' or 'n', the system will disgard the fault assosiated to the current question being asked.
For example, if the question is:
'can you turn the key in the ignition' and the user replies "no", the fault will be dismissed, unless the user replies "yes" to this question, the system will assert to the database as a 'fault', therefore giving the wrong solution at the end of the session.
My thought is that i should store with the question a value that reflects the "default" (or no fault) answer, so that the detection of "fault" can be made on that basis (user input differs from "default"). Any suggestions on how to acheive this?
The source code can be obtained here :
Any help will be greatly appreciated!
Thank you