예제 #1
0
        public void EvaluateAgents(IEnumerable <ICarAI> agents, List <Parameters> maps)
        {
            this.Initalise(agents);

            foreach (var map in maps)
            {
                // Copy the map
                lineSegments = map.Map;
                carSimScreen.SetLineSegments(lineSegments);

                // Set our starting position (initial heading is always straight down)
                this.startPosition = map.StartPosition.Value;

                carSimScreen.InitaliseCars(map.Checkpoints, this.startPosition, 0);

                this.EvaluateAgents();

                window.Clear();
                window.Display();

                Thread.Sleep(100);
            }


            window.Clear();

            var text = new FontText(new Font("SimData\\Fonts\\Calibri.ttf"), $"Training Generation {gen++}...", Color.White)
            {
                Scale = 2
            };
            var cameraPosition = carSimScreen.Camera.GetView().Center;

            window.DrawString(text, cameraPosition);
            window.Display();
        }