code: private static void randomBranch(Program program, TreeNode x, int s, RandEngine randEngine)
     {
        int child_count = x.arity();
  
        for (int i = 0; i != child_count; i++)
        {
           Primitive non_terminal= program.anyOperatorWithArityLessThan(s, randEngine);
           if (non_terminal == null)
           {
              TreeNode child = new TreeNode(program.anyTerminal(randEngine));
              x.getChildren().add(child);
           }
           else
           {
              TreeNode child = new TreeNode(non_terminal);
              x.getChildren().add(child);
              int b_n=non_terminal.arity();
              int s_pi = (int)Math.floor((double)s / b_n);
              randomBranch(program, child, s_pi, randEngine);
           }
        }
     }
docs: / <param name="?"></param>