com.anji.imaging
Class IdentifyImageFitnessFunction

java.lang.Object
  extended bycom.anji.imaging.IdentifyImageFitnessFunction
All Implemented Interfaces:
BulkFitnessFunction, Configurable, java.io.Serializable

public class IdentifyImageFitnessFunction
extends java.lang.Object
implements BulkFitnessFunction, Configurable

Fitness is determined by the number of images identified correctly. A frink is roughly the amount of JVM processing power a Dell Latitude C600 850MHz w/ 256 MB RAM can perform in one millisecond. Parameter EVAL_MILLIS_KEY determines the number of frinks each net is allotted per image.

Author:
Philip Tucker
See Also:
Serialized Form

Field Summary
static java.lang.String IMG_MATCH_DIR_KEY
          directory containing images to match
static java.lang.String IMG_MISMATCH_DIR_KEY
          directory containing images not to match
static int MAX_FITNESS
          max fitness value
static java.lang.String SURFACE_CLASS_KEY
          implements Surface; object to handle image manipulation
 
Constructor Summary
IdentifyImageFitnessFunction()
          default ctor
 
Method Summary
 int evaluate(Chromosome c)
          Returns int between 0 and MAX_FITNESS relative to # images ANN (transcribed from c) is able to identify correctly.
 void evaluate(java.util.List subjects)
          Calculates and sets the fitness values on each of the given Chromosomes via their setFitnessValue() method.
 int evaluateEnsemble(java.util.Collection ensemble)
          Returns int between 0 and MAX_FITNESS relative to # images ANNs (transcribed from ensemble) are able to identify correctly.
 int getMaxFitnessValue()
           
 void init(Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMG_MATCH_DIR_KEY

public static final java.lang.String IMG_MATCH_DIR_KEY
directory containing images to match

See Also:
Constant Field Values

IMG_MISMATCH_DIR_KEY

public static final java.lang.String IMG_MISMATCH_DIR_KEY
directory containing images not to match

See Also:
Constant Field Values

SURFACE_CLASS_KEY

public static final java.lang.String SURFACE_CLASS_KEY
implements Surface; object to handle image manipulation

See Also:
Constant Field Values

MAX_FITNESS

public static final int MAX_FITNESS
max fitness value

See Also:
Constant Field Values
Constructor Detail

IdentifyImageFitnessFunction

public IdentifyImageFitnessFunction()
default ctor

Method Detail

evaluate

public void evaluate(java.util.List subjects)
Description copied from interface: BulkFitnessFunction
Calculates and sets the fitness values on each of the given Chromosomes via their setFitnessValue() method.

Specified by:
evaluate in interface BulkFitnessFunction
Parameters:
subjects - List contains Chromosome objects for which the fitness values must be computed and set.
See Also:
BulkFitnessFunction.evaluate(java.util.List), evaluate(Chromosome)

evaluate

public int evaluate(Chromosome c)
             throws TranscriberException,
                    java.io.IOException
Returns int between 0 and MAX_FITNESS relative to # images ANN (transcribed from c) is able to identify correctly.

Parameters:
c -
Returns:
fitness value for c
Throws:
TranscriberException
java.io.IOException

evaluateEnsemble

public int evaluateEnsemble(java.util.Collection ensemble)
                     throws TranscriberException,
                            java.io.IOException
Returns int between 0 and MAX_FITNESS relative to # images ANNs (transcribed from ensemble) are able to identify correctly. Identification is based on averaging outputs of all ANNs.

Parameters:
ensemble - Collection contains Chromosome objects
Returns:
fitness value for ensemble
Throws:
TranscriberException
java.io.IOException

getMaxFitnessValue

public int getMaxFitnessValue()
Specified by:
getMaxFitnessValue in interface BulkFitnessFunction
Returns:
int maximum possible fitness value this function will return
See Also:
BulkFitnessFunction.getMaxFitnessValue()

init

public void init(Properties props)
          throws java.lang.Exception
Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
Throws:
java.lang.Exception
See Also:
Configurable.init(com.anji.util.Properties)