/*********************************************************************/ /// <summary> /// Konstruktor /// </summary> public CTree() { mGraph = new CTreeGraph(); mEdgeList = new List <CTreeEdge>(); mVertexList = new List <CTreeVertex>(); mRoot = addVertex(null); mVertexList.Add(mRoot); }
/*********************************************************************/ /// <summary> /// Setzt den Baum auf den Initalzustand mit einem leeren Root-Knoten /// zurück /// </summary> public void resetTree() { // alle bestehenden Knoten und Verbindungen des Baumes löschen /*foreach (CTreeEdge edge in mEdgeList) * { * mGraph.RemoveEdge(edge); * }*/ mEdgeList.Clear(); /*foreach (CTreeVertex vertex in mVertexList) * { * mGraph.RemoveVertex(vertex); * }*/ mGraph = new CTreeGraph(); mVertexList.Clear(); mRoot = null; mRoot = addVertex(null); }
/*protected int mNumObjects; * protected int mNumObjectsYes; * protected int mNumObjectsNo; * protected double mEntropy; * * public void setDemoData(string vertexName, int countObjects, int countObjectsYes, int countObjectsNo, double entropy) * { * if (vertexName != "") * { * mAttributeType = new CAttributeType(0); * mAttributeType.Name = vertexName; * } * * mNumObjects = countObjects; * mNumObjectsYes = countObjectsYes; * mNumObjectsNo = countObjectsNo; * mEntropy = entropy; * }*/ #endregion /*********************************************************************/ /// <summary> /// Konstruktor /// </summary> /// <param name="parent">Übergeordneter Knoten im Baum</param> /// <param name="attributeType">Attributtyp nach dem aufgeteilt werden soll</param> public CTreeVertex(CTreeVertex parent, CTreeGraph graph, CAttributeType attributeType = null) { mParentVertex = parent; mGraph = graph; AttributeType = attributeType; }