JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.forceFields
Class PotentialEnergyFitness

java.lang.Object
  extended bygov.nasa.javaGenes.core.FitnessFunction
      extended bygov.nasa.javaGenes.forceFields.PotentialEnergyFitness
All Implemented Interfaces:
java.io.Serializable

public class PotentialEnergyFitness
extends FitnessFunction

fitness function based on RMS distance of potential energies between the target and candidate Chromosome

See Also:
Serialized Form

Field Summary
protected  Potential potential
           
protected  Chromosome target
           
protected  java.util.Vector testCases
           
 
Fields inherited from class gov.nasa.javaGenes.core.FitnessFunction
name
 
Constructor Summary
PotentialEnergyFitness(Potential p, Chromosome t)
           
 
Method Summary
 void add(Bodies[] bodies)
          add a set of multi-bodies to create one test case
 void add(Bodies[][] bodies)
          create multiple test cases (the first dimension of array bodies)
 void add(java.util.Vector bodies)
          add a set of bodies to create one test case
 Fitness evaluateFitness(Evolvable evolvable)
           
 void makeFiles()
          creative fall column target.tsd with the target chromosome it and a file testCases.tsd with all the test cases in it
 void report(Population population)
          Prints out a file called difference.tsd with the target chromosome in it and the difference between the best and target chromosomes.
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.core.FitnessFunction
bestDouble, getFunction, getName, getNameArray, isNewFunction, numberOfObjectives, setName, worstDouble
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

potential

protected Potential potential

testCases

protected java.util.Vector testCases

target

protected Chromosome target
Constructor Detail

PotentialEnergyFitness

public PotentialEnergyFitness(Potential p,
                              Chromosome t)
Parameters:
p - the potential energy function
t - the target chromosome
Method Detail

add

public void add(Bodies[] bodies)
add a set of multi-bodies to create one test case


add

public void add(Bodies[][] bodies)
create multiple test cases (the first dimension of array bodies)


add

public void add(java.util.Vector bodies)
add a set of bodies to create one test case

Parameters:
bodies - must consist of Bodies[] objects

evaluateFitness

public Fitness evaluateFitness(Evolvable evolvable)
Specified by:
evaluateFitness in class FitnessFunction
Returns:
the fitness. Low values are fitter than high values.

report

public void report(Population population)
Prints out a file called difference.tsd with the target chromosome in it and the difference between the best and target chromosomes.

Overrides:
report in class FitnessFunction

makeFiles

public void makeFiles()
creative fall column target.tsd with the target chromosome it and a file testCases.tsd with all the test cases in it

Overrides:
makeFiles in class FitnessFunction

toString

public java.lang.String toString()

JavaGenes, NASA Ames. Written largely by Al Globus