meshi.energy
Class AbstractEnergy

java.lang.Object
  extended by meshi.energy.AbstractEnergy
All Implemented Interfaces:
Attributable, Updateable
Direct Known Subclasses:
AtomicPairwisePMFSumma, CooperativeAtomicPairwisePMFSumma, CooperativeEnergyTerm, CooperativePerAtomSumma, CooperativePropensityEnergy, CooperativeRamachandran, CooperativeZPropensityEnergy, CooperativeZRamachandran, CooperativeZSumma, NonBondedEnergyTerm, SimpleEnergyTerm, TemplateEnergy, UnWarpEnergy, WarpEnergy

public abstract class AbstractEnergy
extends java.lang.Object
implements Updateable, Attributable

A super class for all meshi energy terms. Currently oriented towards drivable energy functions. See meshi.energy.bond.BondEnergy.


Nested Class Summary
private static class AbstractEnergy.IsEnergy
           
protected  class AbstractEnergy.UpdateableList
          A list of updateable elements (implementing the meshi.util.Updateable interface).
 
Field Summary
private  java.util.HashMap attributes
           
protected  java.lang.String comment
          A short name for the energy term.
static Filter filter
           
static double INFINITY
          1/0 good for dubugging.
static double NaN
          sqrt(-1) good for dubugging.
protected  boolean on
          The energy term is evaluated only if it is on.
protected  AbstractEnergy.UpdateableList updateableResources
           
protected  double weight
          The weight of the energy term within the total energy.
 
Constructor Summary
AbstractEnergy()
          Construct a dummy object that cannot be evaluated.
AbstractEnergy(Updateable[] updateableResources, double weight)
          construct An energy term.
 
Method Summary
 void addAttribute(MeshiAttribute attribute)
           
 java.lang.String comment()
           
abstract  double evaluate()
          Evaluates the energy term and update the derivatives.
abstract  void evaluateAtoms()
          Evaluates the energy term and devides the energy between the atoms.
 MeshiAttribute getAttribute(int key)
           
 void handleMissingParameters(java.lang.Object obj)
           
 boolean isOn()
           
 void off()
          Turnes the energyTerm OFF.
 void on()
          Turnes the energyTerm ON.
abstract  void test(TotalEnergy totalEnergy, Atom atom)
          Looking for one "criminal" atom whose derivation is wrong.
protected static Updateable[] toArray()
          Generates an empty array.
protected static Updateable[] toArray(Updateable o1)
          Generates an aray with one element - the parameter.
protected static Updateable[] toArray(Updateable o1, Updateable o2)
           
protected static Updateable[] toArray(Updateable o1, Updateable o2, Updateable o3)
           
 java.lang.String toString()
           
 void update(int numberOfUpdates)
          Updates the updatable resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

comment

protected java.lang.String comment
A short name for the energy term.


weight

protected double weight
The weight of the energy term within the total energy.


on

protected boolean on
The energy term is evaluated only if it is on.


filter

public static final Filter filter

INFINITY

public static final double INFINITY
1/0 good for dubugging.

See Also:
Constant Field Values

NaN

public static final double NaN
sqrt(-1) good for dubugging.


updateableResources

protected AbstractEnergy.UpdateableList updateableResources

attributes

private java.util.HashMap attributes
Constructor Detail

AbstractEnergy

public AbstractEnergy()
Construct a dummy object that cannot be evaluated. Such an object is useful as a key during searches.


AbstractEnergy

public AbstractEnergy(Updateable[] updateableResources,
                      double weight)
construct An energy term.

Method Detail

update

public void update(int numberOfUpdates)
            throws UpdateableException
Updates the updatable resources. For a detailed description of MESHI's treatment of updatable resources see the documentation of TotalEnergy.

Specified by:
update in interface Updateable
Throws:
UpdateableException

evaluate

public abstract double evaluate()
Evaluates the energy term and update the derivatives.


evaluateAtoms

public abstract void evaluateAtoms()
Evaluates the energy term and devides the energy between the atoms. The energy field of each atom is assigned a value - its contribution to the total energy sum.


on

public void on()
Turnes the energyTerm ON.


off

public void off()
Turnes the energyTerm OFF.


isOn

public boolean isOn()

test

public abstract void test(TotalEnergy totalEnergy,
                          Atom atom)
Looking for one "criminal" atom whose derivation is wrong.


handleMissingParameters

public void handleMissingParameters(java.lang.Object obj)

comment

public java.lang.String comment()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toArray

protected static Updateable[] toArray()
Generates an empty array.


toArray

protected static Updateable[] toArray(Updateable o1)
Generates an aray with one element - the parameter.


toArray

protected static Updateable[] toArray(Updateable o1,
                                      Updateable o2)

toArray

protected static Updateable[] toArray(Updateable o1,
                                      Updateable o2,
                                      Updateable o3)

addAttribute

public final void addAttribute(MeshiAttribute attribute)
Specified by:
addAttribute in interface Attributable

getAttribute

public final MeshiAttribute getAttribute(int key)
Specified by:
getAttribute in interface Attributable