예제 #1
0
        private int PickDemotableNode(GPInitializer initializer, GPNode root, int num, GPFunctionSet funcs)
        {
            // if I have just one type, skip this and just
            // the num-th nonterminal
            if (initializer.NumAtomicTypes + initializer.NumSetTypes == 1)
            {
                _demotableNode = root.NodeInPosition(num, GPNode.NODESEARCH_ALL);
                return(-1); // what PickDemotableNodeDirtyWork() returns...
            }

            // otherwise, I gotta do the dirty work
            return(PickDemotableNodeDirtyWork(initializer, root, num, funcs));
        }