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
) aftermain()
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 everyinterval
timesteps with the first time being executed at timestepstart
.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 everyinterval
timesteps with the first time being executed at timestepstart
.start
must be greater or equal to zero.Returns: signal connection