/**
  * Destructor.
  */
 public function __destruct()
 {
     parent::__destruct();
 }
Example #2
0
     * if it is a feasible solution and if the value of its objective function
     * is less than the current "best" solution.
     * This method is called by the search method
     * for every complete solution it generates.
     *
     * @param object ISolution $solution The specified complete solution.
     */
    public function updateBest(ISolution $solution)
    {
        if ($solution->isComplete() && $solution->isFeasible() && $solution->getObjective() < $this->bestObjective) {
            $this->bestSolution = $solution;
            $this->bestObjective = $solution->getObjective();
        }
    }
    //}>a
    /**
     * Main program.
     *
     * @param array $args Command-line arguments.
     * @return integer Zero on success; non-zero on failure.
     */
    public static function main($args)
    {
        printf("AbstractSolver main program.\n");
        $status = 0;
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(AbstractSolver::main(array_slice($argv, 1)));
}