pub struct AdaptiveFeasibility { /* private fields */ }Expand description
Adaptive feasibility pressure that adjusts constraint-handling behavior based on the ratio of feasible to infeasible solutions in the population.
When the feasibility ratio is low, the comparison rule leans toward preferring solutions with smaller violations (exploration mode). As feasibility improves, it transitions toward objective-based comparison (exploitation mode).
This prevents premature convergence into infeasible regions while still allowing useful gradient information from near-feasible solutions.
Implementations§
Source§impl AdaptiveFeasibility
impl AdaptiveFeasibility
Sourcepub fn new(
target_ratio: f64,
alpha: f64,
feasibility_tol: f64,
) -> OptimizeResult<Self>
pub fn new( target_ratio: f64, alpha: f64, feasibility_tol: f64, ) -> OptimizeResult<Self>
Create a new adaptive feasibility handler.
§Arguments
target_ratio— Desired fraction of feasible solutions (0 < t ≤ 1).alpha— Update learning rate for the ratio estimate.feasibility_tol— Tolerance below which violations are treated as zero.
Sourcepub fn update(&mut self, violations: &[ViolationSummary])
pub fn update(&mut self, violations: &[ViolationSummary])
Update the feasibility ratio estimate from the current population.
§Arguments
violations— Violation summaries for all population members.
Sourcepub fn feasibility_ratio(&self) -> f64
pub fn feasibility_ratio(&self) -> f64
Current estimated feasibility ratio.
Sourcepub fn effective_penalty_weight(&self, base_penalty: f64) -> f64
pub fn effective_penalty_weight(&self, base_penalty: f64) -> f64
Compute the effective penalty weight for constraint violations.
When feasibility_ratio < target_ratio, penalty is amplified to drive solutions toward feasibility. When ratio >= target_ratio, penalty is reduced to emphasize objective improvement.
The weight is: base_penalty * (target / current)^2 if below target,
or base_penalty * (current / target)^(-1) if above.
Sourcepub fn compare(
&self,
f_a: f64,
viol_a: &ViolationSummary,
f_b: f64,
viol_b: &ViolationSummary,
) -> Ordering
pub fn compare( &self, f_a: f64, viol_a: &ViolationSummary, f_b: f64, viol_b: &ViolationSummary, ) -> Ordering
Compare two solutions using the adaptive feasibility-weighted rule.
The effective comparison weight between objective and violation is controlled by the current feasibility pressure.
Trait Implementations§
Source§impl Clone for AdaptiveFeasibility
impl Clone for AdaptiveFeasibility
Source§fn clone(&self) -> AdaptiveFeasibility
fn clone(&self) -> AdaptiveFeasibility
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AdaptiveFeasibility
impl RefUnwindSafe for AdaptiveFeasibility
impl Send for AdaptiveFeasibility
impl Sync for AdaptiveFeasibility
impl Unpin for AdaptiveFeasibility
impl UnsafeUnpin for AdaptiveFeasibility
impl UnwindSafe for AdaptiveFeasibility
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.