Example #1
0
        public Cycle(GenePair[] genes, BioClock bioClock)
        {
            for (int i = 0; i < genes.Length; i++)
            {
                var g = genes[i];
                switch (g.trait.name)
                {
                case "CyclePeriodK":
                    cycleK = (g.trait as TimeK).K(g);
                    break;

                case "CyclePeriodP":
                    cycleP = (g.trait as TimeP).P(g);
                    break;

                case "OvulationTimeK":
                    ovulationK = (g.trait as TimeK).K(g);
                    break;

                case "OvulationTimeP":
                    ovulationP = (g.trait as TimeP).P(g);
                    break;
                }
            }

            cycleL     = bioClock.CyclePeriod;
            ovulationL = bioClock.OvulationTime;
        }
Example #2
0
        public Gamete(GenePair[] genes, bool isFemale, BioClock bioClock)
        {
            for (int i = 0; i < genes.Length; i++)
            {
                var g = genes[i];
                switch (g.trait.name)
                {
                case "GameteLifeK":
                    gameteK = (g.trait as TimeK).K(g);
                    break;

                case "GameteLifeP":
                    gameteP = (g.trait as TimeP).P(g);
                    break;
                }
            }
            if (isFemale)
            {
                gameteL = bioClock.EggLife;
            }
            else
            {
                gameteL = bioClock.SpermLife;
            }
        }
Example #3
0
 void init()
 {
     bioClock = new BioClock(genes);
 }