pub trait DynProblem: Any {
// Required methods
fn evaluate_dyn(&self, config: &[usize]) -> String;
fn evaluate_json(&self, config: &[usize]) -> Value;
fn serialize_json(&self) -> Value;
fn as_any(&self) -> &dyn Any;
fn dims_dyn(&self) -> Vec<usize>;
fn problem_name(&self) -> &'static str;
fn variant_map(&self) -> BTreeMap<String, String>;
fn num_variables_dyn(&self) -> usize;
}Expand description
Type-erased problem interface for dynamic dispatch.
Implemented via blanket impl for any T: Problem + Serialize + 'static.
Required Methods§
Sourcefn evaluate_dyn(&self, config: &[usize]) -> String
fn evaluate_dyn(&self, config: &[usize]) -> String
Evaluate a configuration and return the result as a debug string.
Sourcefn evaluate_json(&self, config: &[usize]) -> Value
fn evaluate_json(&self, config: &[usize]) -> Value
Evaluate a configuration and return the result as a serializable JSON value.
Sourcefn serialize_json(&self) -> Value
fn serialize_json(&self) -> Value
Serialize the problem to a JSON value.
Sourcefn problem_name(&self) -> &'static str
fn problem_name(&self) -> &'static str
Return the problem name (Problem::NAME).
Sourcefn variant_map(&self) -> BTreeMap<String, String>
fn variant_map(&self) -> BTreeMap<String, String>
Return the variant key-value map.
Sourcefn num_variables_dyn(&self) -> usize
fn num_variables_dyn(&self) -> usize
Return the number of variables.