JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.chemistry
Class Molecule

java.lang.Object
  extended bygov.nasa.javaGenes.core.Evolvable
      extended bygov.nasa.javaGenes.graph.Graph
          extended bygov.nasa.javaGenes.chemistry.Molecule
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
Benzene, Purine, Pyridine

public class Molecule
extends Graph

note: during evolution Graph objects will be created from Molecule populations. The nature of vertices and edges indicates that the Graph is actually a Molecule.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class gov.nasa.javaGenes.graph.Graph
Graph.TrailKey
 
Field Summary
static java.lang.String dimerForcePropertyName
           
static java.lang.String energyPropertyName
           
static java.lang.String unitCellPropertyName
           
 
Fields inherited from class gov.nasa.javaGenes.graph.Graph
edges, nodeTypePairsShortestTrailCounts, vertices
 
Fields inherited from class gov.nasa.javaGenes.core.Evolvable
childMakersUsed
 
Constructor Summary
Molecule()
           
Molecule(VertexAndEdgeProvider provider, int numberOfVertices, int numberOfCycles)
           
 
Method Summary
 Molecule copy()
           
 Atom[] getAllAtoms(java.lang.String element)
           
 Atom getAtom(int index)
           
 Atom getAtom(java.lang.String element)
           
 java.lang.String getComment()
           
 double getDimerForce()
           
 double getEnergy()
           
 int getNumberOfAtoms()
           
 UnitCell getUnitCell()
           
 boolean hasUnitCell()
           
 boolean isLegal()
           
 Bond makeBond(int vertex1, int vertex2, int valence)
          make a bond between two atoms numbered starting at 1 (the way chemists count) and add the bond to the molecule.
 void moveAtomsIntoUnitCell()
           
 void randomizeAtomicPositions()
          set the positions of atoms to random numbers
 void randomizeAtomicPositionsBy(double distance)
          set the positions of atoms to random numbers
 void randomizeAtomicPositionsBy(double distance, boolean gaussianDistribution)
           
 void randomizeAtomicPositionsBy(double distance, boolean gaussianDistribution, int numberOfAtomsToMove)
           
 void removeLastNAtoms(int n)
           
 void scaleBy(double factor)
           
 void setComment(java.lang.String c)
           
 void setCommentFromProperties()
           
 void setDimerForce(double inForce)
           
 void setEnergy(double energy)
           
 void setPropertiesFromComment()
           
 void setUnitCell(UnitCell inUnitCell)
           
 
Methods inherited from class gov.nasa.javaGenes.graph.Graph
add, add, add, canMate, changed, clone, deepCopyGraph, delete, distanceFrom, executeOnEdges, executeOnVertices, getConnectedSubgraph, getConnectionTable, getEdge, getEdgeIterator, getEdgesSize, getEquivalent, getEquivalent, getExtendedVertexTypesCounter, getNodeTypePairsShortestTrailCounts, getNumberOfCycles, getRandomEdge, getRandomEdge, getRandomVertex, getRandomVertex, getSize, getStringKey, getTrailBetween, getVertex, getVertexAndTrailIterator, getVertexIterator, getVerticesSize, hasVertexPairCloserThan, isConnected, numberVertices, numberVerticesReverse, remove, remove, removeLastNVertices, replaceEdge, replaceVertex, setAllMarks, setEdgeMarks, setVertexMarks, shallowClone, toString
 
Methods inherited from class gov.nasa.javaGenes.core.Evolvable
addChildMakers, copyForEvolution, getChildMakersUsed, getSmallest, prepareForEvaluator, stateSave
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

energyPropertyName

public static final java.lang.String energyPropertyName
See Also:
Constant Field Values

unitCellPropertyName

public static final java.lang.String unitCellPropertyName
See Also:
Constant Field Values

dimerForcePropertyName

public static final java.lang.String dimerForcePropertyName
See Also:
Constant Field Values
Constructor Detail

Molecule

public Molecule()

Molecule

public Molecule(VertexAndEdgeProvider provider,
                int numberOfVertices,
                int numberOfCycles)
Method Detail

scaleBy

public void scaleBy(double factor)

copy

public Molecule copy()

getComment

public java.lang.String getComment()

setComment

public void setComment(java.lang.String c)

hasUnitCell

public boolean hasUnitCell()

getUnitCell

public UnitCell getUnitCell()

setUnitCell

public void setUnitCell(UnitCell inUnitCell)

getEnergy

public double getEnergy()

getDimerForce

public double getDimerForce()

setDimerForce

public void setDimerForce(double inForce)

setEnergy

public void setEnergy(double energy)

setPropertiesFromComment

public void setPropertiesFromComment()

setCommentFromProperties

public void setCommentFromProperties()

getNumberOfAtoms

public int getNumberOfAtoms()

getAtom

public Atom getAtom(int index)

makeBond

public Bond makeBond(int vertex1,
                     int vertex2,
                     int valence)
make a bond between two atoms numbered starting at 1 (the way chemists count) and add the bond to the molecule.


randomizeAtomicPositions

public void randomizeAtomicPositions()
set the positions of atoms to random numbers


randomizeAtomicPositionsBy

public void randomizeAtomicPositionsBy(double distance)
set the positions of atoms to random numbers


randomizeAtomicPositionsBy

public void randomizeAtomicPositionsBy(double distance,
                                       boolean gaussianDistribution)

randomizeAtomicPositionsBy

public void randomizeAtomicPositionsBy(double distance,
                                       boolean gaussianDistribution,
                                       int numberOfAtomsToMove)

moveAtomsIntoUnitCell

public void moveAtomsIntoUnitCell()

getAtom

public Atom getAtom(java.lang.String element)

removeLastNAtoms

public void removeLastNAtoms(int n)

getAllAtoms

public Atom[] getAllAtoms(java.lang.String element)

isLegal

public boolean isLegal()
Overrides:
isLegal in class Graph

JavaGenes, NASA Ames. Written largely by Al Globus