thaanx alot i have i did implement it thanks
But it gives me one error(undeclared predicate or fact 'diagnosis/0'
- Thomas Linder Puls
- VIP Member
- Posts: 1424
- Joined: 28 Feb 2000 0:01
I don't know the entire structure of your program, so I don't know the name of the predicate in which you should place the retractAll call.
So diagnose is "random" name representing the process of diagnosing one patient. So the first thing you do when you want to diagnose a patient is to retract all knowledge about the previous patient. Then you do all the other stuff you want to do (i.e. ask patient and symptom info and use your rules).
So diagnose is "random" name representing the process of diagnosing one patient. So the first thing you do when you want to diagnose a patient is to retract all knowledge about the previous patient. Then you do all the other stuff you want to do (i.e. ask patient and symptom info and use your rules).
Regards Thomas Linder Puls
PDC
PDC
-
- Active Member
- Posts: 28
- Joined: 9 Mar 2014 6:35
Thanx alot sir i managed to solve the problem of retract
I have another question that concerned with
Output the diagnose diseases
The above code output the name of the patient and the disease..
I changed the clauses part so that when it doesnt diagnose
To give a note that couldnt diagnose..
The problem i have i that it diagnose and give out only one disease please i need help.
Output the diagnose diseases
Code: Select all
Predicates
gradeDisease: (name Patient) nondeterm.
clauses
gradeDisease(Patient,Disease),
VpiCommonDialogs::note(Patient,tostring(Disease)).
I changed the clauses part so that when it doesnt diagnose
To give a note that couldnt diagnose..
Code: Select all
clauses
gradesDisease(Patient) :-
If hypothesis(Patient, Disease) then
VpiCommonDialogs::note(Patient,tostring(Disease))
else
VPiCommonDialogs::note(Patient, "couldnt diagnose")
End if.
fr@dlu
- Thomas Linder Puls
- VIP Member
- Posts: 1424
- Joined: 28 Feb 2000 0:01
-
- Active Member
- Posts: 28
- Joined: 9 Mar 2014 6:35