pub trait CustomMetric: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn compute(
&self,
parameters: &HashMap<String, Float>,
objective_value: Float,
history: &OptimizationHistory,
) -> Result<Float, MetricError>;
fn higher_is_better(&self) -> bool;
}Expand description
Custom metric trait
Required Methods§
Sourcefn compute(
&self,
parameters: &HashMap<String, Float>,
objective_value: Float,
history: &OptimizationHistory,
) -> Result<Float, MetricError>
fn compute( &self, parameters: &HashMap<String, Float>, objective_value: Float, history: &OptimizationHistory, ) -> Result<Float, MetricError>
Compute metric value
Sourcefn higher_is_better(&self) -> bool
fn higher_is_better(&self) -> bool
Whether higher is better