public static PhonesActivityWindowManger Init(int window, int numOfNodes, int amsVectorLength, HashFunctionTable[] hashFunctionTable, PhonesActivityDataParser phonesActivityDataParser, GeographicalDistributing distributingMethod)
        {
            StrongBox <PhonesActivityWindowManger> phonesActivityWindowManager = new StrongBox <PhonesActivityWindowManger>(null);
            var lazyWindow = new Lazy <WindowedStatistics>(() => WindowedStatistics.Init(ArrayUtils.Init(window, _ => phonesActivityWindowManager.Value.GetNextAmsVectors())));

            phonesActivityWindowManager.Value = new PhonesActivityWindowManger(numOfNodes, amsVectorLength, hashFunctionTable, phonesActivityDataParser, lazyWindow, distributingMethod);
            return(phonesActivityWindowManager.Value);
        }
示例#2
0
        public static DatabaseAccessesStatistics Init(string databaseAccessesPath, int numOfNodes, int windowSize, Func <int, int, int, int> distributeFunc)
        {
            var vectorCountsEnumerator =
                Parsing.TimedDataAccess.createVectorCountsSequence(distributeFunc, numOfNodes, databaseAccessesPath)
                .GetEnumerator();
            var window = WindowedStatistics.Init(vectorCountsEnumerator.Take(windowSize));

            return(new DatabaseAccessesStatistics(window, vectorCountsEnumerator));
        }