// Start is called before the first frame update void Start() { highscore = 0f; timer = Utils.TIMER; NEAT = GetComponent <NEATManager>(); guiManager = FindObjectOfType <GUIManager>(); players = new List <PlayerController>(); foods = new List <Food>(); foodMap = new Dictionary <Tuple <int, int>, List <Food> >(); for (int i = foods.Count; i < Utils.FOOD_MAX; i++) { SpawnFood(); } }
public static void Main(string[] args) { NEATManager manager = new NEATManager(3, 2, CalculateFitness, 200, NEATMode.Separately); for (int i = 0; i < manager.PopulationSize * 10; i++) { //Console.WriteLine("Player " + manager.CurrentPlayerIndex); //Console.WriteLine("Decision : " + manager.ThinkCurrent(new float[] { 1.5f, 0.72f, -1.618f })); manager.KillCurrent(new int[] { i, 2 }); //Console.WriteLine("Fitness : " + manager.Players[manager.CurrentPlayerIndex - 1].Fitness+"\n"); } //Uncomment this if you are using Visual Studio instead of MonoDevelop Console.WriteLine("\nPress any key to close the program."); Console.ReadKey(); }
private void Start() { neat = GetComponent <NEATManager>(); gm = GetComponent <GameManager>(); }