KnowledgeBase.ConclusionDoneEvent event
Occurs when a rule may or may not conclude that a particular fact.
Namespace : ielib
Assembly : ielib.dll
public event RuleEventHandler ConclusionDoneEventpublic delegate void RuleEventHandler(Object sender, KnowledgeStatus eStatus, Rule r)ParametersType : System.Object.
sender : Source of the event, it is often an object of the
class KnowledgeBase.
Type : ielib.KnowledgeBase.KnowledgeStatus.
eStatus : Represents the value of the event status.
enum KnowledgeBase.KnowledgeStatus :eUnknown : An unknown event.
eYes : This rule is satisfied or deductible.
eNo : This rule is not satisfied or is not deductible.
Type : ielib.Rule
r : Represents the object of the
Rule class.
Example : Suppose we had a rule 77 and that we wanted to engage a display of an image when this rule will be concluded, We can to subscribe us to this event.
main()
{
KnowledgeBase Kb = new KnowledgeBase("MyBase.xml");
// Subscribe to the ConclusionDoneEvent event
Kb.ConclusionDoneEvent += new RuleEventHandler(E_Conclusion_Done);
InferenceEngine ie = new InferenceEngine(Kb);
ChainingResult result = ie.Run();
}
void E_Conclusion_Done(Object sender, KnowledgeStatus eStatus, Rule r)
{
If (eStatus == KnowledgeBase.KnowledgeStatus.eYes && r.Id == 77)
{
// Using the Process class of .NET object to display the image.
System.Diagnostics.Process.Start("C:\User\John\Documents\Images\MyImage.jpg");
}
}