private void CalcQuestionIsNextPossibility() { if (QuestionsNotAsked.Count == 0 || AnswersAll.Count == 0) { return; } var answersWithMaxPoss = AnswersAll.Where(a => a.Possibility == AnswersAll[0].Possibility).ToList()[0];; foreach (var q in QuestionsNotAsked) { float maxChangeOfPossibility = 0; List <float> diffPosForReactions = new List <float>(); foreach (Reaction react in Enum.GetValues(typeof(Reaction))) { var tmp = ExactReactionOnQuestionRelativelyAnswerPossibility(react, q, answersWithMaxPoss); diffPosForReactions.Add(tmp); } q.PossibilityOfThisIsNext = Fuzz.Or(diffPosForReactions.ToArray()); } QuestionsAll = QuestionsAll.OrderByDescending(o => o.PossibilityOfThisIsNext).ToList(); }
/// <summary> /// pAiB розраховується індивідуально для кожної відповідіі - може щось не так /// </summary> private float CalcCurrAnswerPossibility(Answer answer) { if (QuestionAndReactionHistory.Count == 0) { return(CalcApriorAnswerPossibility(answer)); } List <float> Bj = new List <float>(); foreach (var pair in QuestionAndReactionHistory) { var react = pair.Value; var question = pair.Key; var rezPossibil = ExactReactionOnQuestionRelativelyAnswerPossibility(react, question, answer); Bj.Add(rezPossibil); } var rez = Fuzz.Or(Bj.ToArray()); return(rez); }