コード例 #1
0
    void Start()
    {
        TrialActive = -1;

        IsGoaled    = false;
        IsTimedOut  = false;
        ElapsedTime = 0f;

        CurrentMaxFitness = 0f;
        FitnessList       = new List <float>(Positions.Length);

        OptimizationManager = Optimizer.GetComponent <OptimizationManager>();
        PositionCounter     = 0;

        GoalScorer = Goal.GetComponent <GoalScorerController>();

        Robot = (GameObject)Instantiate(Resources.Load("ShootingCar"), new Vector3(0f, 3f, 15f), Quaternion.identity);
        ShootingController = Robot.GetComponent <ShootingController>();
        ShootingController.Initialize(Ball, Goal);

        RobotRigidbody = Robot.GetComponent <Rigidbody>();
        BallRigidbody  = Ball.GetComponent <Rigidbody>();
    }
コード例 #2
0
 /// <summary>
 /// Sets the manager of the drone.
 /// The reference will be used to send the result of the experiment (the fitness)
 /// </summary>
 public void setFather(OptimizationManager om)
 {
     father = om;
 }