Esempio n. 1
0
        static void Main(string[] args)
        {
            try
            {
                string       format = "f2";
                V4DataOnGrid data   = new V4DataOnGrid("./data.txt");
                data.InitRandom(0, 100);
                Console.WriteLine(data.ToLongString(format));

                V4MainCollection mainCollection = new V4MainCollection();
                mainCollection.AddDefaults();

                Console.WriteLine("mainCollection");
                Console.WriteLine(mainCollection.ToLongString(format));

                Console.WriteLine($"mainCollection.Avg = {mainCollection.Avg.ToString(format)}");

                Console.WriteLine("mainCollection.NearZero(5.0f)");
                IEnumerable <DataItem> items = mainCollection.NearZero(5.0f);
                foreach (DataItem item in items)
                {
                    Console.WriteLine(item);
                }

                Console.WriteLine("mainCollection.OnlyOne");
                IEnumerable <Vector2> vectors = mainCollection.OnlyOne;
                foreach (Vector2 vector in vectors)
                {
                    Console.WriteLine(vector);
                }
                Console.WriteLine("Press Enter to Exit...");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine("Press Enter to Exit...");
                Console.ReadLine();
            }
        }
Esempio n. 2
0
        public void AddDefaults() // Можно изменить параметр на случайные
        {
            V4DataCollection v1 = new V4DataCollection("Test1-0", 50);

            v1.InitRandom(30, 5, 5, 0, 100);

            V4DataCollection v2 = new V4DataCollection("Test1-1", 50);

            v2.InitRandom(0, 5, 5, 0, 100);

            V4DataOnGrid v3 = new V4DataOnGrid("Test2-0", 60, new Grid2D((float)0.5, 10, (float)0.5, 10));

            v3.InitRandom(10, 200);

            V4DataOnGrid v4 = new V4DataOnGrid("Test2-1", 70, new Grid2D((float)1.1, 0, (float)1.1, 0));

            v4.InitRandom(10, 200);

            Add(v1);
            Add(v2);
            Add(v3);
            Add(v4);
        }