AForge.Genetic.GPCustomTreeNode.ToString C# (CSharp) Метод

ToString() публичный Метод

Get string representation of the node.

String representation of the node lists all node's children and then the node itself. Such node's string representations equals to its reverse polish notation.

For example, if nodes value is '+' and its children are '3' and '5', then nodes string representation is "3 5 +".

public ToString ( ) : string
Результат string
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (Children != null)
            {
                // walk through all nodes
                foreach (GPCustomTreeNode node in Children)
                {
                    sb.Append(node.ToString());
                }
            }

            // add gene value
            sb.Append(Gene.ToString());
            sb.Append(" ");

            return sb.ToString();
        }