rexfw.slgenerators package

Module contents

Swap list generators generating lists of triples: two replica names and an ExchangeParams object. They tell which replicas should attempt to swap their states and which parameters to use for the swap

class rexfw.slgenerators.AbstractSwapListGenerator[source]

Bases: object

generate_swap_list(step)[source]

Creates a list of swaps to be performed at a given sampling step

Parameters:step (int) – a sampling step
Returns:a list of lists; the second dimension being of the form (‘replica_name1’, ‘replica_name2’, ExchangeParams instance)
Return type:list
class rexfw.slgenerators.ExchangeParams(proposers, proposer_params)

Bases: tuple

_asdict()

Return a new OrderedDict which maps field names to their values

_fields = ('proposers', 'proposer_params')
classmethod _make(iterable, new=<built-in method __new__ of type object>, len=<built-in function len>)

Make a new ExchangeParams object from a sequence or iterable

_replace(**kwds)

Return a new ExchangeParams object replacing specified fields with new values

count(value) → integer -- return number of occurrences of value
index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

proposer_params

Alias for field number 1

proposers

Alias for field number 0

class rexfw.slgenerators.StandardSwapListGenerator(n_replicas, param_list)[source]

Bases: rexfw.slgenerators.AbstractSwapListGenerator

_which = 0
generate_swap_list(step)[source]

Creates a list of swaps to be performed at a given sampling step

Parameters:step (int) – a sampling step
Returns:a list of lists; the second dimension being of the form (‘replica_name1’, ‘replica_name2’, ExchangeParams instance)
Return type:list