wepy.runners.randomwalk module¶
The random walk dynamics runner.
In this system, the state of the walkers is defined as an N-dimensional vector of non-negative values. The walkers start at position zero (in N-dimensional space) and randomly move a step either forward or backward with the given probabilities. This is done in each dimension at each dynamic step. All moves that result in a negative position are rejected.
One potentioanl use of the random walk system is to test the performance of differnt resamplers as seen in these papers:
“WExplore: Hierarchical Exploration of High-Dimensional Spaces Using the Weighted Ensemble Algorithm” and “REVO: Resampling of Ensembles by Variation Optimization”.
-
wepy.runners.randomwalk.
UNIT_NAMES
= (('positions_unit', 'microsecond'), ('time_unit', 'picosecond'))¶ Mapping of units identifiers to the corresponding pint units.
-
class
wepy.runners.randomwalk.
RandomWalkRunner
(probability=0.25)[source]¶ Bases:
wepy.runners.runner.Runner
RandomWalk runner for random walk simulations.
Constructor for RandomWalkRunner.
- Parameters
probabilty (float) –
- “Probability” is defined here as the forward-move
probability only. The backward-move probability is 1-probability.(Default = 0.25)
-
property
probability
¶ The probability of forward-move in an N-dimensional space
-
_walk
(positions)[source]¶ Run dynamics for the RandomWalk system for one step.
- Parameters
positions (arraylike of shape (1, dimension)) – Current position of the walker.
- Returns
new_positions – The positions of the walker after one dynamic step.
- Return type
arraylike of shape (1, dimension)
-
post_cycle
(**kwargs)¶ Perform post-cycle behavior. run_segment will be called for each walker so this allows you to perform changes of state on a per-cycle basis.
- Parameters
kwargs (key-word arguments) – Key-value pairs to be interpreted by each runner implementation.
-
pre_cycle
(**kwargs)¶ Perform pre-cycle behavior. run_segment will be called for each walker so this allows you to perform changes of state on a per-cycle basis.
- Parameters
kwargs (key-word arguments) – Key-value pairs to be interpreted by each runner implementation.
-
run_segment
(walker, segment_length, **kwargs)[source]¶ Runs a random walk simulation for the given number of steps.
- Parameters
walker (object implementing the Walker interface) – The walker for which dynamics will be propagated.
- segment_lengthint
The numerical value that specifies how much dynamical steps are to be run.
- Returns
new_walker – Walker after dynamics was run, only the state should be modified.
- Return type
object implementing the Walker interface