Exemplo n.º 1
0
    public double Evaluate(Pod pod, Checkpoint t, Checkpoint t2, double time_to_target)
    {
        double     new_score = 0;
        Checkpoint target;

        if (time_to_target == 0)
        {
            target = t;
        }
        else
        {
            target = t2;
            score += 500;
        }
        double distance_target = Math.Max(Physic.distance2(pod, target) - 50000, 0) * 0.0000001;

        //double triangle_area = Physic.triArea(future_pod, pod, target)*0.0001;
        //double dDistance =  (distance_1_turn - distance_target) * -0.1;


        //while(angle_to_target > 180){angle_to_target = Math.Abs(angle_to_target - 360);}
        new_score -= distance_target - 10 * time_to_target;
        Console.Error.WriteLine("SCORE: " + score + "Distance" + distance_target);
        return(new_score);
    }
Exemplo n.º 2
0
    public double move(double t, Checkpoint target)
    {
        double time    = 0;
        double go_next = 0;

        while (time < t)
        {
            x += vx * 0.1;
            y += vy * 0.1;

            if (go_next == 0)
            {
                if (Physic.distance2(this, target) < 250000)
                {
                    go_next = time + 0.1;
                }
            }
            time += 0.1;
        }
        return(go_next);
    }