Class LambdaMove

java.lang.Object
ffx.algorithms.mc.LambdaMove
All Implemented Interfaces:
MCMove

public class LambdaMove extends Object implements MCMove
Define an MC move to update lambda.
Author:
Mallory R. Tollefson
  • Constructor Summary

    Constructors
    Constructor
    Description
    LambdaMove(int randomSeed, OrthogonalSpaceTempering orthogonalSpaceTempering)
    Constructor for LambdaMove.
    LambdaMove(OrthogonalSpaceTempering orthogonalSpaceTempering)
    Constructor for LambdaMove.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get the Lambda move size, which is a standard deviation for continuous moves or step size for discrete moves.
    boolean
    If true, do continuous moves.
    static double
    mirror(Random random, double lam, double dL)
    Applies 0-1 mirroring conditions to lam + dL.
    void
    Performs the move associated with this MCMove.
    void
    Reverts the last applied move() call.
    void
    setContinuous(boolean continuous)
    If true, do continuous moves.
    void
    setMoveSize(double moveSize)
    Get the Lambda move size, which is a standard deviation for continuous moves or step size for discrete moves.
    double
    validateLambda(double lambda)
    Validate lambda is in the range [0 ..

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LambdaMove

      public LambdaMove(OrthogonalSpaceTempering orthogonalSpaceTempering)
      Constructor for LambdaMove.
      Parameters:
      orthogonalSpaceTempering - a OrthogonalSpaceTempering object.
    • LambdaMove

      public LambdaMove(int randomSeed, OrthogonalSpaceTempering orthogonalSpaceTempering)
      Constructor for LambdaMove.
      Parameters:
      randomSeed - Random seed to use.
      orthogonalSpaceTempering - OrthogonalSpaceTempering instance.
  • Method Details

    • mirror

      public static double mirror(Random random, double lam, double dL)
      Applies 0-1 mirroring conditions to lam + dL. Skips any moves where dL is greater than 1 or less than -1, and skips 50% of moves from 0 or 1 (exact).
      Parameters:
      random - Source of randomness.
      lam - Initial lambda.
      dL - Change in lambda.
      Returns:
      Correctly mirrored lam + dL
    • getMoveSize

      public double getMoveSize()
      Get the Lambda move size, which is a standard deviation for continuous moves or step size for discrete moves.
      Returns:
      The lambda move size.
    • setMoveSize

      public void setMoveSize(double moveSize)
      Get the Lambda move size, which is a standard deviation for continuous moves or step size for discrete moves.
      Parameters:
      moveSize - a double.
    • isContinuous

      public boolean isContinuous()
      If true, do continuous moves. Otherwise, use discrete moves.
      Returns:
      Returns true if the lambda moves are continuous.
    • setContinuous

      public void setContinuous(boolean continuous)
      If true, do continuous moves. Otherwise, use discrete moves.
      Parameters:
      continuous - Sets the lambda move style.
    • move

      public void move()
      Performs the move associated with this MCMove.
      Specified by:
      move in interface MCMove
    • revertMove

      public void revertMove()
      Reverts the last applied move() call. Returns the same energy change as described above (with the same sign).
      Specified by:
      revertMove in interface MCMove
    • validateLambda

      public double validateLambda(double lambda)
      Validate lambda is in the range [0 .. 1].

      For discrete moves, set Lambda to the closest valid value [0, dL, 2dL, .. 1].

      Parameters:
      lambda - Input lambda value.
      Returns:
      Validated lambda value.