pub struct GradientDescent {
pub module_entropy: HashMap<ModuleId, f64>,
pub branch_factor: HashMap<ModuleId, f64>,
pub test_coverage: HashMap<ModuleId, f64>,
}Expand description
Engine for computing entropy-reducing suggestions.
Fields§
§module_entropy: HashMap<ModuleId, f64>Current entropy per module.
branch_factor: HashMap<ModuleId, f64>Branching factor per module (e.g. cyclomatic complexity).
test_coverage: HashMap<ModuleId, f64>Test coverage per module ∈ [0, 1].
Implementations§
Source§impl GradientDescent
impl GradientDescent
Sourcepub fn with_entropy(self, module: &str, h: f64) -> Self
pub fn with_entropy(self, module: &str, h: f64) -> Self
Set entropy for a module.
Sourcepub fn with_branches(self, module: &str, b: f64) -> Self
pub fn with_branches(self, module: &str, b: f64) -> Self
Set branching factor for a module.
Sourcepub fn with_coverage(self, module: &str, c: f64) -> Self
pub fn with_coverage(self, module: &str, c: f64) -> Self
Set test coverage for a module.
Sourcepub fn gradient(&self) -> Vec<(ModuleId, f64)>
pub fn gradient(&self) -> Vec<(ModuleId, f64)>
Compute the entropy gradient: partial derivative of total H w.r.t. each module.
Higher gradient → more entropy reduction potential.
Sourcepub fn suggest(&self) -> Vec<GradientSuggestion>
pub fn suggest(&self) -> Vec<GradientSuggestion>
Generate actionable suggestions sorted by expected impact.
Trait Implementations§
Source§impl Clone for GradientDescent
impl Clone for GradientDescent
Source§fn clone(&self) -> GradientDescent
fn clone(&self) -> GradientDescent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GradientDescent
impl RefUnwindSafe for GradientDescent
impl Send for GradientDescent
impl Sync for GradientDescent
impl Unpin for GradientDescent
impl UnsafeUnpin for GradientDescent
impl UnwindSafe for GradientDescent
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