Esempio n. 1
0
 /// <summary>
 /// Handles the <see cref="E:EmotionFound" /> event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="EmotionEventArgs"/> instance containing the event data.</param>
 private void OnEmotionFound(object sender, EmotionEventArgs e)
 {
     if (EmotionFound != null)
     {
         EmotionFound(sender, e);
     }
 }
Esempio n. 2
0
        public Boolean IsUserConfident(EmotionEventArgs e)
        {
            //Sum up emotions that could infer unconfidence
            double unConfidence = e.Anger + e.Contempt + e.Fear + e.Sadness + e.Disgust;
            double confidence   = e.Happiness + e.Neutral + e.Surprise;

            Boolean isConfident = false;

            if (confidence > unConfidence)
            {
                isConfident = true;
            }

            return(isConfident);
        }
Esempio n. 3
0
        public Boolean GenerateNewProblemBasedOnConfidence(EmotionEventArgs e)
        {
            //Sum up emotions that could infer unconfidence
            double unConfidence = e.Anger + e.Contempt + e.Fear + e.Sadness + e.Disgust;
            double confidence   = e.Happiness + e.Neutral + e.Surprise;

            Boolean generateNewProblem = false;

            if (confidence <= unConfidence)
            {
                //Multiply 100 to get percentage and then truncate to integer
                int oddsToGenerateNewProblem = (int)(100 * (unConfidence));
                int randomNumber             = ProblemGenerator.rng.Next(1, 101);
                if (randomNumber <= oddsToGenerateNewProblem)
                {
                    generateNewProblem = true;
                }
            }

            return(generateNewProblem);
        }
 public void emotionEvent(object source, EmotionEventArgs e)
 {
     Emotion = e.nearest;
 }