public Edge(Vertex top, Vertex bottom) { progID++; this.Name = "edge" + progID; this.Top = top; this.Bottom = bottom; }
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; }
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; }
/// <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); } }
public Edge(Vertex top, Vertex btm, Attribute attr) : this(top, btm) { Attributes = new LinkedList<Attribute>(); Attributes.AddLast(attr); }
public Edge(Vertex top, Vertex btm, LinkedList<Attribute> attr) : this(top, btm) { this.Attributes = attr; }