예제 #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;
        }
예제 #2
0
        public BioClock(GenePair[] genes)
        {
            for (int i = 0; i < genes.Length; i++)
            {
                var g = genes[i];
                switch (g.trait.name)
                {
                case "BioClockTC":
                    bioClockTC = g;
                    break;

                case "BioClockInverse":
                    bioClockInverse = g;
                    break;

                case "MaturationTimeK":
                    maturationK = (g.trait as TimeK).K(g);
                    break;

                case "MaturationTimeP":
                    maturationP = (g.trait as TimeP).P(g);
                    break;

                case "AgingTimeK":
                    agingK = (g.trait as TimeK).K(g);
                    break;

                case "AgingTimeP":
                    agingP = (g.trait as TimeP).P(g);
                    break;
                }
            }
            bc_trait = bioClockTC.trait as BioClockTC;
        }
예제 #3
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;
            }
        }
예제 #4
0
        double CalcBirth()
        {
            double k      = 1;
            PRange pRange = null;

            for (int i = 0; i < genes.Length; i++)
            {
                switch (genes[i].trait.name)
                {
                case "GestationPeriodK":
                    k = (genes[i].trait as TimeK).K(genes[i]);
                    break;

                case "GestationPeriodP":
                    pRange = (genes[i].trait as TimeP).P(genes[i]);
                    break;
                }
            }
            var p = pRange.P(subp);
            var l = bioClock.GestationPeriod;

            return(MathUtil.WeibullQF(l, k, p));
        }