C++ Reference
C++ Reference: CP-SAT
cp_model_solver.h
Go to the documentation of this file.
Class that owns everything related to a particular optimization model.
Definition: model.h:38
std::function< void(Model *)> NewFeasibleSolutionObserver(const std::function< void(const CpSolverResponse &response)> &observer)
Creates a solution observer with the model with model.Add(NewFeasibleSolutionObserver([](response){....
std::function< SatParameters(Model *)> NewSatParameters(const std::string ¶ms)
Creates parameters for the solver, which you can add to the model with.
std::string CpSolverResponseStats(const CpSolverResponse &response, bool has_objective=true)
Returns a string with some statistics on the solver response.
void SetSynchronizationFunction(std::function< CpSolverResponse()> f, Model *model)
If set, the underlying solver will call this function regularly in a deterministic way.
std::string CpModelStats(const CpModelProto &model)
Returns a string with some statistics on the given CpModelProto.
CpSolverResponse SolveCpModel(const CpModelProto &model_proto, Model *model)
Solves the given CpModelProto.
CpSolverResponse SolveWithParameters(const CpModelProto &model_proto, const SatParameters ¶ms)
Solves the given CpModelProto with the given parameters.
CpSolverResponse Solve(const CpModelProto &model_proto)
Solves the given CpModelProto and returns an instance of CpSolverResponse.
Definition: cp_model.h:52