コード例 #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
ファイル: Gamete.cs プロジェクト: taniwha/KerbalStats
        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));
        }