예제 #1
0
        public void Properties()
        {
            Algorithm a = new Algorithm();

            mtg tree = new mtg();
            int root = tree.root;

            int root1 = tree.AddComponent(root);
            int vid   = a.RandomTree(tree, root1, 18);

            List <int> childAndComplex = tree.AddChildAndComplex(vid);

            vid = a.RandomTree(tree, childAndComplex[0], 18);

            List <int> childAndComplex2 = tree.AddChildAndComplex(vid);

            vid = a.RandomTree(tree, childAndComplex2[0], 18);

            Assert.IsTrue(tree.PropertyNames().Contains("Edge_Type"));
            Assert.AreEqual(18 * 3, tree.Property("Edge_Type").Count);
        }
예제 #2
0
        public void RandomTree()
        {
            Algorithm a = new Algorithm();

            mtg tree = new mtg();
            int root = tree.root;

            int root1 = tree.AddComponent(root);

            root1 = tree.AddComponent(root1);
            int vid = a.RandomTree(tree, root1, 18);

            List <int> childAndComplex = tree.AddChildAndComplex(vid);

            vid = a.RandomTree(tree, childAndComplex[0], 18);

            List <int> childAndComplex2 = tree.AddChildAndComplex(vid);

            vid = a.RandomTree(tree, childAndComplex2[0], 18);

            Assert.AreEqual(61, tree.NbVertices());
        }
예제 #3
0
        public void AddChildAndComplex()
        {
            mtg tree = new mtg();
            int root = tree.root;

            int root1 = tree.AddComponent(root);
            int root2 = tree.AddComponent(root1);

            int vertex12 = tree.AddChild(root2);
            int vertex22 = tree.AddChild(vertex12);

            List <int> vertexAndComplex32 = tree.AddChildAndComplex(vertex22);

            int vertex32        = vertexAndComplex32[0];
            int vertex32complex = vertexAndComplex32[1];

            Assert.AreEqual(7, tree.NbVertices());
            CollectionAssert.Contains(tree.Children(vertex22), vertex32);
            CollectionAssert.Contains(tree.Children(root1), vertex32complex);
        }