Skip to main content

ChainLengthDistribution

Trait ChainLengthDistribution 

Source
pub trait ChainLengthDistribution {
    // Required methods
    fn sample(
        &self,
        mn: f64,
        pdi: f64,
        m0: f64,
        num_chains: usize,
        rng: &mut dyn RngCore,
    ) -> Vec<usize>;
    fn name(&self) -> &'static str;
}
Expand description

A distribution that can sample chain lengths (as repeat-unit counts).

Required Methods§

Source

fn sample( &self, mn: f64, pdi: f64, m0: f64, num_chains: usize, rng: &mut dyn RngCore, ) -> Vec<usize>

Sample num_chains chain lengths (each ≥ 1).

  • mn — target number-average molecular weight (g/mol).
  • pdi — target polydispersity index (Mw/Mn, ≥ 1.0).
  • m0 — molar mass of a single repeat unit (g/mol).
  • rng — random number generator (pass a seeded RNG for reproducibility).
Source

fn name(&self) -> &'static str

Human-readable name for display purposes.

Implementors§