pub struct DebRules<P>(pub P);Expand description
Deb’s feasibility rules (Deb 2000) as a Problem adapter.
Ranking induced: feasible by objective, then infeasible by total
violation — every feasible point beats every infeasible one. Works with
any forge optimizer; exact whenever feasible objectives stay below
FEASIBLE_CEILING.
use forge_core::constraint::{constrained_func, DebRules};
use forge_core::{De, Optimizer, Termination};
// Minimize x + y subject to x·y ≥ 1 on [0, 10]².
let p = constrained_func(
vec![(0.0, 10.0); 2],
|x| x[0] + x[1],
|x| vec![(1.0 - x[0] * x[1]).max(0.0)],
);
let report = De::default().optimize(&DebRules(p), &Termination::budget(6000));
assert!((report.best_value() - 2.0).abs() < 1e-2); // optimum at (1, 1)Tuple Fields§
§0: PTrait Implementations§
Source§impl<P: ConstrainedProblem> Problem for DebRules<P>
impl<P: ConstrainedProblem> Problem for DebRules<P>
Auto Trait Implementations§
impl<P> Freeze for DebRules<P>where
P: Freeze,
impl<P> RefUnwindSafe for DebRules<P>where
P: RefUnwindSafe,
impl<P> Send for DebRules<P>where
P: Send,
impl<P> Sync for DebRules<P>where
P: Sync,
impl<P> Unpin for DebRules<P>where
P: Unpin,
impl<P> UnsafeUnpin for DebRules<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for DebRules<P>where
P: UnwindSafe,
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