public void BeBorn(HumanAI father, HumanAI mother) { //gameObject.transform.position = Vector3.Slerp(father.gameObject.transform.position, // mother.gameObject.transform.position, // 0.5F); XCS = new Behaviour(possibleActions, father.XCS, mother.XCS, stateSize); }
public Behaviour(List<Action> possibleActions, Behaviour mother, Behaviour father, int stateSize) { // learn rule size NumRules = (mother.NumRules + father.NumRules) / 2 + (int)(Random.value * 5) - 3; if (NumRules < 10) NumRules = 10; RuleSet.AddRange(mother.RuleSet); RuleSet.AddRange(father.RuleSet); RuleSet.Add(new Rule(possibleActions, stateSize)); // Innovation RuleSet.Sort(); RuleSet.RemoveRange(NumRules, RuleSet.Count - NumRules); this.possibleActions = possibleActions; }
void Start() { XCS = new Behaviour(possibleActions, stateSize); Sex = Random.value > 0.5 ? Gender.Female : Gender.Male; gameObject.name = "Human"; gameObject.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); Update(); }