@Override
 public ExprTree mutateExprTree(ExprTree ptree, ExprTreeSchema schema, IRandGen randgen) {
   // Copy of expr
   ExprTree stree = ptree.copy();
   // Node selection
   int selectIndex = randgen.choose(0, ptree.size());
   // Mutated node
   IPrimitive oldBlock = stree.getBlock(selectIndex);
   Class<?> rtype = oldBlock.returnType();
   int arity = oldBlock.argumentTypes().length;
   IPrimitive newBlock = schema.getAnyBlock(rtype, randgen, arity);
   stree.setBlock(newBlock, selectIndex);
   // Return result
   return stree;
 }
Exemple #2
0
 /** {@inheritDoc} */
 public double getRandom(IRandGen randgen) {
   return randgen.uniform(efLeft(), efRight());
 }