Sampler

The sampler concerts the sampling of observables.

Example:

local sampler = require("halmd.observables.sampler")
sampler:sample()
sampler:run(1000)
sampler:finish()
halmd.observables.sampler.sample()

Sample current state.

halmd.observables.sampler.run(steps)

Run simulation for given number of steps.

This method invokes halmd.mdsim.core.mdstep().

halmd.observables.sampler.start()

Initialise simulation modules connected to the signal on_start.

The function is called by run() upon its first invocation.

halmd.observables.sampler.finish()

Finalise the simulation by emitting the signal on_finish.

The function is called by the default simulation engine (in lua/halmd/run.lua) after main() from the user script has returned.

halmd.observables.sampler.on_prepare(slot, interval, start)

Connect slot to signal emitted just before sampling current state. slot() will be executed every interval timesteps with the first time being executed at timestep start. start must be greater or equal to zero.

halmd.observables.sampler.on_sample(slot, interval, start)

Connect slot to signal emitted to sample current state. slot() will be executed every interval timesteps with the first time being executed at timestep start. start must be greater or equal to zero.

Returns:signal connection
halmd.observables.sampler.on_start(slot)

Connect slot to signal emitted by start() before the simulation run starts.

Returns:signal connection
halmd.observables.sampler.on_finish(slot)

Connect slot to signal emitted by finish(), which is called after the main() routine has returned.

Returns:signal connection