public void AddPartitionInfo(PartitionInfo aPartitionInfo)
        {
            try
            {
                CopyPartitionInfo _copy = new CopyPartitionInfo() { Index = this.CopyPartitionInfoList.Count, PartitionInfo = aPartitionInfo };
                this.CopyPartitionInfoList.Add(_copy);

                this.lv_Alg.ItemsSource = null;
                this.lv_Alg.ItemsSource = CopyPartitionInfoList;

                this.chb_selectAll.IsChecked = true;

                if (lv_Alg.SelectionMode != SelectionMode.Single)
                    this.lv_Alg.SelectAll();
            }
            catch (Exception _ex)
            {
                GeneralTools.Tools.WriteToLog(_ex);
            }
        }
        private void RunFinish(Structuring aStructuring, ConsensusFunction aConsensusFunction)
        {
            try
            {
                ConsensusFunction _EnsembleAlg = aConsensusFunction;
                Structuring _structuring = aStructuring;

                if (_structuring != null)
                {
                    TimeSpan ts = _EnsembleAlg.Time;
                    string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);

                    PartitionInfo _partInfo = new PartitionInfo()
                    {
                        AlgorithmName = this.tb_SelectEnsembleAlg.Text,
                        ConsensusFunction = _EnsembleAlg,
                        Partition = _structuring,
                        AlgorithmType = AlgorithmType.Ensemble,
                        Time = elapsedTime,
                        ElementCount = aConsensusFunction.ReductionElementCount,
                        SearchSpace = ReductionFunction.BellNumber(aConsensusFunction.ReductionElementCount),
                        Index = -1
                    };
                    this.uctrl_ListClusterAlgVisualizerEnsemble.AddPartitionInfo(_partInfo);
                    this.tb_output.Text = _EnsembleAlg.Output;


                    if (NewStructuringEventHandler != null)
                    {
                        NewStructuringEventHandler(this, new NewStructuringEventArgs(_partInfo));
                    }
                }
            }
            catch (Exception _ex)
            {
                GeneralTools.Tools.WriteToLog(_ex);
            }
        }
        private void RunFinish(Structuring aStructuring, ClusterAlgorithm aClusterAlgorithm)
        {
            try
            {
                ClusterAlgorithm _ClusterAlg = aClusterAlgorithm;
                Structuring _structuring = aStructuring;

                if (_structuring != null)
                {
                    TimeSpan ts = _ClusterAlg.Time;
                    string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",ts.Hours, ts.Minutes, ts.Seconds,ts.Milliseconds / 10);

                    PartitionInfo _partinfo = new PartitionInfo()
                    {
                        AlgorithmName = this.tb_SelectClusterAlg.Text,
                        ClusterAlgorithm = _ClusterAlg,
                        Partition = _structuring,
                        AlgorithmType = AlgorithmType.Clustering,
                        Time = elapsedTime,
                        Index = -1
                    };

                    this.uctrl_ListClusterAlgVisualizer.AddPartitionInfo(_partinfo);
                    this.tb_output.Text = _ClusterAlg.Output;

                    if (NewStructuringEventHandler != null)
                    {
                        NewStructuringEventHandler(this, new NewStructuringEventArgs(_partinfo));
                    }

                    //Experimental Mode
                    this.ExperimentalMode = false;
                }
            }
            catch (Exception _ex)
            {
                GeneralTools.Tools.WriteToLog(_ex);
            }
        }
Ejemplo n.º 4
0
 public NewStructuringEventArgs(PartitionInfo aNewStructuring)
 {
     this.fStructuring = aNewStructuring;
 }