private void OnEvaluatingUpdate(float dt)
        {
            simulation.OnUpdate(dt);

            if (IsVisualizationEnabled)
            {
                simulationVisualization.OnUpdate(dt);
            }

            if (TrackEvaluationFinished)
            {
                // Increment to the next track
                currentTrackIndex++;

                // All evaluation has finished, move onto breeding
                if (currentTrackIndex == tracks.Count)
                {
                    this.trainingState = TrainState.Breeding;
                    return;
                }

                // Will reset all cars to the initial position for the track provided
                simulation.SetTrack(currentTrack);
                simulation.Reset();

                // Resets all car visuals & sets new track visualization
                if (IsVisualizationEnabled)
                {
                    simulationVisualization.SetTrack(currentTrack);
                    simulationVisualization.Reset();
                }
            }
        }
Beispiel #2
0
 public override void OnUpdate(float deltaT)
 {
     base.OnUpdate(deltaT);
     simulation.OnUpdate(deltaT);
     simulationVisualization.OnUpdate(deltaT);
 }