SymbolicRegressionIntrepreter implements FitnessFunction, Stochastic { public void calculateTarget(final String target) { this.program = target.split(" "); this.calculated_target = new double[this.samples.length]; for (int i = 0; i < this.samples.length; i++) { for (int j = 0; j < this.x.length; j++) { this.x[j] = this.samples[i][j]; } this.programCounter = 0; this.calculated_target[i] += this.run(); } } SymbolicRegressionIntrepreter(); Range getRange(); void setRange(Range range); void calculateTarget(final String target); void setProperties(Properties p); RandomNumberGenerator getRNG(); void setRNG(RandomNumberGenerator m); void getFitness(final Individual ind); boolean canCache(); void setSamples(double[][] samples); void setX(double[] x);  }
@Test public void testCalculateTarget() { System.out.println("* SymbolicRegressionIntrepreterTest: calculateTarget"); String target = ""; try { instance.calculateTarget(target); } catch(IllegalArgumentException e) { assertTrue(true); } target = "* x0 x1"; double[] expected = {6, 12}; instance.calculateTarget(target); JUnitHelper.checkArrays(instance.calculated_target, expected); }