Beispiel #1
0
    private void BotInputWithBallMoving(PlayerInput input)
    {
        if (Args.GameMode != GameMode.Play && Args.Immobilize)
        {
            return;
        }

        float[] movingNeuralNetInput = ExtractorWithBall.Extract(this);

        float[] movingNeuralNetOutput = MovingWithBallNeuralNet.Think(movingNeuralNetInput);

        if (Team == Team.Away)
        {
            movingNeuralNetOutput[0] *= -1;
            movingNeuralNetOutput[1] *= -1;
        }

        input.Up    = movingNeuralNetOutput[0] > 0.1f;
        input.Down  = movingNeuralNetOutput[0] < -0.1f;
        input.Left  = movingNeuralNetOutput[1] > 0.1f;
        input.Right = movingNeuralNetOutput[1] < -0.1f;
    }
Beispiel #2
0
 public void LoadFromDisc(string path)
 {
     MovingNeuralNet.Load(Path.Combine(path, MOVING_NEURAL_NET));
     MovingWithBallNeuralNet.Load(Path.Combine(path, MOVING_WITH_BALL_NEURAL_NET));
     KickingBallNeuralNet.Load(Path.Combine(path, KICKING_BALL_NEURAL_NET));
 }
Beispiel #3
0
 public void SaveTodisc(string path)
 {
     MovingNeuralNet.Save(Path.Combine(path, MOVING_NEURAL_NET));
     MovingWithBallNeuralNet.Save(Path.Combine(path, MOVING_WITH_BALL_NEURAL_NET));
     KickingBallNeuralNet.Save(Path.Combine(path, KICKING_BALL_NEURAL_NET));
 }