int Mistral2Solver::solve()
{

#ifdef _DEBUGWRAP
  std::cout << " SOLVE!! " << std::endl;
#endif

  solver->consolidate();

  
#ifdef _DEBUGWRAP
  std::cout << solver << std::endl;
  solver->parameters.verbosity = 2; 
#endif

  _branching_heuristic = solver->heuristic_factory(_var_heuristic_str, _val_heuristic_str, _heuristic_randomization);

  //if(!_search_goal)
  //_search_goal = new Mistral::Goal(Mistral::Goal::SATISFACTION);
  _restart_policy = solver->restart_factory(_restart_policy_str); 

  //Mistral::Outcome result = 
  solver->depth_first_search(solver->variables, _branching_heuristic, _restart_policy, NULL, false); //, _search_goal);

  return (is_sat());
}
예제 #2
0
double glpk_wrapper::get_objective() {
    assert(is_sat());
    if (solver_type == SIMPLEX || solver_type == EXACT) {
        return glp_get_obj_val(lp);
    } else {
        assert(solver_type == INTERIOR);
        return glp_ipt_obj_val(lp);
    }
}
예제 #3
0
bool glpk_wrapper::is_solution_unbounded() {
    assert(is_sat());
    if (solver_type == SIMPLEX || solver_type == EXACT) {
        int status = glp_get_status(lp);
        return status == GLP_UNBND;
    } else {
        return false;
    }
}
예제 #4
0
void glpk_wrapper::get_solution(box & b) {
    assert(is_sat());
    for (unsigned int i = 0; i < b.size(); i++) {
        if (solver_type == SIMPLEX || solver_type == EXACT) {
            b[i] = glp_get_col_prim(lp, i+1);
        } else {
            assert(solver_type == INTERIOR);
            b[i] = glp_ipt_col_prim(lp, i+1);
        }
    }
}
예제 #5
0
int CPLEXSolver::solve() {
    if(!has_been_added) initialise();

    double start_time = cplex->getCplexTime();
    cplex->extract(*model);
    cplex->setParam(IloCplex::MIPSearch, IloCplex::Traditional);
    cplex->solve();
    cplextime = (cplex->getCplexTime() - start_time);

    optimstatus = cplex->getStatus();
    return is_sat();
}
예제 #6
0
int WalksatSolver::solve()
{

#ifdef _DEBUGWRAP
  std::cout << "call solve" << std::endl;  
#endif 

#ifdef _DEBUGWRAP
  std::cout << "solve!" << std::endl;  
#endif 

  starttime = cpuTime();

  wsat.initialize_statistics();
  if(wsat.verbosity) wsat.print_statistics_header();
  wsat.walk_solve();
  endtime = cpuTime();

  return is_sat();
}
예제 #7
0
bool SCIPSolver::is_unsat(){ return ! is_sat(); }
예제 #8
0
bool GurobiSolver::is_unsat(){
    return ! is_sat();
}
예제 #9
0
bool GurobiSolver::is_unsat(){
    return (model->get(GRB_IntAttr_Status) == GRB_INFEASIBLE);
    return ! is_sat();
}