コード例 #1
0
 /**
  * Solves this scales-balancing problem using the specified solver.
  *
  * @param object ISolver $solver The solver to use.
  * @return object ISolution The solution to this scales-balancing problem.
  */
 public function solve(ISolver $solver)
 {
     $result = $solver->solve(new ScalesBalancingProblem_Node($this));
     return $result;
 }
コード例 #2
0
 /**
  * Solves this 0/1 knapsack using the specified solver.
  *
  * @param object ISolver $solver The solver to use.
  * @return object ISolution The solution to this 0/1 knapsack problem.
  */
 public function solve(ISolver $solver)
 {
     $result = $solver->solve(new ZeroOneKnapsackProblem_Node($this));
     return $result;
 }