meshi.energy
Class TotalEnergy

java.lang.Object
  extended by meshi.energy.TotalEnergy

public class TotalEnergy
extends java.lang.Object

A generic class for all meshi energy functions. Typically only a single such object exists, which include several energy term objects (sub classes of AbstractEnergy).


Nested Class Summary
static class TotalEnergy.EnergyComparator
           
private static class TotalEnergy.FreeAtom
           
private static class TotalEnergy.IsEnergy
           
private  class TotalEnergy.SortedAtoms
           
 
Field Summary
protected  AtomList atomList
           
protected static double[][] coordinates
           
protected  Fdouble dformat
           
protected  DistanceMatrix distanceMatrix
           
(package private) static double DX
           
protected  java.util.ArrayList<AbstractEnergy> energyTerms
           
protected  java.util.ArrayList<java.lang.Double> energyValues
           
protected  Fint iformat
           
private static double INFINITY
           
protected  int numberOfEvaluations
          Number of times the energy function was evaluated.
protected  int numberOfReports
           
protected static int numberOfUpdates
           
protected  Format sformat
           
static Terminator terminator
           
private static TotalEnergy theOnlyTotalEnergy
           
protected  double totalEnergy
           
(package private) static double verySmall
           
(package private) static java.lang.String[] XYZ
           
 
Constructor Summary
TotalEnergy(AtomList atomList)
           
TotalEnergy(AtomList atomList, DistanceMatrix distanceMatrix)
           
TotalEnergy(AtomList atomList, DistanceMatrix distanceMatrix, AbstractEnergy[] energyTerms)
           
TotalEnergy(Protein protein, DistanceMatrix distanceMatrix, EnergyCreator[] energyCreators, CommandList commands)
           
TotalEnergy(Protein protein, DistanceMatrix distanceMatrix, EnergyCreator[] energyCreators, CommandList commands, AtomList atoms)
           
 
Method Summary
 void add(TotalEnergy energy)
           
 void addTerm(AbstractEnergy term)
           
 AtomList atomList()
           
 double avgEnergy()
           
 double avgFilteredEnergy(double stdThreshold)
           
 double[][] coordinates()
           
 DistanceMatrix distanceMatrix()
           
 double energy()
           
 java.util.ArrayList<AbstractEnergy> energyTerms()
           
 java.util.ArrayList<java.lang.Double> energyValues()
           
 double evaluate()
           
 void evaluateAtoms()
           
 double filteredEnergy(double stdThreshold)
           
protected  Atom findCriminalAtom()
          Searching for a `criminal' atom
protected  AbstractEnergy findCriminalEnergyTerm(Atom atom)
          Searching for a `criminal' energy term , with specific atom
 boolean frozenAtomsExist()
           
static double getAverageForce(double[][] coordinates)
           
 void getCoordinates()
           
static double[][] getCoordinates(AtomList atomList)
          Reduce the Atom coordinates of an atom list to an array.
 DistanceMatrix getDistanceMatrix()
           
 AbstractEnergy getEnergyTerm(AbstractEnergy ae)
           
 AbstractEnergy[] getEnergyTerms(AbstractEnergy ae)
           
 double getGradMagnitude()
          Finds the maximal component (in magnitude) of the gradient vecor in coordinates ( coordinates[][1] ).
 double getLastEnergy()
          Returns the last enrgy value that was calculated
 AtomList highestEnergyAtoms(double stdThreshold)
           
 int numberOfEvaluations()
           
 int numberOfUpdates()
           
 void off()
           
 void on()
           
 java.lang.String report(int step)
           
 java.lang.String reportHeader()
           
 void reset()
           
 void resetAtomEnergies()
           
static void resetForces()
           
static void resetForces(double[][] coordinates)
          Sets all forces to zero.
 void setCoordinates(AtomList atomList)
           
 void summary()
           
 void test()
           
 double totalEnergy()
           
 void update()
          Updates all factors related to the energy function (for example the distance matrix).
 void updateDebug()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberOfEvaluations

protected int numberOfEvaluations
Number of times the energy function was evaluated. This is a simple machine-independent measure of convergence efficiency.


numberOfUpdates

protected static int numberOfUpdates

numberOfReports

protected int numberOfReports

atomList

protected AtomList atomList

coordinates

protected static double[][] coordinates

energyTerms

protected java.util.ArrayList<AbstractEnergy> energyTerms

energyValues

protected java.util.ArrayList<java.lang.Double> energyValues

totalEnergy

protected double totalEnergy

dformat

protected Fdouble dformat

sformat

protected Format sformat

iformat

protected Fint iformat

distanceMatrix

protected DistanceMatrix distanceMatrix

theOnlyTotalEnergy

private static TotalEnergy theOnlyTotalEnergy

terminator

public static final Terminator terminator

INFINITY

private static final double INFINITY
See Also:
Constant Field Values

DX

static final double DX
See Also:
Constant Field Values

XYZ

static final java.lang.String[] XYZ

verySmall

static final double verySmall
Constructor Detail

TotalEnergy

public TotalEnergy(AtomList atomList,
                   DistanceMatrix distanceMatrix,
                   AbstractEnergy[] energyTerms)

TotalEnergy

public TotalEnergy(Protein protein,
                   DistanceMatrix distanceMatrix,
                   EnergyCreator[] energyCreators,
                   CommandList commands)

TotalEnergy

public TotalEnergy(AtomList atomList,
                   DistanceMatrix distanceMatrix)

TotalEnergy

public TotalEnergy(AtomList atomList)

TotalEnergy

public TotalEnergy(Protein protein,
                   DistanceMatrix distanceMatrix,
                   EnergyCreator[] energyCreators,
                   CommandList commands,
                   AtomList atoms)
Method Detail

distanceMatrix

public DistanceMatrix distanceMatrix()

reset

public void reset()

add

public void add(TotalEnergy energy)

test

public void test()

findCriminalAtom

protected Atom findCriminalAtom()
Searching for a `criminal' atom

Returns:
a criminal Atom

findCriminalEnergyTerm

protected AbstractEnergy findCriminalEnergyTerm(Atom atom)
Searching for a `criminal' energy term , with specific atom

Parameters:
atom - a `criminal' Atom
Returns:
a criminal energy term

getGradMagnitude

public double getGradMagnitude()
Finds the maximal component (in magnitude) of the gradient vecor in coordinates ( coordinates[][1] ).


coordinates

public double[][] coordinates()

numberOfEvaluations

public int numberOfEvaluations()

resetForces

public static void resetForces(double[][] coordinates)
Sets all forces to zero.


setCoordinates

public void setCoordinates(AtomList atomList)

getCoordinates

public void getCoordinates()

getCoordinates

public static double[][] getCoordinates(AtomList atomList)
Reduce the Atom coordinates of an atom list to an array. : : : :


evaluateAtoms

public void evaluateAtoms()

evaluate

public double evaluate()

getLastEnergy

public double getLastEnergy()
Returns the last enrgy value that was calculated


update

public void update()
            throws UpdateableException
Updates all factors related to the energy function (for example the distance matrix).

Throws:
UpdateableException

updateDebug

public void updateDebug()

getAverageForce

public static double getAverageForce(double[][] coordinates)

resetForces

public static void resetForces()

reportHeader

public java.lang.String reportHeader()

report

public java.lang.String report(int step)

energy

public double energy()

frozenAtomsExist

public boolean frozenAtomsExist()

atomList

public AtomList atomList()

energyValues

public java.util.ArrayList<java.lang.Double> energyValues()

getEnergyTerm

public AbstractEnergy getEnergyTerm(AbstractEnergy ae)

getDistanceMatrix

public DistanceMatrix getDistanceMatrix()

numberOfUpdates

public final int numberOfUpdates()

addTerm

public void addTerm(AbstractEnergy term)

resetAtomEnergies

public void resetAtomEnergies()

getEnergyTerms

public AbstractEnergy[] getEnergyTerms(AbstractEnergy ae)

totalEnergy

public double totalEnergy()

avgEnergy

public double avgEnergy()

energyTerms

public java.util.ArrayList<AbstractEnergy> energyTerms()

summary

public void summary()

filteredEnergy

public double filteredEnergy(double stdThreshold)

avgFilteredEnergy

public double avgFilteredEnergy(double stdThreshold)

highestEnergyAtoms

public AtomList highestEnergyAtoms(double stdThreshold)

off

public void off()

on

public void on()