This page (revision-16) was last changed on 06-Jun-2017 09:17 by Albrecht Striffler

This page was created on 17-Dec-2012 14:42 by Markus Friedrich

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
16 06-Jun-2017 09:17 6 KB Albrecht Striffler to previous
15 11-May-2016 14:14 6 KB Albrecht Striffler to previous | to last
14 03-May-2016 12:06 6 KB Albrecht Striffler to previous | to last
13 17-Mar-2015 08:02 6 KB Markus Friedrich to previous | to last
12 12-Mar-2015 01:45 6 KB Albrecht Striffler to previous | to last
11 12-Mar-2015 01:42 6 KB Albrecht Striffler to previous | to last
10 26-Feb-2015 11:50 6 KB Albrecht Striffler to previous | to last
9 25-Feb-2013 14:43 6 KB Albrecht Striffler to previous | to last
8 25-Feb-2013 13:00 6 KB Albrecht Striffler to previous | to last
7 25-Feb-2013 12:50 6 KB Albrecht Striffler to previous | to last
6 25-Feb-2013 12:50 6 KB Albrecht Striffler to previous | to last
5 18-Feb-2013 12:53 6 KB Albrecht Striffler to previous | to last
4 17-Dec-2012 17:45 6 KB constin to previous | to last
3 17-Dec-2012 14:56 6 KB Markus Friedrich to previous | to last
2 17-Dec-2012 14:49 5 KB Markus Friedrich to previous | to last
1 17-Dec-2012 14:42 5 KB Markus Friedrich to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 138 changed 5 lines
private KnowledgeBase buildKnowledgeBase() throws IOException {
// root {container}
// - demoQuestion {containers}
// - pregnant [oc]
// - weight [num]
private KnowledgeBase buildKnowledgeBase() throws IOException {
// root {container}
// - demoQuestion {containers}
// - pregnant [oc]
// - weight [num]
At line 144 changed 4 lines
// Solution: dangerousMood
InitPluginManager.init();
KnowledgeBaseManagement kbm = KnowledgeBaseManagement.createInstance();
QASet root = kbm.getKnowledgeBase().getRootQASet();
// Solution: dangerousMood
InitPluginManager.init();
KnowledgeBase kb = KnowledgeBaseUtils.createKnowledgeBase();
At line 149 changed 5 lines
demoQuestions = kbm.createQContainer("demoQuestions", root);
pregnant = kbm.createQuestionOC("pregnant", demoQuestions, new String[] { "yes",
"no" });
yes = new ChoiceValue(kbm.findChoice(pregnant, "yes"));
weight = kbm.createQuestionNum("weight", "weight", demoQuestions);
QContainer demoQuestion = new QContainer(kb.getRootQASet(), "demoQuestions");
QuestionYN pregnant = new QuestionYN(demoQuestion, "pregnant");
At line 155 changed 13 lines
dangerousMood = kbm.createSolution("dangerousMood");
// Define the init questionnaire
kbm.getKnowledgeBase().setInitQuestions(Arrays.asList(demoQuestions));
// Define the magic rule: preganant=yes AND weight > 70 => dangerousMood (P7)
List<Condition> terms = new ArrayList<Condition>();
terms.add(new CondEqual(pregnant, yes));
terms.add(new CondNumGreater(weight, Double.valueOf(70)));
RuleFactory.createHeuristicPSRule("r1", dangerousMood, Score.P7, new CondAnd(terms));
return kbm.getKnowledgeBase();
}
Choice yes = pregnant.getAnswerChoiceYes();
QuestionNum weight = new QuestionNum(demoQuestion, "weight");
Solution dangerousMood = new Solution(kb.getRootSolution(), "dangerousMood");
// Define the init questionnaire
kb.setInitQuestions(Arrays.asList(demoQuestion));
// Define the magic rule: preganant=yes AND weight > 70 => dangerousMood
// (P7)
List<Condition> terms = new ArrayList<Condition>();
terms.add(new CondEqual(pregnant, new ChoiceValue(yes)));
terms.add(new CondNumGreater(weight, Double.valueOf(70)));
RuleFactory.createHeuristicPSRule(dangerousMood, Score.P7, new CondAnd(terms));
return kb;
}