Пример #1
0
        private List <T> GetTrendingModelsCustomCriteria(int windowPeriod, int numberOfSegmentsOfEachUnit, IEnumerable <T> listOfModels)
        {
            TrendingContext <T> trendingContext = new TrendingContext <T>(new TrendingCalculateForCustomCriteria <T>());
            List <T>            trendingModels  = (List <T>)trendingContext.ContextInterface(windowPeriod, numberOfSegmentsOfEachUnit, listOfModels);

            return(trendingModels);
        }
Пример #2
0
        private List <T> GetTrendingModelsZMeanCriteria(int windowPeriod, int numberOfSegmentsOfEachUnit, IEnumerable <T> listOfModels)
        {
            TrendingContext <T> trendingContext = new TrendingContext <T>(new TrendingCalculateForZMeanCriteria <T>());
            List <T>            trendingModels  = (List <T>)trendingContext.ContextInterface(windowPeriod, numberOfSegmentsOfEachUnit, listOfModels);
            List <T>            trendingModelsGlobalZMeanCriteria = new List <T>();
            double meanGlobalZ = GlobalZCalculationZMeanCriteria <T> .meanGlobalZ;

            foreach (T model in trendingModels)
            {
                if (model.GlobalZ >= meanGlobalZ)
                {
                    trendingModelsGlobalZMeanCriteria.Add(model);
                }
            }
            if (trendingModelsGlobalZMeanCriteria.Count > 1)
            {
                SortingGLobalZ <T> sortingGLobalZ = new SortingGLobalZ <T>();
                trendingModelsGlobalZMeanCriteria.Sort(0, trendingModelsGlobalZMeanCriteria.Count, sortingGLobalZ);
            }
            return(trendingModelsGlobalZMeanCriteria);
        }