コード例 #1
0
        private void RandomPointDataGenerator(string minX, string maxX, string minY, string maxY, string pointSize)
        {
            Generate generate = new Generate();

            //Init random points coordinates
            Points = generate.InitializeRandomPoints(int.Parse(pointSize), double.Parse(minX), double.Parse(maxX), double.Parse(minY), double.Parse(maxY));

            ShowPoints();

            if (Points.Count > 0)
            {
                GenerateClustersToolStripMenuItem.Enabled = true;
            }
        }
コード例 #2
0
        private void RandomClusterDataGenerator(string clustersize)
        {
            Generate generate = new Generate();

            //Init random points coordinates

            var maxX = Double.MinValue;
            var maxY = Double.MinValue;
            var minX = Double.MaxValue;
            var minY = Double.MaxValue;

            var points = Points;

            foreach (var point in points)
            {
                if (maxX < point.X)
                {
                    maxX = point.X;
                }

                if (maxY < point.Y)
                {
                    maxY = point.Y;
                }

                if (minX > point.X)
                {
                    minX = point.X;
                }

                if (minY > point.Y)
                {
                    minY = point.Y;
                }
            }

            Clusters = generate.InitializeRandomClusters(int.Parse(clustersize), minX, maxX, minY, maxY);

            ShowClusters();
        }