<< | Home | Stuff | Download | Link | >>
____________________________________________________________________________________________
Expert
System Using JAVA-html Shell
Many of consultation centers, research, games or even websites use an expert system. It will make the web looks more interactive and attractive. To build it, we can choose 2 methods of building an expert system :
First Method
The components encompass all of the expert system work. Generally expert system consist of particular components which have particular relation. The components are knowledge base, rule interpreter, blackboard/memory, user interface, explanation/reason, and knowledge refining system. This method require a good knowledge and expertise in a programming skill. You can see from Expert system Using Visual Prolog.
Second Method
In this method we can use shell to build expert system. The knowledge base in this system is generic, so it can be use in a different field of application with modifying the knowledge base. It is more easier and it is eligible for a beginner like me. But it does not flexible and not suitable because we must follow the shell capability.
You can download the shell from : www.clips.org
Samples:
If the java applet did not display, you may download
auto expert system and run in your computer. I had a problem when tried to up load this page because I involved java applet. The java applet sometimes doesn't display. But I guarantee you will have no problem when you try auto expert system and run in your computer as long as you follow the procedures as you can read from readme. If you have the solution for this problem please tell me.From the sample auto.zip (extract all files to the same folder, read the readme file), you will find an auto service expert system. This sample using java shell. The rules of this expert system based on "auto.kb" file. This file is knowledge base. The rules will decide and lead to the final results.
The auto.kb content/listing program :
REM Test knowledge base
RULE [Is the battery dead?]
If [the result of switching on the headlights] = "nothing happens" or
[the result of trying the starter] = "nothing happens"
Then [the recommended action] = "recharge or replace the battery"
RULE [Is the car out of gas?]
If [the gas tank] = "empty"
Then [the recommended action] = "refuel the car"
RULE [Is the battery weak?]
If [the result of trying the starter] : "the car cranks slowly" "the car cranks normally" and
[the headlights dim when trying the starter] = true and
[the amount you are willing to spend on repairs] > 24.99
Then [the recommended action] = "recharge or replace the battery"
RULE [Is the car flooded?]
If [the result of trying the starter] = "the car cranks normally" and
[a gas smell] = "present when trying the starter"
Then [the recommended action] = "wait 10 minutes, then restart flooded car"
RULE [Is the gas tank empty?]
If [the result of trying the starter] = "the car cranks normally" and
[a gas smell] = "not present when trying the starter"
Then [the gas tank] = "empty" @ 90
PROMPT [the result of trying the starter] Choice CF
"What happens when you turn the key to try to start the car?"
"the car cranks normally"
"the car cranks slowly"
"nothing happens"
PROMPT [a gas smell] MultChoice CF
"The smell of gasoline is:"
"present when trying the starter"
"not present when trying the starter"
PROMPT [the result of switching on the headlights] MultChoice CF
"The result of switching on the headlights is:"
"they light up"
"nothing happens"
PROMPT [the headlights dim when trying the starter] YesNo CF
"Do the headlights dim when you try the starter with the lights on?"
PROMPT [the gas tank] MultChoice CF
"According to the fuel gauge, the gas tank is:"
"empty"
"not empty"
PROMPT [the amount you are willing to spend on repairs] Numeric CF
"How much are you willing to spend on repairs? (enter value 0->500)"
"0"
"500.0"
GOAL [the recommended action]
MINCF 80
You can modify the knowledge base by changing the listing program (in this color and in this color)As you can see from the listing above, actually only 2 things that important to modify the expert system.
You will find rules which signed by assignment word "RULE[..............]......". As you can see the RULE is a decision operation (if...or/and...then...) which consist of conditionX and decisionX. "prompt/visualizationX" is value from the condition. "prompt/visualization" will display on the interface and have relation with "PROMPT[.........]....." subroutine.
RULE [
rule1 ]
If [ condition1 ] = "prompt
/visualization1 " or
[condition2] = "prompt/visualization2"
Then [decision1] = "prompt/visualization3"
RULE [ rule2 ]
If [ condition3 ] = "prompt
/visualization4 " and
[condition4] = "prompt/visualization5"
Then [decision2] = "prompt/visualization6"
And you will find prompts which signed by assignment word "PROMPT[........].....". This subroutine will display as a question when you have start the consultation season. You can change the Choice Type (use in this color assignment word).The question can be a multiple choice/using radio button (MultChoice), yes/no choice (YesNo), multiple choice/using scroll down (Choice). From listing above
PROMPT [condition1]
Choice Type CF
"The Question"
"prompt/visualization1"
"prompt/visualization4"
"prompt/visualization7"
First RULE that will check is the first one (Upper row from the program). As an example from listing above, decision1 will be choose as a final result if condition1 or condition2 is true. These 2 conditions are expressing rule1. And so for rule2. When you start the consultation season you will find a confident level choice (50-100%). This confident level will effect when you are choosing <100%, you will have another question season.
It will better if you try the program, see for your self. When you start the consultation season you may see the rule by clicking "Why ask" button. It will help you to understand how the program work.
Download Section :
Expert system auto.zip
Literatures :
Book : "Kecerdasan Buatan" : Artificial Intelligent Handout, Physics Engineering UGM by Ir. Balza Achmad, M.ScE
Artificial Inteligent lecturing task I, 2001, lecturer: Ir.Balza Achmad, M.ScE
Web : www.expertise2go.com
Comment :
Any suggestions, comments, etc. E-mail me: fridiant@yahoo.com
_____________________________________________________________________________________________________________________
<< | Home | Stuff | Download | Link | >>
_______________________________________________________________________________________________________
Tiar Fridianto @ 2004 : fridiant@yahoo.com