Esempio n. 1
0
        public void Populate(IObjectWithPathAndChildren source)
        {
            if (name.isNullOrEmpty())
            {
                name = source.name;
            }

            var allChilren = source.getAllChildren();

            foreach (var item in allChilren)
            {
                Int32 ChildrenCount = 0;
                foreach (var citem in item)
                {
                    ChildrenCount++;
                }

                ChildrenCountRange.Learn(ChildrenCount);

                if (ChildrenCount == 0)
                {
                    LeafNodes++;
                    LeafLevelRange.Learn(item.level);
                }
                LevelRange.Learn(item.level);
            }

            TotalCount = allChilren.Count;
        }
Esempio n. 2
0
        public StructureGraphInformation GetDifference(StructureGraphInformation other)
        {
            StructureGraphInformation output = new StructureGraphInformation();

            output.name       = "Difference between " + name + " and " + other.name;
            output.InputCount = InputCount - other.InputCount;
            output.TotalCount = TotalCount - other.TotalCount;
            output.LeafNodes  = LeafNodes - other.LeafNodes;

            output.LevelRange         = LevelRange.GetDifference(other.LevelRange);
            output.LeafLevelRange     = LeafLevelRange.GetDifference(other.LeafLevelRange);
            output.ChildrenCountRange = ChildrenCountRange.GetDifference(other.ChildrenCountRange);

            return(output);
        }