pub trait Trial<MI, H, MA> {
type Count;
// Required method
fn apply(
&mut self,
microstate: &mut MI,
hamiltonian: &H,
macrostate: &MA,
) -> Self::Count;
}Expand description
Propose trial moves in the microstate, evaluate the changes in energy and accept or reject accordingly.
Trial describes a type that applies trial moves to microstates. Specifically,
the method apply will attempt one or more individual trial moves to the
microstate. For each individual move, it evaluates the change in energy with
the given hamiltonian, then accepts or rejects the trial based on the state
parameters.
Each type of trial move in hoomd-rs implements the Trial trait so that they
may be used as generic arguments in higher level functions.
See Sweep or any of the other implementations of Trial for code examples.
The generic type names are:
MI: TheMicrostatetype.H: The Hamiltonian type.MA: TheMacrostatetype.
Required Associated Types§
Sourcetype Count
type Count
Represent the number of accepted and rejected individual trial moves.
Most implementations of Trial will use crate::Count directly. Some
may provide more granular detail broken down by move type.
Required Methods§
Sourcefn apply(
&mut self,
microstate: &mut MI,
hamiltonian: &H,
macrostate: &MA,
) -> Self::Count
fn apply( &mut self, microstate: &mut MI, hamiltonian: &H, macrostate: &MA, ) -> Self::Count
Apply the trial move(s).
A given type that implements Trial may perform one or many trial moves
in a single call to apply. The returned value informs the caller how many
trial moves were accepted and rejected (possibly broken down by type).