pub struct BranchedBuilder { /* private fields */ }Expand description
Builder for non-linear polymer architectures (comb, graft, star, dendrimer).
Unlike LinearBuilder, this builder takes
two BigSMILES strings: one for the backbone and one for the branch.
Implementations§
Source§impl BranchedBuilder
impl BranchedBuilder
Sourcepub fn new(
backbone: BigSmiles,
branch: BigSmiles,
strategy: BuildStrategy,
) -> Self
pub fn new( backbone: BigSmiles, branch: BigSmiles, strategy: BuildStrategy, ) -> Self
Creates a new builder from backbone and branch BigSMILES strings plus a build strategy that governs the backbone length.
Sourcepub fn comb_polymer(
&self,
branch_every: usize,
) -> Result<PolymerChain, PolySimError>
pub fn comb_polymer( &self, branch_every: usize, ) -> Result<PolymerChain, PolySimError>
Generates a comb (regularly branched) polymer.
branch_every – attach one branch every N backbone repeat units.
Sourcepub fn graft_copolymer(
&self,
graft_fraction: f64,
seed: Option<u64>,
) -> Result<PolymerChain, PolySimError>
pub fn graft_copolymer( &self, graft_fraction: f64, seed: Option<u64>, ) -> Result<PolymerChain, PolySimError>
Generates a graft copolymer (random branch-point placement).
graft_fraction – fraction of backbone repeat units that carry a branch
(0.0 = no grafting, 1.0 = every backbone unit is grafted).
seed – optional random seed for reproducibility (overrides builder seed).
Sourcepub fn star_polymer(&self, arms: usize) -> Result<PolymerChain, PolySimError>
pub fn star_polymer(&self, arms: usize) -> Result<PolymerChain, PolySimError>
Generates a star polymer with arms arms radiating from a central atom.
Each arm is a homopolymer of the backbone BigSMILES repeat unit. The arm length is determined by the build strategy.
Supports 3 to 12 arms.
Sourcepub fn dendrimer(
&self,
generation: usize,
branching_factor: usize,
) -> Result<PolymerChain, PolySimError>
pub fn dendrimer( &self, generation: usize, branching_factor: usize, ) -> Result<PolymerChain, PolySimError>
Generates a dendrimer of the given generation with branching_factor
sub-branches per node.
generation: 1..=6branching_factor: number of sub-branches per terminal node (typically 2)