Function to be implemented

In the project, there are many not implemented functions. This function need to be implemented by the user. The main skeleton of the project are done and user need to implement decision part of the project.

DataBase interface

First part, which must be implemented is DataBase interface. This part is used for storing answers from the console. User could implement this part as he want, for example you can use HashMap. You could add some support function but don’t change interface. You need to implement functions:

  • addAnswer - add new answer to database (based on object Answer)
  • getAnswer - get answer from database based on predicate
  • getAllAnswers - return list of all answers
  • contains - check, if answer was already stored

InferenceEngine

In the template are not implemented inference engines. In the project is prepared interface for inference engine and also templates for backward and forward chaining. You need to implement function startInference for each engine. You could add any support function but don’t change interface of engine. You could only add some function to interface if you need.

KnowledgeBase

Knowledge base is fully implemented in the project. You should use this in Inference engines. Only files, that you need to edit are located in src/expertsystemfw/KnowledgeBase/Files. These files are used to load semantic network, uncertainty model and knowledge base. In these files will be located all settings and informations need to decide conclusion.

  • FOLKnowledgeBase - In this file knowledge base are defined based on first-order logic
  • RulesKnowledgeBase - In this files you can specify Knowledge base with IF … THEN … rules
  • SemanticNetworkKnowledgeBase - In this file you can specify knowledge base as semantic network
  • Uncertainty - In this files specify uncertainty of conclusions

UserInterface

In this package you need to specify and implement user interface. These function are used for communicate with the user. All of them should be called from interference engine. For calling other function from askUser there is observer pattern. There is prepared notifyWhy, notifyHow, notifyStart and notifyStop. If you notify one of those, you need to overide update method in interference engine, which should call target function in interference engine (Backward or Forward). There are located 4 main function for user interface

  • conclude - Show user conclusion
  • askUser - Ask user to some question and do something based on answer
  • explainWhy - Based on the conclusion, explains what is the inference engine up for at the moment.
  • explainHow - Based on the list of answers, explains how did the inference engine get to the point where it is now.

UncertaintyModule

User need to implement uncertainty module. Only basic interface is prepared. User need to implement basic Bayes uncertainty. THis module should be used by Inference engine, to get some certainty information about predicates and conclusions.

Main function

In the file ExpertSystemFW is located main. You don’t need to change here anything. If you want to change interference engine from backward to forward, change class that is created here.