82 lines
2.1 KiB
Protocol Buffer
82 lines
2.1 KiB
Protocol Buffer
// Copyright 2010-2011 Google
|
|
// 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.
|
|
|
|
// Linear solver Stubby services
|
|
|
|
syntax = "proto2";
|
|
option java_package = "com.google.ortools.linearsolver";
|
|
option java_multiple_files = true;
|
|
|
|
package operations_research;
|
|
|
|
message MPVariableProto {
|
|
required string id = 1; // key
|
|
required double lb = 2;
|
|
required double ub = 3;
|
|
required bool integer = 4;
|
|
}
|
|
|
|
message MPTermProto {
|
|
required string variable_id = 1;
|
|
required double coefficient = 2;
|
|
}
|
|
|
|
message MPConstraintProto {
|
|
required double lb = 1;
|
|
required double ub = 2;
|
|
repeated MPTermProto terms = 3;
|
|
optional string id = 4;
|
|
}
|
|
|
|
message MPModelProto {
|
|
repeated MPVariableProto variables = 1;
|
|
required bool maximize = 2;
|
|
repeated MPTermProto objective_terms = 3;
|
|
repeated MPConstraintProto constraints = 7;
|
|
optional string name = 8;
|
|
optional double objective_offset = 9;
|
|
}
|
|
|
|
message MPModelRequest {
|
|
required MPModelProto model = 1;
|
|
enum OptimizationProblemType {
|
|
GLPK_LINEAR_PROGRAMMING = 0;
|
|
GLPK_MIXED_INTEGER_PROGRAMMING = 1;
|
|
CLP_LINEAR_PROGRAMMING = 2;
|
|
CBC_MIXED_INTEGER_PROGRAMMING = 3;
|
|
SCIP_MIXED_INTEGER_PROGRAMMING = 4;
|
|
}
|
|
required OptimizationProblemType problem_type = 2;
|
|
optional int32 time_limit_ms = 3;
|
|
}
|
|
|
|
message MPSolutionValue {
|
|
required string variable_id = 1;
|
|
required double value = 2;
|
|
}
|
|
|
|
message MPSolutionResponse {
|
|
enum ResultStatus {
|
|
OPTIMAL = 0;
|
|
FEASIBLE = 1;
|
|
INFEASIBLE = 2;
|
|
UNBOUNDED = 3;
|
|
ABNORMAL = 4;
|
|
NOT_SOLVED = 5;
|
|
}
|
|
required ResultStatus result_status = 1;
|
|
optional double objective_value = 2;
|
|
repeated MPSolutionValue solution_values = 3;
|
|
}
|
|
|