(
&self,
schema: &DecisionSchema,
objective: &dyn IntegerObjective,
)
| 34 | |
| 35 | impl SolverAdapter for ZeroVectorAdapter { |
| 36 | fn solve( |
| 37 | &self, |
| 38 | schema: &DecisionSchema, |
| 39 | objective: &dyn IntegerObjective, |
| 40 | ) -> Result<OptimizationResult, CombinatorialOptimizationError> { |
| 41 | schema.validate()?; |
| 42 | let decision = vec![0_i64; schema.variables.len()]; |
| 43 | let value = objective.evaluate(&decision)?; |
| 44 | Ok(OptimizationResult { |
| 45 | best_decision: decision, |
| 46 | best_objective: value, |
| 47 | evaluated_candidates: 1, |
| 48 | }) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | struct TrajectoryObjective { |
no test coverage detected