Beispiel #1
0
        public void VisualizeRace([Values(8)] int testIndex)
        {
            // ������ ���� bin/Debug/*/racing/visualizer/index.html ����� ���������� ������ �� ����� testIndex
            var greedyRacer = new GreedyRacer();
            var test        = RaceProblemsRepo.GetTests().ElementAt(testIndex);

            RaceController.Play(test, greedyRacer, true);
        }
Beispiel #2
0
        public double CalculateScore1(int depth    = 20, double flagsTakenc = 10000,
                                      double distc = 1, double nextFlagc    = 0.25)
        {
            var score = 0.0;
            var iTest = 0;

            foreach (var test in RaceProblemsRepo.GetTests())
            {
                var racer      = new GreedyRacer(depth, flagsTakenc, distc, nextFlagc);
                var finalState = RaceController.Play(test, racer, false);
                var testScore  = finalState.FlagsTaken * 100 - finalState.Time;
                Console.WriteLine(
                    $"Test #{iTest} score: {testScore} (flags: {finalState.FlagsTaken} of {test.Track.FlagsToTake}, time: {finalState.Time} of {test.Track.RaceDuration})");
                score += testScore;
                iTest++;
            }

            return(score);
        }