pub struct LayoutConfig {
pub seed: u64,
pub max_iterations: u32,
pub theta: f32,
pub repulsion: f32,
pub spring_stiffness: f32,
pub gravity: f32,
pub damping: f32,
pub cool_factor: f32,
pub min_alpha: f32,
pub max_step: f32,
pub min_dist: f32,
}Expand description
布局参数。默认值适合百到万级节点的知识图谱;视觉调参走 arc-tokens(G3/G4)。
Fields§
§seed: u64随机种子:同种子 → 同初始位置 → 同布局(方案 §4 可复现要求)。
max_iterations: u32最大迭代步数(冷却兜底上限)。
theta: f32Barnes–Hut 打开精度(盒边长 / 距离);0.9 兼顾精度与速度,1e-9 ≈ 暴力。
repulsion: f32排斥强度(库仑式 F = strength·m_i·m_j/d²)。
spring_stiffness: f32弹簧刚度(胡克 F = stiffness·weight·d)。
gravity: f32向心重力加速度。
damping: f32速度阻尼(0–1,越大越快停)。
cool_factor: f32冷却系数:每步 alpha 乘以该值。
min_alpha: f32alpha 低于该值视为冷却结束。
max_step: f32单步最大位移(防爆炸)。
min_dist: f32软化距离:两点间最小有效距离。
Trait Implementations§
Source§impl Clone for LayoutConfig
impl Clone for LayoutConfig
Source§impl Debug for LayoutConfig
impl Debug for LayoutConfig
Auto Trait Implementations§
impl Forget for LayoutConfig
impl Freeze for LayoutConfig
impl Move for LayoutConfig
impl RefUnwindSafe for LayoutConfig
impl Send for LayoutConfig
impl Sync for LayoutConfig
impl Unpin for LayoutConfig
impl UnsafeUnpin for LayoutConfig
impl UnwindSafe for LayoutConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more