示例#1
0
 public Edge(Vertex top, Vertex bottom)
 {
     progID++;
     this.Name = "edge" + progID;
     this.Top = top;
     this.Bottom = bottom;
 }
示例#2
0
 public Tree(int depth, int splitSize, LinkedList<Attribute> vertexAttributes, LinkedList<Attribute> edgeAttributes,Vertex v) {
     this.SplitSize = splitSize;
     this.Depth = depth;
     this.VertexAttributes = vertexAttributes;
     this.EdgeAttributes = edgeAttributes;
     this.root = v;
     
 }
示例#3
0
        public Tree(int D,int S,LinkedList<Attribute> VA,LinkedList<Attribute> EA,String t,Vertex cV, XmlTextWriter fW) {

            this.Depth = D;
            this.SplitSize = S;
            this.VertexAttributes = VA;
            this.EdgeAttributes = EA;
            this.type = t;
            this.root = cV;
            this.fileWriter = fW;

        }
示例#4
0
        /// <summary>
        /// Generates a random Tree with your parameters.
        /// Before to call this function you must set VertexAttributes and EdgeAttributes
        /// </summary>
        public void randomGenerateTree() {

            for (int j = 0; j < this.SplitSize && this.Depth > 0; j++) {
                    
                Vertex childVertex = new Vertex(GetRandomAttributes(true, VertexAttributes, EdgeAttributes).ToArray(), new LinkedList<Edge>(), root.Depth+1);
                this.root.append(new Edge(this.root, childVertex, GetRandomAttributes(false, VertexAttributes, EdgeAttributes)));
                Tree subTree = new Tree(this.Depth-1,this.SplitSize,this.VertexAttributes,this.EdgeAttributes,childVertex);
                subTree.randomGenerateTree();
                //Console.WriteLine(j+". Depth: "+this.Depth+" - SplitSize: "+this.SplitSize);
            }

        }
示例#5
0
 public Edge(Vertex top, Vertex btm, Attribute attr) : this(top, btm)
 {
     Attributes = new LinkedList<Attribute>();
     Attributes.AddLast(attr);
 }
示例#6
0
 public Edge(Vertex top, Vertex btm, LinkedList<Attribute> attr) : this(top, btm)
 {
     this.Attributes = attr;
 }