OR-Tools  8.2
gurobi_proto_solver.h
Go to the documentation of this file.
1 // Copyright 2010-2018 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #ifndef OR_TOOLS_LINEAR_SOLVER_GUROBI_PROTO_SOLVER_H_
15 #define OR_TOOLS_LINEAR_SOLVER_GUROBI_PROTO_SOLVER_H_
16 
17 #include "absl/status/statusor.h"
19 #include "ortools/linear_solver/linear_solver.pb.h"
20 
21 namespace operations_research {
22 
23 // Solves the input request.
24 //
25 // By default this function creates a new master Gurobi environment, but an
26 // existing one can be passed as parameter. This can be useful with single-use
27 // Gurobi licenses since it is not possible to create a second environment if
28 // one already exists with those licenses.
29 //
30 // Please note though that the provided environment should not be actively used
31 // by another thread at the same time.
32 absl::StatusOr<MPSolutionResponse> GurobiSolveProto(
33  const MPModelRequest& request, GRBenv* gurobi_env = nullptr);
34 
35 // Set parameters specified in the string. The format of the string is a series
36 // of tokens separated by either '\n' or by ',' characters.
37 // Any token whose first character is a '#' or has zero length is skiped.
38 // Comment tokens (i.e. those starting with #) can contain ',' characters.
39 // Any other token has the form:
40 // parameter_name(separator)value
41 // where (separator) is either '=' or ' '.
42 // A valid string can look-like:
43 // "#\n# Gurobi-specific parameters, still part of the
44 // comment\n\nThreads=1\nPresolve 2,SolutionLimit=100" This function will
45 // process each and every token, even if an intermediate token is unrecognized.
46 absl::Status SetSolverSpecificParameters(const std::string& parameters,
47  GRBenv* gurobi);
48 } // namespace operations_research
49 #endif // OR_TOOLS_LINEAR_SOLVER_GUROBI_PROTO_SOLVER_H_
SatParameters parameters
struct _GRBenv GRBenv
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
absl::Status SetSolverSpecificParameters(const std::string &parameters, GRBenv *gurobi)
absl::StatusOr< MPSolutionResponse > GurobiSolveProto(const MPModelRequest &request, GRBenv *gurobi_env)