Interface MetropolisMC

All Known Implementing Classes:
BoltzmannMC, MolecularMC, MonteCarloOST, RotamerMatrixMC

public interface MetropolisMC
The MetropolisMC interface defines the basic methods of a Metropolis Monte Carlo application. Intended to be a framework to allow you to take and revert a single step, and return basic information about the last step taken. Many of the methods will only return a meaningful result after the first step.
Since:
1.0
Author:
Michael J. Schnieders, Jacob M. Litman
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    evaluateMove(double e1, double e2)
    Returns true if the move from e1 to e2 is accepted.
    boolean
    If last step taken was a success.
    double
    Return starting energy from last attempted step.
    double
    Return trial energy from last attempted step.
    double
    Returns temperature of the Monte Carlo criterion.
    double
    Returns the energy as of the last step taken (not including any extra potential energy adjustments).
    boolean
    mcStep(MCMove move)
    Calculates the current system energy and performs an MCMove.
    boolean
    mcStep(MCMove move, double en1)
    Performs an MCMove.
    boolean
    mcStep(List<MCMove> moves)
    Calculates the current system energy and performs a series of moves sequentially as a single hybrid step.
    boolean
    mcStep(List<MCMove> moves, double en1)
    Performs a series of moves sequentially, as a single hybrid step.
    void
    If possible, reverts the last successful Monte Carlo step taken.
    void
    setPrint(boolean print)
    Sets whether the implementation prints its own messages.
    void
    setTemperature(double temp)
    Sets temperature of Monte Carlo criterion.
  • Method Details

    • evaluateMove

      boolean evaluateMove(double e1, double e2)
      Returns true if the move from e1 to e2 is accepted. For molecular systems, this will mean accept if e2 is less than e1, or accept with probability of exp(-dU/kbT) if e2 is greater than e1.
      Parameters:
      e1 - Initial energy
      e2 - Trial energy
      Returns:
      If move accepted
    • getAccept

      boolean getAccept()
      If last step taken was a success.
      Returns:
      Acceptance of last move
    • getE1

      double getE1()
      Return starting energy from last attempted step.
      Returns:
      e1
    • getE2

      double getE2()
      Return trial energy from last attempted step.
      Returns:
      e2
    • getTemperature

      double getTemperature()
      Returns temperature of the Monte Carlo criterion.
      Returns:
      temperature
    • setTemperature

      void setTemperature(double temp)
      Sets temperature of Monte Carlo criterion.
      Parameters:
      temp - a double.
    • lastEnergy

      double lastEnergy()
      Returns the energy as of the last step taken (not including any extra potential energy adjustments).
      Returns:
      Last step's energy
    • mcStep

      boolean mcStep(MCMove move)
      Calculates the current system energy and performs an MCMove.
      Parameters:
      move - MCMove to perform
      Returns:
      If move accepted
    • mcStep

      boolean mcStep(MCMove move, double en1)
      Performs an MCMove.
      Parameters:
      move - MCMove to perform
      en1 - Initial energy
      Returns:
      If move accepted
    • mcStep

      boolean mcStep(List<MCMove> moves)
      Calculates the current system energy and performs a series of moves sequentially as a single hybrid step.
      Parameters:
      moves - MCMoves to perform
      Returns:
      If move/moves accepted
    • mcStep

      boolean mcStep(List<MCMove> moves, double en1)
      Performs a series of moves sequentially, as a single hybrid step. Should also work with single-member lists.
      Parameters:
      moves - MCMoves to perform
      en1 - Initial energy
      Returns:
      If move/moves accepted.
    • revertStep

      void revertStep()
      If possible, reverts the last successful Monte Carlo step taken.
    • setPrint

      void setPrint(boolean print)
      Sets whether the implementation prints its own messages.
      Parameters:
      print - Print energies, accept/reject, etc.