Beispiel #1
0
        private void _ability_askForHelp()
        {
            var question = _databaseQuestion();

            _askedQuestion = question;

            _body.Print(_askedQuestion.ReadableRepresentation());
        }
Beispiel #2
0
        private double rankQuestion(SemanticItem question)
        {
            var q     = question.Question;
            var score = 0.0;

            if (q == Question.IsItTrue)
            {
                score += 0.1;
            }
            else if (q == Question.Entity)
            {
                score += 0.0;
            }
            else if (q == Question.HowToEvaluate)
            {
                score += 0.2;
            }
            else if (q == Question.WhatShouldAgentDoNow)
            {
                score += 0.1;
            }
            else if (q == Question.HowToDo)
            {
                score += 0.1;
            }
            else
            {
                score += 1;
            }

            score += 1.0 / (1.0 + question.Constraints.VariableValues.Count());
            var inputWords      = new HashSet <string>(_body.InputHistory.Last().Split(' '));
            var commonWordCount = question.ReadableRepresentation().Split(' ').Sum(qw => _body.InputHistory.Contains(qw) ? 1 : 0);

            score += commonWordCount;
            return(score);
        }