net.sf.amiba.impl.scientific
Class ScientificGrammar

Object
  extended by GeneGrammar<Double>
      extended by ScientificGrammar

public class ScientificGrammar
extends GeneGrammar<Double>

Author:
juber patel

Constructor Summary
ScientificGrammar(List<Character> terminals, Character linkingFunction)
           
 
Method Summary
 String decode(Gene gene)
          explain the given gene in a human readable form
 int getMaximumArity()
          get the maximum arity among the operators of this grammar
 List<Character> getOperators()
          return the operators that are valid for this grammar
protected  Double link(List<Double> geneValues)
          Link the separate gene values in the Individual and assign a representative value to them.
protected  GEPRootNode<Double> parse(String sequence)
          parse the given sequence and return the root of the AST.
protected  double percentError(Double calculated, Double expected)
          compare the Individual's value for a fitness case to the expected value of the fitness case and express the difference as (positive double) percent error in estimation.
 
Methods inherited from class GeneGrammar
evaluate, getAlphabet, getLinkingFunction, getTerminals, isOperator, isTerminal, useOn
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScientificGrammar

public ScientificGrammar(List<Character> terminals,
                         Character linkingFunction)
Parameters:
terminals -
linkingFunction -
Method Detail

decode

public String decode(Gene gene)
Description copied from class: GeneGrammar
explain the given gene in a human readable form

Specified by:
decode in class GeneGrammar<Double>
Returns:

getMaximumArity

public int getMaximumArity()
Description copied from class: GeneGrammar
get the maximum arity among the operators of this grammar

Specified by:
getMaximumArity in class GeneGrammar<Double>
Returns:

getOperators

public List<Character> getOperators()
Description copied from class: GeneGrammar
return the operators that are valid for this grammar

Specified by:
getOperators in class GeneGrammar<Double>

parse

protected GEPRootNode<Double> parse(String sequence)
                             throws AmibaException
Description copied from class: GeneGrammar
parse the given sequence and return the root of the AST. To be implemented using JavaCC. This is the entry point into the grammar specification

Specified by:
parse in class GeneGrammar<Double>
Returns:
Throws:
AmibaException

link

protected Double link(List<Double> geneValues)
Description copied from class: GeneGrammar
Link the separate gene values in the Individual and assign a representative value to them. The implementation should make collective sense of gene values so as to assign a value to the Individual.

Specified by:
link in class GeneGrammar<Double>
Returns:

percentError

protected double percentError(Double calculated,
                              Double expected)
Description copied from class: GeneGrammar
compare the Individual's value for a fitness case to the expected value of the fitness case and express the difference as (positive double) percent error in estimation. This number will be used as a measure of error in the Individual The calculated value should be compared with the expected value and a measure of the difference should be returned. The returned value will generally be percent error. The higher the returned value, the higher the error.

Specified by:
percentError in class GeneGrammar<Double>
Returns:
a value indicating percent error