示例#1
0
        /*********************************************************************/
        /// <summary>
        /// Konstruktor
        /// </summary>
        public CTree()
        {
            mGraph      = new CTreeGraph();
            mEdgeList   = new List <CTreeEdge>();
            mVertexList = new List <CTreeVertex>();

            mRoot = addVertex(null);
            mVertexList.Add(mRoot);
        }
示例#2
0
        /*********************************************************************/
        /// <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);
        }
示例#3
0
        /*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;
        }