Ejemplo n.º 1
0
 public Edge(Vertex top, Vertex bottom)
 {
     progID++;
     this.Name = "edge" + progID;
     this.Top = top;
     this.Bottom = bottom;
 }
Ejemplo n.º 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;
     
 }
Ejemplo n.º 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;

        }
Ejemplo n.º 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);
            }

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