Package ffx.algorithms.mc
Class LambdaMove
java.lang.Object
ffx.algorithms.mc.LambdaMove
- All Implemented Interfaces:
MCMove
Define an MC move to update lambda.
- Author:
- Mallory R. Tollefson
-
Constructor Summary
ConstructorsConstructorDescriptionLambdaMove
(int randomSeed, OrthogonalSpaceTempering orthogonalSpaceTempering) Constructor for LambdaMove.LambdaMove
(OrthogonalSpaceTempering orthogonalSpaceTempering) Constructor for LambdaMove. -
Method Summary
Modifier and TypeMethodDescriptiondouble
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
Applies 0-1 mirroring conditions to lam + dL.void
move()
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 .. 1].
-
Constructor Details
-
LambdaMove
Constructor for LambdaMove.- Parameters:
orthogonalSpaceTempering
- aOrthogonalSpaceTempering
object.
-
LambdaMove
Constructor for LambdaMove.- Parameters:
randomSeed
- Random seed to use.orthogonalSpaceTempering
- OrthogonalSpaceTempering instance.
-
-
Method Details
-
mirror
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. -
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 interfaceMCMove
-
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.
-