FitnessEvaluation
Class InterpretedFitnessEvaluationBSF

java.lang.Object
  extended by FitnessEvaluation.InterpretedFitnessEvaluation
      extended by FitnessEvaluation.InterpretedFitnessEvaluationBSF
All Implemented Interfaces:
FitnessFunction, ParameterI
Direct Known Subclasses:
BinomialBSF, EvenFiveParityFitnessBSF, HelloWorldBSF, SantaFeAntTrailBSF, SymbolicRegressionBSF

public abstract class InterpretedFitnessEvaluationBSF
extends InterpretedFitnessEvaluation

Interprets code using the BSF framework (http://jakarta.apache.org/bsf/)

Author:
erikhemberg

Field Summary
protected  org.apache.bsf.BSFManager mngr
           
 
Constructor Summary
InterpretedFitnessEvaluationBSF()
          Creates a new instance of InterpretedFitnessEvaluationGr
 
Method Summary
protected abstract  java.lang.String createCode(Phenotype p)
          Create code by adding header and tail to the evolved input
 double runFile(Phenotype p)
          Create a header and a tail for the input string.
 
Methods inherited from class FitnessEvaluation.InterpretedFitnessEvaluation
canCache, getFitness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Parameter.ParameterI
setProperties
 

Field Detail

mngr

protected final org.apache.bsf.BSFManager mngr
Constructor Detail

InterpretedFitnessEvaluationBSF

public InterpretedFitnessEvaluationBSF()
Creates a new instance of InterpretedFitnessEvaluationGr

Method Detail

createCode

protected abstract java.lang.String createCode(Phenotype p)
Create code by adding header and tail to the evolved input

Parameters:
p - input
Returns:
code

runFile

public double runFile(Phenotype p)
Create a header and a tail for the input string. Uses the groovy language Inserts the input from the phenotype. Adds a tail. Call eval in the BSF manager to interpret the class.

Specified by:
runFile in class InterpretedFitnessEvaluation
Parameters:
p - the input to be evaluated
Returns:
fitness of the input