1// Copyright 2010-2025 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
 
    6//     http://www.apache.org/licenses/LICENSE-2.0
 
    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.
 
   16package operations_research.service.v1;
 
   18import "ortools/service/v1/mathopt/model.proto";
 
   19import "ortools/service/v1/mathopt/model_parameters.proto";
 
   20import "ortools/service/v1/mathopt/parameters.proto";
 
   21import "ortools/service/v1/mathopt/result.proto";
 
   22import "ortools/service/v1/mathopt/solver_resources.proto";
 
   24option java_multiple_files = true;
 
   25option java_package = "com.google.ortools.service.v1";
 
   26option csharp_namespace = "Google.OrTools.Service";
 
   28// A One Platform API exposing a set of optimization solvers for high-level
 
   29// operations research problems.
 
   32  // Solves the input model and returns the result at once. Use this when you
 
   33  // don't need callbacks, incrementality and don't need to track the progress
 
   35  rpc SolveMathOptModel(SolveMathOptModelRequest)
 
   36      returns (SolveMathOptModelResponse) {}
 
   39// Request for a unary remote solve in MathOpt.
 
   40message SolveMathOptModelRequest {
 
   41  // Solver type to numerically solve the problem. Note that if a solver does
 
   42  // not support a specific feature in the model, the optimization procedure
 
   43  // won't be successful.
 
   44  mathopt.SolverTypeProto solver_type = 1;
 
   46  // A mathematical representation of the optimization problem to solve.
 
   47  mathopt.ModelProto model = 2;
 
   49  // Hints on resources requested for the solve.
 
   50  mathopt.SolverResourcesProto resources = 6;
 
   52  // Parameters to control a single solve. The enable_output parameter is
 
   53  // handled specifically. For solvers that support messages callbacks, setting
 
   54  // it to true will have the server register a message callback. The resulting
 
   55  // messages will be returned in SolveMathOptModelResponse.messages. For other
 
   56  // solvers, setting enable_output to true will result in an error.
 
   57  mathopt.SolveParametersProto parameters = 4;
 
   59  // Parameters to control a single solve that are specific to the input model
 
   60  // (see SolveParametersProto for model independent parameters).
 
   61  mathopt.ModelSolveParametersProto model_parameters = 5;
 
   64// Response for a unary remote solve in MathOpt.
 
   65message SolveMathOptModelResponse {
 
   66  // Description of the output of solving the model in the request.
 
   67  mathopt.SolveResultProto result = 1;
 
   69  // If SolveParametersProto.enable_output has been used, this will contain log
 
   70  // messages for solvers that support message callbacks.
 
   71  repeated string messages = 2;