コード例 #1
0
 public Form1(ref ANN network, int gameIndex)
 {
     InitializeComponent();
     food           = new Food(randFood);
     superfood      = new SuperFood();
     baditem        = new Bad_Item(randBaditem);
     this.network   = network;
     this.gameIndex = gameIndex;
     watch          = Stopwatch.StartNew();
 }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            int populationSize = 10;

            DataGame.InnitGameState(populationSize);
            DataGame[] lstDataGame   = new DataGame[populationSize];
            ANN        NeuralNetwork = new ANN(ref lstDataGame, populationSize);

            NeuralNetwork.createFirstGeneration();
            for (int i = 0; i < lstDataGame.Length - 1; i++)
            {
                Task.Run(() =>
                {
                    App(ref NeuralNetwork, i);
                });
                Thread.Sleep(1000);
            }
            Application.Run(new Form1(ref NeuralNetwork, lstDataGame.Length - 1));
        }
コード例 #3
0
 static void App(ref ANN network, int gameIndex)
 {
     Application.Run(new Form1(ref network, gameIndex));
 }