//Helper functions start
        //---------------------------------------------------------
        //---------------------------------------------------------

        /// <summary>
        /// MeasureAllGames is called when all games end. It will call methods of
        /// evaluating scores for all abilities.
        /// </summary>
        private static void MeasureAllGames()
        {
            // Measure abilities for Balloons
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayBalloons)
            {
                PointingMeasure.EvaluateBalloonsScore();
                SelectiveVisualMeasure.EvaluateBalloonsScore();
                InhibitionMeasure.EvaluateBalloonsScore();
            }

            // Measure abilities for Squares
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlaySquares)
            {
                SelectiveVisualMeasure.EvaluateSquaresScore();
                VisuospatialSketchpadMeasure.EvaluateSquaresScore();
            }

            // Measure abilities for Catch The Thief
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayCTF)
            {
                InhibitionMeasure.EvaluateCTFScore();
                SelectiveVisualMeasure.EvaluateCTFScore();
            }

            // Measure abilities for ImageHit
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayImageHit)
            {
                ObjectRecognitionMeasure.EvaluateImageHitScore();
                InhibitionMeasure.EvaluateImageHitScore();
                SelectiveVisualMeasure.EvaluateImageHitScore();
            }

            // Measure abilities for Catch The Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetCatchTheBall)
            {
                TimeToContact.EvaluateCatchTheBallScore();
            }

            // Measure abilities for Save One Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetSaveOneBall)
            {
                TimeToContact.EvaluateSaveOneBallScore();
            }

            // Measure abilities for Judge The Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetJudgeTheBall)
            {
                TimeToContact.EvaluateJudgeTheBallScore();
            }
        }
Beispiel #2
0
            public void WHEN_EvaluateSaveOneBallScoreCalledWithNoData_THEN_ScoreOfNegative1IsObtained()
            {
                Setup();

                TimeToContact.EvaluateSaveOneBallScore();
                SubscoreStorage subscore = TimeToContact.GetSubScoreForSaveOneBall();

                Assert.AreEqual(-1, subscore.Score);
            }
Beispiel #3
0
            public void SaveOneBallSubScoreCalculatedAsAccuracyAverageBetweenRounds()
            {
                Setup();

                TimeToContact.saveOneBallData = new SaveOneBallStorage
                {
                    TargetRadius = DUMMY_TARGET_RADIUS,
                    Rounds       = new List <SaveOneBallStorage.BallRound>
                    {
                        new SaveOneBallStorage.BallRound
                        {
                            LeftActualTimeToContact     = 3.5F,
                            RightActualTimeToContact    = 3.5F,
                            PredictedTimeToContact      = 5F,
                            DidPredictFirstArrivingBall = true,
                        },
                        new SaveOneBallStorage.BallRound
                        {
                            LeftActualTimeToContact     = 5.6F,
                            RightActualTimeToContact    = 5.6F,
                            PredictedTimeToContact      = 5,
                            DidPredictFirstArrivingBall = false
                        },
                        new SaveOneBallStorage.BallRound
                        {
                            LeftActualTimeToContact     = 9F,
                            RightActualTimeToContact    = 9F,
                            PredictedTimeToContact      = 8.3F,
                            DidPredictFirstArrivingBall = true
                        },
                    }
                };

                TimeToContact.EvaluateSaveOneBallScore();

                // FLOOR(1/3 * ((100 - |1 - 5/3.5|*100) + 0 + (100 - |1 - 8.3/9|*100))) = 49

                Assert.AreEqual(49, TimeToContact.GetSubScoreForSaveOneBall().Score);
            }
Beispiel #4
0
            public void WHEN_SaveOneBallPlayedPerfectlyInAllRounds_THEN_SubscoreOf100IsObtained()
            {
                Setup();

                TimeToContact.saveOneBallData = new SaveOneBallStorage
                {
                    TargetRadius = DUMMY_TARGET_RADIUS,
                    Rounds       = new List <SaveOneBallStorage.BallRound>
                    {
                        new SaveOneBallStorage.BallRound
                        {
                            LeftActualTimeToContact     = 3.5F,
                            RightActualTimeToContact    = 3.5F,
                            PredictedTimeToContact      = 3.5F,
                            DidPredictFirstArrivingBall = true
                        },
                        new SaveOneBallStorage.BallRound
                        {
                            LeftActualTimeToContact     = 5.6F,
                            RightActualTimeToContact    = 5.6F,
                            PredictedTimeToContact      = 5.6F,
                            DidPredictFirstArrivingBall = true
                        },
                        new SaveOneBallStorage.BallRound
                        {
                            LeftActualTimeToContact     = 8.3F,
                            RightActualTimeToContact    = 8.3F,
                            PredictedTimeToContact      = 8.3F,
                            DidPredictFirstArrivingBall = true
                        },
                    }
                };

                TimeToContact.EvaluateSaveOneBallScore();

                Assert.AreEqual(100, TimeToContact.GetSubScoreForSaveOneBall().Score);
            }