pub struct EnergyModel {
pub model_id: String,
pub domain: String,
pub residual_weights: Vec<ResidualWeight>,
pub rho_gate: f64,
pub energy_tolerance: f64,
pub correction_budget: u32,
pub stability_claim: Option<StabilityClaim>,
}Expand description
The declared energy model for a domain scope (PSP-8 System 5 EnergyModel).
Fields§
§model_id: String§domain: String§residual_weights: Vec<ResidualWeight>§rho_gate: f64The single descent tolerance rho_gate > 0.
energy_tolerance: f64Energy at or below which the candidate is treated as inside tolerance.
correction_budget: u32Finite correction budget (number of permitted regenerations).
stability_claim: Option<StabilityClaim>Optional analytic stability claim (continuous constants).
Implementations§
Source§impl EnergyModel
impl EnergyModel
pub fn new(domain: impl Into<String>, rho_gate: f64) -> Self
pub fn with_weight(self, weight: ResidualWeight) -> Self
pub fn with_correction_budget(self, budget: u32) -> Self
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the model: rho_gate > 0, finite tolerance, and every declared
weight strictly positive and finite.
Sourcepub fn resolve(
&self,
class: ResidualClass,
sensor: &SensorRef,
) -> Option<&ResidualWeight>
pub fn resolve( &self, class: ResidualClass, sensor: &SensorRef, ) -> Option<&ResidualWeight>
Resolve the weight and component for a residual. A sensor-specific entry
wins over a class-wide entry. Returns None when no weight is declared
(the caller treats that as an error: PSP-8 forbids implicit weight 1).
Trait Implementations§
Source§impl Clone for EnergyModel
impl Clone for EnergyModel
Source§fn clone(&self) -> EnergyModel
fn clone(&self) -> EnergyModel
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 moreSource§impl Debug for EnergyModel
impl Debug for EnergyModel
Source§impl<'de> Deserialize<'de> for EnergyModel
impl<'de> Deserialize<'de> for EnergyModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EnergyModel
impl PartialEq for EnergyModel
Source§fn eq(&self, other: &EnergyModel) -> bool
fn eq(&self, other: &EnergyModel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EnergyModel
impl Serialize for EnergyModel
impl StructuralPartialEq for EnergyModel
Auto Trait Implementations§
impl Freeze for EnergyModel
impl RefUnwindSafe for EnergyModel
impl Send for EnergyModel
impl Sync for EnergyModel
impl Unpin for EnergyModel
impl UnsafeUnpin for EnergyModel
impl UnwindSafe for EnergyModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.