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 1 removed 2 lines
[{TableOfContents }]
At line 8 removed one line
At line 10 removed one line
At line 20 removed one line
At line 23 changed 2 lines
The [Interview|https://isci.informatik.uni-wuerzburg.de/javadoc/d3web/de/d3web/core/session/interviewmanager/Interview.html], which can be accessed from the session by using the interview problem solver (PSMethod), determines the next question to be presented to the user. More precisely, a {{FormStrategy}} computes the next {{From}} that is presented in the dialog.
A Form consists of a title and a list of active questions:
The [Interview|https://isci.informatik.uni-wuerzburg.de/javadoc/d3web/de/d3web/core/session/interviewmanager/Interview.html], instantiated with the Session, determines the next question to be presented to the user. More precisely, a {{FormStrategy}} computes the next {{From}} that is presented in the dialog.
A Form consists of a title and an {{interviewObject}} (a Question of a QContainer):
At line 28 changed 3 lines
Interview interview = session.getSessionObject(session.getPSMethodInstance(PSMethodInterview.class));
Form form = interview.nextForm();
List<Question> activeQuestions = form.getActiveQuestions();
Form form = session.getInterview().nextForm();
InterviewObject interviewObject = form.getInterviewObject();
At line 38 changed one line
interview.setFormStrategy(new NextUnansweredQuestionFormStrategy());
session.getInterviewManager().setFormStrategy(new NextUnansweredQuestionFormStrategy());
At line 37 added one line
At line 49 changed 6 lines
Question question = kb.getManager().searchQuestion("QuestionName");
ChoiceValue value = new ChoiceValue("ChoiceName");
Fact fact = FactFactory.createFact(session, question, value,
PSMethodUserSelected.getInstance(),
PSMethodUserSelected.getInstance());
Fact fact = FactFactory.createFact(question, value,
PSMethodUserSelected.getInstance(),
PSMethodUserSelected.getInstance());
At line 58 changed one line
At line 62 removed one line
At line 68 removed one line
At line 71 changed 2 lines
for (Solution solution : knowledgeBase.getManager().getSolutions()) {
Rating state = session.getBlackboard().getRating(solution);
for (Solution solution : knowledgeBase.getSolutions()) {
Rating state = session.getBlackboard().getState(solution);
At line 80 removed one line
At line 90 removed one line
At line 92 added one line
At line 110 removed one line
At line 115 changed one line
At line 117 changed 2 lines
// Create a case (problem-solving session and set
// all specified question/answers
// Create a case (problem-solving session and set all specified
// question/answers
At line 123 changed 2 lines
Fact fact1 = FactFactory.createUserEnteredFact(
pregnant, yes);
Fact fact1 = FactFactory.createFact(pregnant, yes, PSMethodUserSelected
.getInstance(), PSMethodUserSelected.getInstance());
At line 128 changed 2 lines
Fact fact2 = FactFactory.createUserEnteredFact(
weight, new NumValue(80));
Fact fact2 = FactFactory.createFact(weight, new NumValue(80),
PSMethodUserSelected.getInstance(),
PSMethodUserSelected.getInstance());
At line 132 changed one line
At line 135 changed 3 lines
for (Solution solution : knowledgeBase.getManager().getSolutions()) {
Rating state = session.getBlackboard().getRating(solution);
if (!state.hasState(Rating.State.UNCLEAR)) {
for (Solution solution : knowledgeBase.getSolutions()) {
Rating state = session.getBlackboard().getState(solution);
if (!state.hasState(Rating.State.UNCLEAR))
At line 139 removed one line
}
At line 150 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 156 changed 4 lines
// Solution: dangerousMood
InitPluginManager.init();
KnowledgeBase kb = KnowledgeBaseUtils.createKnowledgeBase();
QASet root = kb.getRootQASet();
// Solution: dangerousMood
InitPluginManager.init();
KnowledgeBase kb = KnowledgeBaseUtils.createKnowledgeBase();
At line 161 changed 4 lines
demoQuestions = new QContainer(root, "demoQuestions");
pregnant = new QuestionOC(demoQuestions, "pregnant", "yes", "no");
yes = new ChoiceValue(KnowledgeBaseUtils.findChoice(pregnant, "yes"));
weight = new QuestionNum(demoQuestions, "weight");
QContainer demoQuestion = new QContainer(kb.getRootQASet(), "demoQuestions");
QuestionYN pregnant = new QuestionYN(demoQuestion, "pregnant");
At line 166 changed one line
dangerousMood = new Solution(kb.getRootSolution(), "dangerousMood");
Choice yes = pregnant.getAnswerChoiceYes();
At line 168 changed 2 lines
// Define the init questionnaire
kb.setInitQuestions(Arrays.asList(demoQuestions));
QuestionNum weight = new QuestionNum(demoQuestion, "weight");
At line 171 changed 6 lines
// 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) 70));
RuleFactory.createHeuristicPSRule(dangerousMood, Score.P7, new CondAnd(terms));
Solution dangerousMood = new Solution(kb.getRootSolution(), "dangerousMood");
At line 178 changed 2 lines
return kb;
}
// 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;
}
At line 172 added one line