Beispiel #1
0
        private double Evaluation()
        {
            Pod my_runner   = Runner(Pods[Id], Pods[Id + 1]);
            Pod my_blocker  = Blocker(Pods[Id], Pods[Id + 1]);
            Pod opp_runner  = Runner(Pods[(Id + 2) % 4], Pods[(Id + 3) % 4]);
            Pod opp_blocker = Blocker(Pods[(Id + 2) % 4], Pods[(Id + 3) % 4]);

            if (my_runner.Timeout <= 0)
            {
                return(-1e7);
            }
            if (opp_runner.Timeout <= 0)
            {
                return(1e7);
            }
            if (opp_runner.Checked > _laps * _checkpointCount || opp_blocker.Checked > _laps * _checkpointCount)
            {
                return(-1e7);
            }
            if (my_runner.Checked > _laps * _checkpointCount || my_blocker.Checked > _laps * _checkpointCount)
            {
                return(1e7);
            }

            var score = my_runner.Score() - opp_runner.Score();

            score -= my_blocker.Distance(checkpoints[opp_runner.CheckpointId]);
            score -= Math.Abs(my_blocker.DiffAngle(opp_runner));

            return(score);
        }