meld.remd.adaptor.SwitchingCompositeAdaptor

class meld.remd.adaptor.SwitchingCompositeAdaptor(switching_time, first_adaptor, second_adaptor)[source]

Bases: object

An adaptor that switches between two strategies at a specified time

__init__(switching_time, first_adaptor, second_adaptor)[source]

Initialize a SwitchingCompositeAdaptor

Parameters

Methods

__init__(switching_time, first_adaptor, ...)

Initialize a SwitchingCompositeAdaptor

adapt(previous_lambdas, step)

Compute new optimal values of lambda.

get_acceptance_probabilities()

rtype

ndarray

reset()

Forget about any previous updates.

update(i, accepted)

Update statistics

adapt(previous_lambdas, step)[source]

Compute new optimal values of lambda.

Parameters
  • previous_lambdas (List[float]) – the previous lambda values

  • step (int) – the current simulation step

Return type

List[float]

Returns

the new, optimized lambda values

reset()[source]

Forget about any previous updates.

Resets all internal counters and statistics to zero.

Return type

None

update(i, accepted)[source]

Update statistics

Parameters
  • i (int) – lower replica index of pair with attempted swap

  • accepted (bool) – True if swap was successful

Return type

None