Exemple #1
0
static bool
RunContest(AbstractContest &_contest,
           ContestResult &result, ContestTraceVector &solution,
           bool exhaustive)
{
    // run solver, return immediately if further processing is required
    // by subsequent calls
    SolverResult r = _contest.Solve(exhaustive);
    if (r != SolverResult::VALID)
        return r != SolverResult::INCOMPLETE;

    // if no improved solution was found, must have finished processing
    // with invalid data
    result = _contest.GetBestResult();

    // solver finished and improved solution was found.  save solution
    // and retrieve new trace.

    solution = _contest.GetBestSolution();

    return true;
}
Exemple #2
0
bool
ContestManager::run_contest(AbstractContest &the_contest, 
                            ContestResult &contest_result,
                            TracePointVector &contest_solution)
{
  // run solver, return immediately if further processing is required
  // by subsequent calls
  if (!the_contest.solve())
    return false;

  // if no improved solution was found, must have finished processing
  // with invalid data
  if (!the_contest.score(contest_result)) {
    return true;
  }

  // solver finished and improved solution was found.  save solution
  // and retrieve new trace.

  the_contest.copy_solution(contest_solution);

  return true;
}
Exemple #3
0
bool
ContestManager::RunContest(AbstractContest &_contest,
                           ContestResult &result,
                           ContestTraceVector &solution,
                           bool exhaustive)
{
  // run solver, return immediately if further processing is required
  // by subsequent calls
  if (!_contest.Solve(exhaustive))
    return false;

  // if no improved solution was found, must have finished processing
  // with invalid data
  if (!_contest.Score(result))
    return true;

  // solver finished and improved solution was found.  save solution
  // and retrieve new trace.

  _contest.CopySolution(solution);

  return true;
}