pub struct Decision {
pub decision_type: String,
pub options: Vec<String>,
pub chosen: String,
pub rationale: IndexMap<String, f64>,
pub rng_value: Option<f64>,
}Expand description
Algorithmic decision record.
Every decision MUST be logged with options considered, choice made, and the rationale (metrics that drove the choice).
Fields§
§decision_type: StringDecision type (e.g., rcl_selection, two_opt_apply, update_best)
options: Vec<String>Options that were considered
chosen: StringThe option that was chosen
rationale: IndexMap<String, f64>Rationale: metrics that drove the choice
rng_value: Option<f64>RNG value used (if decision involved randomness)
Implementations§
Source§impl Decision
impl Decision
Sourcepub fn new(decision_type: impl Into<String>, chosen: impl Into<String>) -> Self
pub fn new(decision_type: impl Into<String>, chosen: impl Into<String>) -> Self
Create a new decision record.
Sourcepub fn with_options(self, options: Vec<String>) -> Self
pub fn with_options(self, options: Vec<String>) -> Self
Add options that were considered.
Sourcepub fn with_rationale(self, name: impl Into<String>, value: f64) -> Self
pub fn with_rationale(self, name: impl Into<String>, value: f64) -> Self
Add a rationale metric.
Sourcepub fn with_rng_value(self, value: f64) -> Self
pub fn with_rng_value(self, value: f64) -> Self
Set the RNG value used.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Decision
impl<'de> Deserialize<'de> for Decision
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
impl StructuralPartialEq for Decision
Auto Trait Implementations§
impl Freeze for Decision
impl RefUnwindSafe for Decision
impl Send for Decision
impl Sync for Decision
impl Unpin for Decision
impl UnsafeUnpin for Decision
impl UnwindSafe for Decision
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