JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.forceFields
Class ThirdBody

java.lang.Object
  extended bygov.nasa.javaGenes.forceFields.MultiBody
      extended bygov.nasa.javaGenes.forceFields.Body
          extended bygov.nasa.javaGenes.forceFields.ThirdBody
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ThirdBody
extends Body

represents the last body and relevant parameters of a three-body.

See Also:
Serialized Form

Field Summary
 double angle
          the angle between the lines joining the second and third bodies and the first body
 double radialDistance
          the distance of the last body to the first body
 
Fields inherited from class gov.nasa.javaGenes.forceFields.Body
species, speciesIndex
 
Fields inherited from class gov.nasa.javaGenes.forceFields.MultiBody
_name, howMany
 
Constructor Summary
ThirdBody(Species s, double distance, double a)
           
 
Method Summary
static Bodies[] makeArray(Species species1, Species species2, Species species3, Distribution twoBodyLengths, Distribution thirdBodyLengths, Distribution angles, boolean twoBodiesCount)
          create an array of Bodies to use in the fitness function
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.forceFields.Body
scaleLengthsBy, setSpeciesIndex, tabSeparatedString, withinCutoff
 
Methods inherited from class gov.nasa.javaGenes.forceFields.MultiBody
copy, divideHowManyBy, getHowMany, getName, incrementHowMany, removeInternalElementsOutsideOfCutoff, setHowMany, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

radialDistance

public double radialDistance
the distance of the last body to the first body


angle

public double angle
the angle between the lines joining the second and third bodies and the first body

Constructor Detail

ThirdBody

public ThirdBody(Species s,
                 double distance,
                 double a)
Parameters:
s - the species of the third body
distance - the distance between the third and first body
a - the angle
Method Detail

toString

public java.lang.String toString()

makeArray

public static Bodies[] makeArray(Species species1,
                                 Species species2,
                                 Species species3,
                                 Distribution twoBodyLengths,
                                 Distribution thirdBodyLengths,
                                 Distribution angles,
                                 boolean twoBodiesCount)
create an array of Bodies to use in the fitness function

Parameters:
species1 - the species of the first body
species2 - the species of the second body
species3 - the species of the third body
twoBodyLengths - will provide values for the distance between the first and second bodies
twoBodiesCount - set to false so that only three energies will be calculated. This is needed because the two body energies are so much larger than the three body energies that the three parameters don't evolve very well.

JavaGenes, NASA Ames. Written largely by Al Globus