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 TypeMethodDescriptiondoubleGet the Lambda move size, which is a standard deviation for continuous moves or step size for discrete moves.booleanIf true, do continuous moves.static doubleApplies 0-1 mirroring conditions to lam + dL.voidmove()Performs the move associated with this MCMove.voidReverts the last applied move() call.voidsetContinuous(boolean continuous) If true, do continuous moves.voidsetMoveSize(double moveSize) Get the Lambda move size, which is a standard deviation for continuous moves or step size for discrete moves.doublevalidateLambda(double lambda) Validate lambda is in the range [0 .. 1].
-
Constructor Details
-
LambdaMove
Constructor for LambdaMove.- Parameters:
orthogonalSpaceTempering- aOrthogonalSpaceTemperingobject.
-
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:
revertMovein 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.
-