Esempio n. 1
0
        private static void CorrectValues(DirectedNode Graph, int LastID)
        {
            SortedList <int, DirectedNode> nums = new SortedList <int, DirectedNode>();

            DirectedNode.FlatTree(Graph, ref nums);
            DirectedNode.Correction(nums[LastID]);
        }
Esempio n. 2
0
        private static void Correction(DirectedNode Graph)
        {
            if (Graph.ID == 0)
            {
                Graph.Value = 4;
                return;
            }
            int num   = 0;
            int count = checked (Graph.Parents.Count - 1);

            for (int i = 0; i <= count; i = checked (i + 1))
            {
                num = checked ((int)Math.Round(Math.Max((double)num, Graph.Parents[i].Value)));
            }
            int count1 = checked (Graph.Parents.Count - 1);

            for (int j = 0; j <= count1; j = checked (j + 1))
            {
                Graph.Parents[j].Value = (double)num - Graph.Parents[j].Value + 6;
                DirectedNode.Correction(Graph.Parents[j]);
            }
        }