add export model api with decision builder.
This commit is contained in:
@@ -1065,6 +1065,11 @@ class Solver {
|
||||
// the objective and limits to the protobuf.
|
||||
void ExportModel(const std::vector<SearchMonitor*>& monitors,
|
||||
CPModelProto* const proto) const;
|
||||
// Exports the model to protobuf. Search monitors are useful to pass
|
||||
// the objective and limits to the protobuf.
|
||||
void ExportModel(const std::vector<SearchMonitor*>& monitors,
|
||||
CPModelProto* const proto,
|
||||
DecisionBuilder* const db) const;
|
||||
// Loads the model into the solver, and returns true upon success.
|
||||
bool LoadModel(const CPModelProto& proto);
|
||||
// Loads the model into the solver, appends search monitors to monitors,
|
||||
|
||||
@@ -2606,6 +2606,16 @@ bool CPModelLoader::ScanOneArgument(int type_index,
|
||||
|
||||
// ----- Solver API -----
|
||||
|
||||
void Solver::ExportModel(const std::vector<SearchMonitor*>& monitors,
|
||||
CPModelProto* const model_proto,
|
||||
DecisionBuilder* const db) const {
|
||||
CHECK_NOTNULL(model_proto);
|
||||
FirstPassVisitor first_pass;
|
||||
Accept(&first_pass, monitors, db);
|
||||
SecondPassVisitor second_pass(first_pass, model_proto);
|
||||
Accept(&second_pass, monitors, db);
|
||||
}
|
||||
|
||||
void Solver::ExportModel(const std::vector<SearchMonitor*>& monitors,
|
||||
CPModelProto* const model_proto) const {
|
||||
CHECK_NOTNULL(model_proto);
|
||||
|
||||
Reference in New Issue
Block a user