Esempio n. 1
0
        public void Reset()
        {
            int  index = 0;
            long ECC = 0, OCC = 0;

            foreach (var x in Corner.odd)
            {
                OCPs[index++] = (OCC += cornerParity.Test(true) && cornerLimit.Test(x) ? x.Count : 0) * 2.0 / Corner.Sum;
            }
            OCP = OCPs[OCPs.Length - 1];
            CC  = index = 0;
            foreach (var x in Corner.even)
            {
                ECPs[index++] = (ECC += cornerParity.Test(false) && cornerLimit.Test(x) ? x.Count : 0) * 2.0 / Corner.Sum;
            }
            ECP = ECPs[ECPs.Length - 1];
            CC  = OCC + ECC;
            CP  = ECP + OCP;
            CF  = (double)OCC / CC;

            WC = 0;
            double OWC = 0, wingSum = (double)Wing.Sum;

            for (index = 0; index < WPs.Length; ++index)
            {
                if (wingLimit.Test(Wing.list[index]))
                {
                    WPs[index] = (double)(WC += Wing.list[index].Count) / wingSum;
                    if (Wing.list[index].Parity == 1)
                    {
                        OWC += (double)Wing.list[index].Count / wingSum;
                    }
                }
            }
            WP = WPs[WPs.Length - 1];
            WF = OWC / (double)WC;

            XCC = XCenter.GetCount(xcLimit);
            XCP = (double)XCC / XCenter.Sum;
        }