Example #1
0
        public List <Node <T> > GetNodes()
        {
            var explorer = TreeExplorer <T> .Get(this);

            var nodes = new List <Node <T> >();

            explorer.ExploreNodes(nodes.Add);
            return(nodes);
        }
Example #2
0
        public double GetRibsSum()
        {
            var explorer = TreeExplorer <T> .Get(this);

            var sum = 0d;

            explorer.ExploreRibs(rib => sum += ClassificationSettings <T> .CalculateDistanceStrategy.GetDistance(rib.FirstNode.Data, rib.SecondNode.Data));
            return(sum);
        }
Example #3
0
        public int GetNodesCount()
        {
            var explorer = TreeExplorer <T> .Get(this);

            var sum = 0;

            explorer.ExploreNodes(node => sum++);
            return(sum);
        }
Example #4
0
        public PlotModel Display()
        {
            _model = new PlotModel();
            var explorer = TreeExplorer <T> .Get(_tree);

            explorer.ExploreRibs(addSeries);
            foreach (var series in _series)
            {
                _model.Series.Add(series);
            }
            return(_model);
        }
Example #5
0
        public Rib <T> GetMaxRib()
        {
            var explorer = TreeExplorer <T> .Get(this);

            var     maxRibLength = 0d;
            Rib <T> maxRib       = null;

            explorer.ExploreRibs(rib =>
            {
                if (rib.Distance > maxRibLength)
                {
                    maxRib       = rib;
                    maxRibLength = rib.Distance;
                }
            });
            return(maxRib);
        }