Package ffx.algorithms.optimize.anneal
Class SimulatedAnnealing
java.lang.Object
ffx.algorithms.optimize.anneal.SimulatedAnnealing
- All Implemented Interfaces:
Terminatable
,Runnable
Run NVT molecular dynamics at a series of temperatures to optimize a structure.
- Since:
- 1.0
- Author:
- Michael J. Schnieders, Jacob M. Litman
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents non-composite AnnealingSchedules known (i.e. not FlatEndAnnealSchedule). -
Constructor Summary
ConstructorDescriptionSimulatedAnnealing
(MolecularAssembly molecularAssembly, Potential potentialEnergy, AlgorithmListener algorithmListener, ThermostatEnum requestedThermostat, IntegratorEnum requestedIntegrator, AnnealingSchedule annealingSchedule, long mdSteps, double timeStep, boolean reInitVelocity, File dynFile) Constructor for SimulatedAnnealing. -
Method Summary
Modifier and TypeMethodDescriptionvoid
anneal()
annealdouble
getKineticEnergy.double
getPotentialEnergy.double
getTemperature.double
getTotalEnergy.void
run()
void
setPrintInterval
(double printInterval) Setter for the fieldprintInterval
.void
setRestartFrequency
(double restart) Method to set the Restart Frequency.void
setSaveFrequency
(double save) Sets the frequency of writing to the trajectory file.void
setTrajectorySteps
(int trajectorySteps) Sets the number of steps to use per OpenMM cycle.void
This should be implemented as a blocking interrupt; when the method returns theTerminatable
algorithm has reached a clean termination point.
-
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.
-
setPrintInterval
public void setPrintInterval(double printInterval) Setter for the fieldprintInterval
.- Parameters:
printInterval
- a double.
-
setRestartFrequency
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 theTerminatable
algorithm has reached a clean termination point. For example, between minimize or molecular dynamics steps.- Specified by:
terminate
in interfaceTerminatable
-