Class SimulatedAnnealing

java.lang.Object
ffx.algorithms.optimize.anneal.SimulatedAnnealing
All Implemented Interfaces:
Terminatable, Runnable

public class SimulatedAnnealing extends Object implements Runnable, Terminatable
Run NVT molecular dynamics at a series of temperatures to optimize a structure.
Since:
1.0
Author:
Michael J. Schnieders, Jacob M. Litman
  • Constructor Details

    • SimulatedAnnealing

      public SimulatedAnnealing(MolecularAssembly molecularAssembly, Potential potentialEnergy, AlgorithmListener algorithmListener, ThermostatEnum requestedThermostat, IntegratorEnum requestedIntegrator, AnnealingSchedule annealingSchedule, long mdSteps, double timeStep, boolean reInitVelocity, File dynFile)
      Constructor for SimulatedAnnealing.
      Parameters:
      molecularAssembly - The Molecular Assembly to operate on.
      potentialEnergy - The potential to anneal against.
      algorithmListener - The algorithm listener is a callback to UI.
      requestedThermostat - The requested thermostat.
      requestedIntegrator - The requested integrator.
      annealingSchedule - Schedule of temperatures to simulate at.
      mdSteps - Steps per SA window.
      timeStep - Time step for MD in psec.
      reInitVelocity - Request velocities to be reinitialized.
      dynFile - Dynamics restart file to begin from.
  • Method Details

    • anneal

      public void anneal()
      anneal
    • getKineticEnergy

      public double getKineticEnergy()
      getKineticEnergy.
      Returns:
      a double.
    • getPotentialEnergy

      public double getPotentialEnergy()
      getPotentialEnergy.
      Returns:
      a double.
    • getTemperature

      public double getTemperature()
      getTemperature.
      Returns:
      a double.
    • getTotalEnergy

      public double getTotalEnergy()
      getTotalEnergy.
      Returns:
      a double.
    • run

      public void run()

      This method should only be invoked within the SimulatedAnnealing instance.

      Specified by:
      run in interface Runnable
    • setPrintInterval

      public void setPrintInterval(double printInterval)
      Setter for the field printInterval.
      Parameters:
      printInterval - a double.
    • setRestartFrequency

      public void setRestartFrequency(double restart) throws IllegalArgumentException
      Method to set the Restart Frequency.
      Parameters:
      restart - the time between writing restart files.
      Throws:
      IllegalArgumentException - If restart frequency is not a positive number
    • setSaveFrequency

      public void setSaveFrequency(double save)
      Sets the frequency of writing to the trajectory file.
      Parameters:
      save - Frequency (psec^-1) to write out the trajectory.
    • setTrajectorySteps

      public void setTrajectorySteps(int trajectorySteps)
      Sets the number of steps to use per OpenMM cycle.
      Parameters:
      trajectorySteps - Steps per OpenMM cycle.
    • terminate

      public void terminate()
      This should be implemented as a blocking interrupt; when the method returns the Terminatable algorithm has reached a clean termination point. For example, between minimize or molecular dynamics steps.
      Specified by:
      terminate in interface Terminatable