GrowInitialiser implements CreationOperation, Stochastic { public Genotype getGenotype(int maxLength) { genotype = new Genotype(); chromosome = new GEChromosome(this.initChromSize); chromosome.setMaxChromosomeLength(maxLength); genotype.add(chromosome); NimbleTree<Symbol> dt = new NimbleTree<Symbol>(); TreeNode<Symbol> tn = new TreeNode<Symbol>(); tn.setData(grammar.getStartSymbol()); dt.populateStack(); dt.setRoot(tn); dt.setCurrentNode(dt.getRoot()); grow(dt); if (this.extraCodons > 0) { for (int i = 0; i < this.extraCodons; i++) { this.chromosome.add(this.rng.nextInt(Integer.MAX_VALUE)); } } return genotype; } GrowInitialiser(RandomNumberGenerator rng, GEGrammar gegrammar, int maxDepth);  GrowInitialiser(RandomNumberGenerator rng, GEGrammar gegrammar, Properties p); void setRNG(RandomNumberGenerator m); RandomNumberGenerator getRNG(); void setProperties(Properties p); Individual createIndividual(); int getMinDepth(); void setMinDepth(int minDepth); void setMaxDepth(int i); int getMaxDepth(); void doOperation(Individual operand); void doOperation(List<Individual> operands); Genotype getGenotype(int maxLength); boolean grow(NimbleTree<Symbol> dt);  }
@Test public void testGetGenotype() { System.out.println("getGenotype"); int maxLength = 10; Genotype result = gi1.getGenotype(maxLength); assertEquals(true, result.size() < 10); assertEquals(true, result.size() > 0); }