Struct Point
pub struct Point<'a> {
pub values: &'a [f64],
pub constraints: Option<&'a [f64]>,
}Expand description
One solution as the comparison layer sees it: its objectives and, if it declared any, its constraint values.
A borrowed view rather than an owned struct, so a caller ranking trials
borrows straight out of the FrozenTrials it
already holds and copies nothing.
An empty constraint slice means “this solution declared no constraints”
and is normalised to None by Point::new: an empty list carries no
feasibility information, so treating it as a declaration would make every
such point beat every point that genuinely declared none
(see constrained_dominates).
use atune_core::pareto::Point;
let plain = Point::new(&[1.0, 2.0], &[]);
assert_eq!(plain.constraints, None, "an empty list is not a declaration");
let constrained = Point::new(&[1.0, 2.0], &[-0.5]);
assert!(constrained.is_feasible());Fields§
§values: &'a [f64]The objective values, one per study
Direction.
constraints: Option<&'a [f64]>The constraint values, if the solution declared any. ≤ 0 is satisfied.
Implementations§
§impl<'a> Point<'a>
impl<'a> Point<'a>
pub const fn new(values: &'a [f64], constraints: &'a [f64]) -> Self
pub const fn new(values: &'a [f64], constraints: &'a [f64]) -> Self
A point with objectives and constraints; an empty constraint slice
becomes None.
pub const fn unconstrained(values: &'a [f64]) -> Self
pub const fn unconstrained(values: &'a [f64]) -> Self
A point that declares no constraints.
pub fn is_feasible(&self) -> bool
pub fn is_feasible(&self) -> bool
true if the point declared no constraints, or declared only satisfied
ones.
A solution that declared nothing is not infeasible — it simply said nothing about feasibility.