// Kill Agent, Will probalby have it respawn mayyybe? If you get the time brah do what you gotta do. void Die() { if (evade.targetedBy != null) { evade.targetedBy.GetComponent <Ship>().IndividualKilledEnemy(); } // Update FitnessCalculator with fitness of this indidvidual FitnessCalculation fc = GameObject.Find("_SCRIPTS").GetComponent <FitnessCalculation> (); fc.SetFitness(individual, true); Destroy(gameObject); }
// Use this for initialization void Start() { fc = GetComponent <FitnessCalculation> (); crossover = GetComponent <CrossoverAlgorithm> (); spawnLocations = new Vector3[popSize]; for (int i = 0; i < spawnLocations.Length; i++) { spawnLocations[i].x = Random.Range(-20f, 20f); spawnLocations[i].y = Random.Range(-20f, 20f); spawnLocations[i].z = 0; } // Debug.Log ("Population Script: Loaded"); Initialize(popSize, true); }
// Public Initialze Indivdual. Declare Genes. public void Initialize() { fitnessCalculator = GameObject.Find("_SCRIPTS").GetComponent <FitnessCalculation> (); ship = GetComponent <Ship> (); }
// Use this for initialization void Start() { fc = GetComponent <FitnessCalculation> (); }