Exemplo n.º 1
0
 public void UpdateSwarm()
 {
     Parallel.ForEach(swarm, p => {
         FIS fis = new FIS();
         while (p.HasMoves)
         {
             p.Speed = fis.getSpeed(p.Speed, p.Acceleration, p.Brake);
             p.WheelAngle = fis.getWheelAngle(p.SteeringWheel);
             p.NextMove();
         }
     });
 }
Exemplo n.º 2
0
 public WorldController()
 {
     Bitmap map = new Bitmap(1000, 700);
     Graphics g = Graphics.FromImage(map);
     g.FillRectangle(new SolidBrush(Color.White), 0, 0, map.Width, map.Height);
     g.Dispose();
     drawer = new Drawer("C:\\Users\\André\\Desktop\\map.png"); //Loading the map and drawer
     car = new Car(55, 30); //L = C*0.55
     car.X = 100;
     car.Y = 100;
     drawer.AddDrawable(car); //Adding car to the drawable list
     fis = new FIS();
     pso = new PSOHandler(500, 1000);
 }