コード例 #1
0
        public Boolean TrainCombatController()
        {
            if (loopcount == 0)
            {
                // Initial step

                view.ShowInit(map, agents.Bots);
                Console.WriteLine("-- Combat map --");
                Console.WriteLine("Start Combat training... ");

                if (loopcount % 1000 == 0)
                {
                    Console.WriteLine("> Iteration " + loopcount);
                }
                agents.Execute_Combat(map, config, true, stat_com, loopcount);

                //view.Show(map, agents.Bots);
                //Console.ForegroundColor = ConsoleColor.Black;

                loopcount++;
            }
            else if (loopcount >= config.iterationlimit)
            {
                // End of iterations

                stat_com.WriteStat_Combat(outputfolder, "stat_com.csv", "visual_com.csv", config.botnum);

                loopcount++;
            }
            else
            {
                // Step in training

                if (loopcount % 1000 == 0)
                {
                    Console.WriteLine("> Iteration " + loopcount);
                }
                agents.Execute_Combat(map, config, false, stat_com, loopcount);

                agents.CheckAgentRespawn(config);

                //view.Show(map, agents.Bots);
                //Console.ForegroundColor = ConsoleColor.Black;

                loopcount++;
            }

            return(loopcount > config.iterationlimit);
        }