code: public static Primitive anyPrimitive(Program program, int allowableDepth, TGPInitializationStrategy method, RandEngine randEngine)
     {
        int terminal_count = (program.getVariableSet().size() + program.getConstantSet().size());
        int function_count = program.getOperatorSet().size();
  
        double terminal_prob=(double)terminal_count / (terminal_count + function_count);
        if (allowableDepth <= 0 || (method == TGPInitializationStrategy.INITIALIZATION_METHOD_GROW && randEngine.uniform() <= terminal_prob))
        {
           return program.anyTerminal(randEngine);
        }
        else
        {
           return program.anyOperator(randEngine);
        }
     }
docs: / <returns></returns>