Пример #1
0
        /// <summary>
        /// The build batch tree.
        /// </summary>
        /// <param name="factory">
        /// The factory.
        /// </param>
        /// <param name="degree">
        /// The degree.
        /// </param>
        /// <typeparam name="T">
        /// Parameter type string/double.
        /// </typeparam>
        public void BuildBatchTree <T>(ITreeFactory factory, int degree)
        {
            List <List <T> > batchData = this.GetBatchData <T>();

            foreach (var data in batchData)
            {
                ITree <T> genericTree = factory.GetTree <T>(degree);
                int       count       = data.Count;
                for (int i = 0; i < count; i++)
                {
                    genericTree.Add(data[i]);
                    this.CalculateProgress(i, count);
                }

                this.AddToBatchList(genericTree);
            }
        }
Пример #2
0
        /// <summary>
        /// The build tree from file.
        /// </summary>
        /// <param name="factory">
        /// The factory.
        /// </param>
        /// <param name="degree">
        /// The degree.
        /// </param>
        /// <typeparam name="T">
        /// Parameter type string/double.
        /// </typeparam>
        public void BuildTreeFromFile <T>(ITreeFactory factory, int degree)
        {
            ITree <T> genericTree = factory.GetTree <T>();
            List <T>  temp        = this.GetData <T>();
            int       count       = 0;

            if (this.CheckType <T>().Equals("text"))
            {
                count = this.provider.TextData.Count;
            }

            if (this.CheckType <T>().Equals("numeric"))
            {
                count = this.provider.NumericData.Count;
            }

            for (int i = 0; i < count; i++)
            {
                genericTree.Add(temp[i]);
                this.CalculateProgress(i, count);
            }

            this.AddToList(genericTree);
        }
Пример #3
0
        /// <summary>
        /// The build tree.
        /// </summary>
        /// <param name="factory">
        /// The factory.
        /// </param>
        /// <param name="degree">
        /// The degree.
        /// </param>
        /// <typeparam name="T">
        /// Parameter type string/double.
        /// </typeparam>
        public void BuildTree <T>(ITreeFactory factory, int degree)
        {
            ITree <T> genericTree = factory.GetTree <T>(degree);

            this.AddToList(genericTree);
        }