示例#1
0
        private void btnRunClustering_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            if (algorithmSet != null)
            {
                algorithmSet.RunCluster((AlgorithmSet <ICartesianCoordinate> .ClusterAlgorithm)comboBox2.SelectedItem, int.Parse(textBox2.Text), int.Parse(textBox3.Text));

                clusteredGraph = new ClusteredGraphToCostMatrix <ICartesianCoordinate>(algorithmSet.costByReference, algorithmSet.Clusters);

                var costMatrixClusters = clusteredGraph.CostMatrix;

                algorithmSetClusters = new AlgorithmSet <Cluster <ICartesianCoordinate, double> >(algorithmSet.Clusters, costMatrixClusters);
                algorithmSetClusters.ClusterAfterIterationEvent += algorithmSetClusters_ClusterAfterIterationEvent;
            }
            else
            {
                Report("First load a scene");
            }

            panel1.Refresh();
        }
示例#2
0
        private void btnRunClustering_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            if (algorithmSet != null)
            {
                algorithmSet.RunCluster((AlgorithmSet<ICartesianCoordinate>.ClusterAlgorithm)comboBox2.SelectedItem, int.Parse(textBox2.Text), int.Parse(textBox3.Text));

                clusteredGraph = new ClusteredGraphToCostMatrix<ICartesianCoordinate>(algorithmSet.costByReference, algorithmSet.Clusters);
                
                var costMatrixClusters = clusteredGraph.CostMatrix;
                
                algorithmSetClusters = new AlgorithmSet<Cluster<ICartesianCoordinate, double>>(algorithmSet.Clusters, costMatrixClusters);
                algorithmSetClusters.ClusterAfterIterationEvent += algorithmSetClusters_ClusterAfterIterationEvent;
            }
            else
                Report("First load a scene");

            panel1.Refresh();
        }