MCPcopy Create free account
hub / github.com/Open-Quant/openquant / solve

Method solve

crates/openquant/tests/combinatorial_optimization.rs:36–49  ·  view source on GitHub ↗
(
        &self,
        schema: &DecisionSchema,
        objective: &dyn IntegerObjective,
    )

Source from the content-addressed store, hash-verified

34
35impl 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
52struct TrajectoryObjective {

Callers 1

solve_with_adapterFunction · 0.80

Calls 2

evaluateMethod · 0.80
validateMethod · 0.45

Tested by

no test coverage detected