From a5fab9815200875fb544c8995c7d390558530128 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Fri, 19 Feb 2021 15:01:14 +0100 Subject: [PATCH] add grpc service file for CP-SAT --- ortools/sat/cp_model_service.proto | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 ortools/sat/cp_model_service.proto diff --git a/ortools/sat/cp_model_service.proto b/ortools/sat/cp_model_service.proto new file mode 100644 index 0000000000..6ca4048c14 --- /dev/null +++ b/ortools/sat/cp_model_service.proto @@ -0,0 +1,48 @@ +// Copyright 2010-2018 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package operations_research.sat; + +import "google/protobuf/duration.proto"; +import "ortools/sat/cp_model.proto"; + +option csharp_namespace = "Google.OrTools.Sat"; +option java_package = "com.google.ortools.sat"; +option java_multiple_files = true; + +// Experimental rpc code. + +message SolveRequest { + CpModelProto model = 1; + int32 num_search_workers = 2; + google.protobuf.Duration time_limit = 3; + string search_parameters_as_string = 4; + bool log_search_progress = 5; +} + +message SolveAnswer { + CpSolverResponse response = 1; + string search_log = 2; +} + +// This service enables sending a CpModelProto to a server and getting back +// the optimal solution or all intermediate solutions of the problem. +service CpSatRemoveSolve { + // Single solve, sends a model, expects the optimal solution. + rpc Solve(SolveRequest) returns (SolveAnswer) {} + // Streaming solve, sends a model, expects all intermediate solutions as well + // as the final one. + rpc StreamingSolve(SolveRequest) returns (stream SolveAnswer) {} +}