public PassiveGene(bool male)
    {
        this.male             = male;
        this.health           = u.map(u.randomGause(), 0.0f, 1.0f, 20.0f, 100.0f);
        this.thirst           = u.map(u.randomGause(), 0.0f, 1.0f, 80.0f, 100.0f);
        this.hunger           = u.map(u.randomGause(), 0.0f, 1.0f, 80.0f, 100.0f);
        this.searchRadius     = u.map(u.randomGause(), 0.0f, 1.0f, 2.5f, 20.0f);
        this.moveSpeed        = u.map(u.randomGause(), 0.0f, 1.0f, 0.1f, 10.0f);
        this.turnSpeed        = (float)Random.Range(0.1f, 5.5f);
        this.timeTillNextMove = Random.Range(1.0f, 3.0f);
        this.gestation        = u.map(u.randomGause(), 0.0f, 1.0f, 5.0f, 30.0f);
        this.urge             = u.map(u.randomGause(), 0.0f, 1.0f, 0.0f, 100.0f);
        this.cost             = ((moveSpeed * turnSpeed) + searchRadius) / timeTillNextMove;
        this.desireable       = u.map((moveSpeed + searchRadius), 2.6f, 30.0f, 0.0f, 100.0f);
        this.gestation        = Random.Range(0.0f, 10.0f);
        this.numChildren      = u.map(gestation, 1.0f, gestation, 1, 4);
        cost = u.map(cost, 2, 110, 0.1f, 5.0f);



        genes.Add(this.health);
        genes.Add(this.thirst);
        genes.Add(this.hunger);
        genes.Add(this.searchRadius);
        genes.Add(this.moveSpeed);
        genes.Add(this.turnSpeed);
        genes.Add(this.cost);
        genes.Add(this.timeTillNextMove);
        genes.Add(this.gestation);
        genes.Add(this.urge);
        genes.Add(desireable);
        genes.Add(numChildren);
    }
예제 #2
0
    public AggressiveGene(bool male)
    {
        this.male             = male;
        this.health           = u.map(u.randomGause(), 0.0f, 1.0f, 60.0f, 100.0f);
        this.thirst           = u.map(u.randomGause(), 0.0f, 1.0f, 60.0f, 100.0f);
        this.hunger           = u.map(u.randomGause(), 0.0f, 1.0f, 60.0f, 100.0f);
        this.searchRadius     = u.map(u.randomGause(), 0.0f, 1.0f, 5.5f, 55.0f);
        this.moveSpeed        = u.map(u.randomGause(), 0.0f, 1.0f, 7.5f, 25.0f);
        this.turnSpeed        = (float)Random.Range(1.1f, 8.5f);
        this.timeTillNextMove = Random.Range(1.0f, 4.0f);
        this.gestation        = u.map(u.randomGause(), 0.0f, 1.0f, 10.0f, 30.0f);
        this.urge             = u.map(u.randomGause(), 0.0f, 1.0f, 0.0f, 160.0f);
        this.cost             = ((moveSpeed * turnSpeed) + searchRadius) / timeTillNextMove;
        this.desireable       = u.map((moveSpeed + searchRadius), 1.1f, 16.0f, 0.0f, 100.0f);
        this.gestation        = Random.Range(0.0f, 30.0f);
        this.numChildren      = u.map(gestation, 0.0f, 30.0f, 1, 4);

        cost = u.map(cost, 0, ((25 * 8.5f) * 55) / 4f, 0.1f, 6.0f);



        genes.Add(this.health);
        genes.Add(this.thirst);
        genes.Add(this.hunger);
        genes.Add(this.searchRadius);
        genes.Add(this.moveSpeed);
        genes.Add(this.turnSpeed);
        genes.Add(this.cost);
        genes.Add(this.timeTillNextMove);
        genes.Add(this.gestation);
        genes.Add(this.urge);
        genes.Add(desireable);
        genes.Add(numChildren);
    }