Ejemplo n.º 1
0
        public void Mutate()
        {
            KnownSituation randomSituation = AllKnownSituations[Random.Range(0, AllKnownSituations.Count())];
            KnownAction    randomAction    = AllKnownActions[Random.Range(0, AllKnownActions.Count())];

            this.SituationMap[randomSituation] = randomAction;
        }
Ejemplo n.º 2
0
        public static DNA CreateRandomDna()
        {
            DNA randomDna = new DNA();

            randomDna.MaximumSpeed    = Random.Range(1, 6);
            randomDna.ViewingDistance = Random.Range(1, 8);
            foreach (KnownSituation situation in AllKnownSituations)
            {
                KnownAction randomAction = AllKnownActions[Random.Range(0, AllKnownActions.Count())];
                randomDna.SituationMap[situation] = randomAction;
            }

            return(randomDna);
        }