diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index fcf74bd..71d3888 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -15,10 +15,6 @@ updates: groups: python: patterns: ["*"] - - package-ecosystem: gomod - directory: /gen/go - schedule: - interval: weekly - package-ecosystem: docker directory: / schedule: diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 78efa71..cf82566 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -23,6 +23,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.event.workflow_run.head_sha || github.sha }} - name: Authenticate at registry uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 @@ -38,6 +40,7 @@ jobs: id: meta uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 with: + context: git images: ghcr.io/${{ github.repository }} tags: | type=sha,prefix=,format=short @@ -56,3 +59,13 @@ jobs: provenance: true cache-from: type=gha cache-to: type=gha,mode=max + + - name: Setup Buf + uses: bufbuild/buf-action@85aebf73123b5c15fd5528aaecbf9129cddf7fa7 # v1.6.0 + with: + version: 1.73.0 + setup_only: true + token: ${{ secrets.BUF_TOKEN }} + + - name: Publish schema + run: buf push --create --create-visibility public --label main --git-metadata diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 08c0951..1aeb03c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,27 +27,32 @@ jobs: enable-cache: true cache-dependency-glob: uv.lock - - name: Setup Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version-file: gen/go/go.mod - cache-dependency-path: gen/go/go.sum - - name: Install dependencies run: uv sync --locked + - name: Setup Buf + uses: bufbuild/buf-action@85aebf73123b5c15fd5528aaecbf9129cddf7fa7 # v1.6.0 + with: + version: 1.73.0 + setup_only: true + token: ${{ secrets.BUF_TOKEN }} + - name: Lint and format run: | + buf lint + buf format --diff --exit-code --path proto/fanscore/optimizer uv run --locked ruff check uv run --locked ruff format --check - name: Check generated bindings run: | - uv run --locked python scripts/generate.py --check - uv run --locked python scripts/generate.py --go --check + generated="$(mktemp -d)" + trap 'rm -rf "$generated"' EXIT + buf generate --output "$generated" + diff -ru -x __pycache__ src/fanscore/optimizer/v1 "$generated/src/fanscore/optimizer/v1" - - name: Test Python service - run: uv run --locked pytest + - name: Check protobuf compatibility + run: buf breaking --exclude-imports --against buf.build/fanscore-ch/optimizer:main - - name: Test Go client against Python - run: uv run --locked python scripts/test_go.py + - name: Test + run: uv run --locked pytest diff --git a/README.md b/README.md index f89f850..1d41404 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,48 @@ # Optimizer FanScore's stateless gRPC service for OR-Tools CP-SAT models. Platform builds -models and handles business rules and transactions; Optimizer executes solves. +models and handles business rules; Optimizer executes solves. -## Prerequisites +## Run -- [devenv](https://devenv.sh/) - -## Quick Start +Install [devenv](https://devenv.sh/), then: ```sh devenv up ``` -Devenv supplies Python 3.14 and Go and installs the locked dependencies. -The service listens on port `50051`; the default binding is `[::]:50051`. -Configuration comes from environment variables documented in [`.env.example`](.env.example). +Devenv supplies Python, Buf, and the locked dependencies. +The service listens on port `50051`. See [`.env.example`](.env.example) for configuration. ## Development ```sh -devenv shell -- generate # Python bindings -devenv shell -- generate-go # Go bindings -devenv shell -- check-generated # Verify generated bindings +devenv shell -- generate # Generate Python service bindings with Buf +devenv shell -- check-generated # Check bindings match the schema devenv shell -- lint -devenv shell -- test # Python tests -devenv shell -- test-go # Go client against a temporary Python server +devenv shell -- test devenv shell -- health # Probe the running service ``` -CI runs the same checks and also builds and verifies the container. - -## API +After changing the [service schema](proto/fanscore/optimizer/v1/optimizer.proto), +run `generate` and commit the updated Python bindings with the schema. +CI checks that bindings match and that the contract remains compatible with BSR `main`. -[`OptimizerService.Solve`](proto/optimizer/v1/optimizer.proto) accepts an OR-Tools -model and supported solver parameters and returns its solver response. Only use -solutions with status `OPTIMAL` or `FEASIBLE`. Set an RPC deadline; server limits -cap solve time, workers, concurrent solves, and message size. +The service reuses OR-Tools' installed Python messages. Vendored schemas in +`proto/ortools` must match the installed OR-Tools version; descriptor tests enforce this. -Python bindings live in `src/optimizer/v1`. The generated Go module lives in -`gen/go`; Platform imports it at a pinned version. Upstream protobufs and OR-Tools -versions must match; [descriptor tests](tests/test_proto.py) verify this. +## Smoke test -## Project Structure +With the service running: -```text -src/optimizer/ # gRPC server, configuration, and solver -proto/ # Service contract and vendored OR-Tools protos -gen/go/ # Generated Go client and OR-Tools messages -scripts/ # Binding generation and Go integration runner -tests/ # Python tests -devenv.nix # Toolchain, scripts, process, and hooks -Dockerfile # Production image +```sh +buf curl --schema . --protocol grpc --http2-prior-knowledge \ + -d '{"model":{}}' \ + http://127.0.0.1:50051/fanscore.optimizer.v1.OptimizerService/Solve ``` + +## API and SDKs + +See the [contract documentation](proto/buf.md) for RPC behavior and supported parameters. +Generated client SDKs are available from +[`buf.build/fanscore-ch/optimizer`](https://buf.build/fanscore-ch/optimizer). diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000..32d80cc --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,12 @@ +version: v2 +plugins: + - remote: buf.build/protocolbuffers/python:v33.5 + revision: 1 + out: src + - remote: buf.build/grpc/python:v1.81.1 + revision: 1 + out: src +inputs: + - directory: . + paths: + - proto/fanscore/optimizer diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..9b109c3 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,15 @@ +version: v2 +modules: + - path: proto + name: buf.build/fanscore-ch/optimizer +lint: + use: + - STANDARD + - COMMENTS + - UNARY_RPC + disallow_comment_ignores: true + ignore: + - proto/ortools +breaking: + use: + - FILE diff --git a/devenv.nix b/devenv.nix index 2e3ce10..e3d1724 100644 --- a/devenv.nix +++ b/devenv.nix @@ -13,21 +13,29 @@ }; }; - languages.go.enable = true; - - packages = [ pkgs.git ]; + packages = [ + pkgs.git + pkgs.buf + pkgs.diffutils + ]; scripts = { - generate.exec = "uv run python scripts/generate.py"; - generate-go.exec = "uv run python scripts/generate.py --go"; + generate.exec = "buf generate"; check-generated.exec = '' set -e - uv run python scripts/generate.py --check - uv run python scripts/generate.py --go --check + generated="$(mktemp -d)" + trap 'rm -rf "$generated"' EXIT + buf generate --output "$generated" + diff -ru -x __pycache__ src/fanscore/optimizer/v1 "$generated/src/fanscore/optimizer/v1" + ''; + lint.exec = '' + set -e + buf lint + buf format --diff --exit-code --path proto/fanscore/optimizer + uv run ruff check + uv run ruff format --check ''; - lint.exec = "uv run ruff check && uv run ruff format --check"; test.exec = "uv run pytest"; - test-go.exec = "uv run python scripts/test_go.py"; health.exec = "uv run optimizer-health"; }; @@ -39,12 +47,12 @@ ruff = { enable = true; entry = "uv run ruff check"; - excludes = [ "^src/optimizer/v1/[^/]+_pb2(\\.pyi?|_grpc\\.py)$" ]; + excludes = [ "^src/fanscore/" ]; }; ruff-format = { enable = true; entry = "uv run ruff format --check"; - excludes = [ "^src/optimizer/v1/[^/]+_pb2(\\.pyi?|_grpc\\.py)$" ]; + excludes = [ "^src/fanscore/" ]; }; check-merge-conflicts.enable = true; check-yaml.enable = true; diff --git a/gen/go/go.mod b/gen/go/go.mod deleted file mode 100644 index 825f036..0000000 --- a/gen/go/go.mod +++ /dev/null @@ -1,15 +0,0 @@ -module github.com/fanscore-ch/optimizer/gen/go - -go 1.26.4 - -require ( - google.golang.org/grpc v1.84.0 - google.golang.org/protobuf v1.36.12 -) - -require ( - golang.org/x/net v0.57.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/text v0.40.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800 // indirect -) diff --git a/gen/go/go.sum b/gen/go/go.sum deleted file mode 100644 index 4f06a88..0000000 --- a/gen/go/go.sum +++ /dev/null @@ -1,18 +0,0 @@ -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= -golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= -golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= -gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= -gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800 h1:qEHAMpSaUhtD0p3NbEEI83HwNGFxEwaSJ1G9PLnCBZE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.84.0 h1:soMyaPJ8pAak5PIQ0DGBUir0XRo2fRoMqhNWMLlLxO0= -google.golang.org/grpc v1.84.0/go.mod h1:ljCht0DrxQrXBDRTZp52Qxh3Ffk8CdYm2sj4O2QN2C0= -google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= -google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/gen/go/optimizer/v1/client_test.go b/gen/go/optimizer/v1/client_test.go deleted file mode 100644 index 5fda44c..0000000 --- a/gen/go/optimizer/v1/client_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package optimizerv1_test - -import ( - "context" - "os" - "testing" - "time" - - optimizerv1 "github.com/fanscore-ch/optimizer/gen/go/optimizer/v1" - "github.com/fanscore-ch/optimizer/gen/go/ortools/sat" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/health/grpc_health_v1" - "google.golang.org/protobuf/proto" -) - -func TestPythonService(t *testing.T) { - address := os.Getenv("OPTIMIZER_TEST_ADDRESS") - if address == "" { - t.Skip("OPTIMIZER_TEST_ADDRESS is not set") - } - connection, err := grpc.NewClient(address, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - t.Fatal(err) - } - t.Cleanup(func() { _ = connection.Close() }) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - health, err := grpc_health_v1.NewHealthClient(connection).Check(ctx, &grpc_health_v1.HealthCheckRequest{ - Service: "optimizer.v1.OptimizerService", - }) - if err != nil || health.GetStatus() != grpc_health_v1.HealthCheckResponse_SERVING { - t.Fatalf("health: %v, %v", health, err) - } - model := &sat.CpModelProto{ - Variables: []*sat.IntegerVariableProto{ - {Domain: []int64{0, 1}}, {Domain: []int64{0, 1}}, {Domain: []int64{0, 1}}, - }, - Constraints: []*sat.ConstraintProto{{ - Constraint: &sat.ConstraintProto_Linear{Linear: &sat.LinearConstraintProto{ - Vars: []int32{0, 1, 2}, Coeffs: []int64{6, 5, 3}, Domain: []int64{0, 8}, - }}, - }}, - Objective: &sat.CpObjectiveProto{ - Vars: []int32{0, 1, 2}, Coeffs: []int64{-6, -5, -3}, ScalingFactor: -1, - }, - } - response, err := optimizerv1.NewOptimizerServiceClient(connection).Solve(ctx, &optimizerv1.SolveRequest{ - Model: model, - Parameters: &sat.SatParameters{NumWorkers: proto.Int32(1), MaxTimeInSeconds: proto.Float64(1)}, - }) - if err != nil { - t.Fatal(err) - } - result := response.GetResult() - if result.GetStatus() != sat.CpSolverStatus_OPTIMAL || result.GetObjectiveValue() != 8 { - t.Fatalf("unexpected result: %v", result) - } - solution := result.GetSolution() - if len(solution) != 3 || solution[0] != 0 || solution[1] != 1 || solution[2] != 1 { - t.Fatalf("unexpected solution: %v", solution) - } -} diff --git a/gen/go/optimizer/v1/optimizer.pb.go b/gen/go/optimizer/v1/optimizer.pb.go deleted file mode 100644 index ae6c67c..0000000 --- a/gen/go/optimizer/v1/optimizer.pb.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.12 -// protoc v6.33.5 -// source: optimizer/v1/optimizer.proto - -package optimizerv1 - -import ( - sat "github.com/fanscore-ch/optimizer/gen/go/ortools/sat" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SolveRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Required. Variable indexes in the response refer to this model's variables. - Model *sat.CpModelProto `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` - // Optional. Supported fields: max_time_in_seconds, max_deterministic_time, - // num_workers, random_seed, stop_after_first_solution, - // relative_gap_limit, absolute_gap_limit. Other fields are rejected. - // Solve time is capped by server configuration and the remaining RPC deadline. - // Worker count is capped by server configuration. - Parameters *sat.SatParameters `protobuf:"bytes,2,opt,name=parameters,proto3" json:"parameters,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SolveRequest) Reset() { - *x = SolveRequest{} - mi := &file_optimizer_v1_optimizer_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SolveRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SolveRequest) ProtoMessage() {} - -func (x *SolveRequest) ProtoReflect() protoreflect.Message { - mi := &file_optimizer_v1_optimizer_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SolveRequest.ProtoReflect.Descriptor instead. -func (*SolveRequest) Descriptor() ([]byte, []int) { - return file_optimizer_v1_optimizer_proto_rawDescGZIP(), []int{0} -} - -func (x *SolveRequest) GetModel() *sat.CpModelProto { - if x != nil { - return x.Model - } - return nil -} - -func (x *SolveRequest) GetParameters() *sat.SatParameters { - if x != nil { - return x.Parameters - } - return nil -} - -type SolveResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Includes OPTIMAL, FEASIBLE, INFEASIBLE, MODEL_INVALID, or UNKNOWN. - // A solution may only be consumed for OPTIMAL or FEASIBLE. - Result *sat.CpSolverResponse `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SolveResponse) Reset() { - *x = SolveResponse{} - mi := &file_optimizer_v1_optimizer_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SolveResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SolveResponse) ProtoMessage() {} - -func (x *SolveResponse) ProtoReflect() protoreflect.Message { - mi := &file_optimizer_v1_optimizer_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SolveResponse.ProtoReflect.Descriptor instead. -func (*SolveResponse) Descriptor() ([]byte, []int) { - return file_optimizer_v1_optimizer_proto_rawDescGZIP(), []int{1} -} - -func (x *SolveResponse) GetResult() *sat.CpSolverResponse { - if x != nil { - return x.Result - } - return nil -} - -var File_optimizer_v1_optimizer_proto protoreflect.FileDescriptor - -const file_optimizer_v1_optimizer_proto_rawDesc = "" + - "\n" + - "\x1coptimizer/v1/optimizer.proto\x12\foptimizer.v1\x1a\x1aortools/sat/cp_model.proto\x1a ortools/sat/sat_parameters.proto\"\x93\x01\n" + - "\fSolveRequest\x12;\n" + - "\x05model\x18\x01 \x01(\v2%.operations_research.sat.CpModelProtoR\x05model\x12F\n" + - "\n" + - "parameters\x18\x02 \x01(\v2&.operations_research.sat.SatParametersR\n" + - "parameters\"R\n" + - "\rSolveResponse\x12A\n" + - "\x06result\x18\x01 \x01(\v2).operations_research.sat.CpSolverResponseR\x06result2T\n" + - "\x10OptimizerService\x12@\n" + - "\x05Solve\x12\x1a.optimizer.v1.SolveRequest\x1a\x1b.optimizer.v1.SolveResponseBBZ@github.com/fanscore-ch/optimizer/gen/go/optimizer/v1;optimizerv1b\x06proto3" - -var ( - file_optimizer_v1_optimizer_proto_rawDescOnce sync.Once - file_optimizer_v1_optimizer_proto_rawDescData []byte -) - -func file_optimizer_v1_optimizer_proto_rawDescGZIP() []byte { - file_optimizer_v1_optimizer_proto_rawDescOnce.Do(func() { - file_optimizer_v1_optimizer_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_optimizer_v1_optimizer_proto_rawDesc), len(file_optimizer_v1_optimizer_proto_rawDesc))) - }) - return file_optimizer_v1_optimizer_proto_rawDescData -} - -var file_optimizer_v1_optimizer_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_optimizer_v1_optimizer_proto_goTypes = []any{ - (*SolveRequest)(nil), // 0: optimizer.v1.SolveRequest - (*SolveResponse)(nil), // 1: optimizer.v1.SolveResponse - (*sat.CpModelProto)(nil), // 2: operations_research.sat.CpModelProto - (*sat.SatParameters)(nil), // 3: operations_research.sat.SatParameters - (*sat.CpSolverResponse)(nil), // 4: operations_research.sat.CpSolverResponse -} -var file_optimizer_v1_optimizer_proto_depIdxs = []int32{ - 2, // 0: optimizer.v1.SolveRequest.model:type_name -> operations_research.sat.CpModelProto - 3, // 1: optimizer.v1.SolveRequest.parameters:type_name -> operations_research.sat.SatParameters - 4, // 2: optimizer.v1.SolveResponse.result:type_name -> operations_research.sat.CpSolverResponse - 0, // 3: optimizer.v1.OptimizerService.Solve:input_type -> optimizer.v1.SolveRequest - 1, // 4: optimizer.v1.OptimizerService.Solve:output_type -> optimizer.v1.SolveResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_optimizer_v1_optimizer_proto_init() } -func file_optimizer_v1_optimizer_proto_init() { - if File_optimizer_v1_optimizer_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_optimizer_v1_optimizer_proto_rawDesc), len(file_optimizer_v1_optimizer_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_optimizer_v1_optimizer_proto_goTypes, - DependencyIndexes: file_optimizer_v1_optimizer_proto_depIdxs, - MessageInfos: file_optimizer_v1_optimizer_proto_msgTypes, - }.Build() - File_optimizer_v1_optimizer_proto = out.File - file_optimizer_v1_optimizer_proto_goTypes = nil - file_optimizer_v1_optimizer_proto_depIdxs = nil -} diff --git a/gen/go/optimizer/v1/optimizer_grpc.pb.go b/gen/go/optimizer/v1/optimizer_grpc.pb.go deleted file mode 100644 index bbf4974..0000000 --- a/gen/go/optimizer/v1/optimizer_grpc.pb.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v6.33.5 -// source: optimizer/v1/optimizer.proto - -package optimizerv1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - OptimizerService_Solve_FullMethodName = "/optimizer.v1.OptimizerService/Solve" -) - -// OptimizerServiceClient is the client API for OptimizerService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type OptimizerServiceClient interface { - // Solves a caller-defined model. No application data is loaded or persisted. - Solve(ctx context.Context, in *SolveRequest, opts ...grpc.CallOption) (*SolveResponse, error) -} - -type optimizerServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewOptimizerServiceClient(cc grpc.ClientConnInterface) OptimizerServiceClient { - return &optimizerServiceClient{cc} -} - -func (c *optimizerServiceClient) Solve(ctx context.Context, in *SolveRequest, opts ...grpc.CallOption) (*SolveResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SolveResponse) - err := c.cc.Invoke(ctx, OptimizerService_Solve_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// OptimizerServiceServer is the server API for OptimizerService service. -// All implementations must embed UnimplementedOptimizerServiceServer -// for forward compatibility. -type OptimizerServiceServer interface { - // Solves a caller-defined model. No application data is loaded or persisted. - Solve(context.Context, *SolveRequest) (*SolveResponse, error) - mustEmbedUnimplementedOptimizerServiceServer() -} - -// UnimplementedOptimizerServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedOptimizerServiceServer struct{} - -func (UnimplementedOptimizerServiceServer) Solve(context.Context, *SolveRequest) (*SolveResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Solve not implemented") -} -func (UnimplementedOptimizerServiceServer) mustEmbedUnimplementedOptimizerServiceServer() {} -func (UnimplementedOptimizerServiceServer) testEmbeddedByValue() {} - -// UnsafeOptimizerServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to OptimizerServiceServer will -// result in compilation errors. -type UnsafeOptimizerServiceServer interface { - mustEmbedUnimplementedOptimizerServiceServer() -} - -func RegisterOptimizerServiceServer(s grpc.ServiceRegistrar, srv OptimizerServiceServer) { - // If the following call panics, it indicates UnimplementedOptimizerServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&OptimizerService_ServiceDesc, srv) -} - -func _OptimizerService_Solve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SolveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OptimizerServiceServer).Solve(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: OptimizerService_Solve_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OptimizerServiceServer).Solve(ctx, req.(*SolveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// OptimizerService_ServiceDesc is the grpc.ServiceDesc for OptimizerService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var OptimizerService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "optimizer.v1.OptimizerService", - HandlerType: (*OptimizerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Solve", - Handler: _OptimizerService_Solve_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "optimizer/v1/optimizer.proto", -} diff --git a/gen/go/ortools/sat/cp_model.pb.go b/gen/go/ortools/sat/cp_model.pb.go deleted file mode 100644 index 5a8039d..0000000 --- a/gen/go/ortools/sat/cp_model.pb.go +++ /dev/null @@ -1,3483 +0,0 @@ -// Copyright 2010-2025 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. - -// Proto describing a general Constraint Programming (CP) problem. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.12 -// protoc v6.33.5 -// source: ortools/sat/cp_model.proto - -package sat - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The status returned by a solver trying to solve a CpModelProto. -type CpSolverStatus int32 - -const ( - // The status of the model is still unknown. A search limit has been reached - // before any of the statuses below could be determined. - CpSolverStatus_UNKNOWN CpSolverStatus = 0 - // The given CpModelProto didn't pass the validation step. You can get a - // detailed error by calling ValidateCpModel(model_proto). - CpSolverStatus_MODEL_INVALID CpSolverStatus = 1 - // A feasible solution has been found. But the search was stopped before we - // could prove optimality or before we enumerated all solutions of a - // feasibility problem (if asked). - CpSolverStatus_FEASIBLE CpSolverStatus = 2 - // The problem has been proven infeasible. - CpSolverStatus_INFEASIBLE CpSolverStatus = 3 - // An optimal feasible solution has been found. - // - // More generally, this status represent a success. So we also return OPTIMAL - // if we find a solution for a pure feasibility problem or if a gap limit has - // been specified and we return a solution within this limit. In the case - // where we need to return all the feasible solution, this status will only be - // returned if we enumerated all of them; If we stopped before, we will return - // FEASIBLE. - CpSolverStatus_OPTIMAL CpSolverStatus = 4 -) - -// Enum value maps for CpSolverStatus. -var ( - CpSolverStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "MODEL_INVALID", - 2: "FEASIBLE", - 3: "INFEASIBLE", - 4: "OPTIMAL", - } - CpSolverStatus_value = map[string]int32{ - "UNKNOWN": 0, - "MODEL_INVALID": 1, - "FEASIBLE": 2, - "INFEASIBLE": 3, - "OPTIMAL": 4, - } -) - -func (x CpSolverStatus) Enum() *CpSolverStatus { - p := new(CpSolverStatus) - *p = x - return p -} - -func (x CpSolverStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CpSolverStatus) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_cp_model_proto_enumTypes[0].Descriptor() -} - -func (CpSolverStatus) Type() protoreflect.EnumType { - return &file_ortools_sat_cp_model_proto_enumTypes[0] -} - -func (x CpSolverStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CpSolverStatus.Descriptor instead. -func (CpSolverStatus) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{0} -} - -// The order in which the variables (resp. affine expression) above should be -// considered. Note that only variables that are not already fixed are -// considered. -// -// TODO(user): extend as needed. -type DecisionStrategyProto_VariableSelectionStrategy int32 - -const ( - DecisionStrategyProto_CHOOSE_FIRST DecisionStrategyProto_VariableSelectionStrategy = 0 - DecisionStrategyProto_CHOOSE_LOWEST_MIN DecisionStrategyProto_VariableSelectionStrategy = 1 - DecisionStrategyProto_CHOOSE_HIGHEST_MAX DecisionStrategyProto_VariableSelectionStrategy = 2 - DecisionStrategyProto_CHOOSE_MIN_DOMAIN_SIZE DecisionStrategyProto_VariableSelectionStrategy = 3 - DecisionStrategyProto_CHOOSE_MAX_DOMAIN_SIZE DecisionStrategyProto_VariableSelectionStrategy = 4 -) - -// Enum value maps for DecisionStrategyProto_VariableSelectionStrategy. -var ( - DecisionStrategyProto_VariableSelectionStrategy_name = map[int32]string{ - 0: "CHOOSE_FIRST", - 1: "CHOOSE_LOWEST_MIN", - 2: "CHOOSE_HIGHEST_MAX", - 3: "CHOOSE_MIN_DOMAIN_SIZE", - 4: "CHOOSE_MAX_DOMAIN_SIZE", - } - DecisionStrategyProto_VariableSelectionStrategy_value = map[string]int32{ - "CHOOSE_FIRST": 0, - "CHOOSE_LOWEST_MIN": 1, - "CHOOSE_HIGHEST_MAX": 2, - "CHOOSE_MIN_DOMAIN_SIZE": 3, - "CHOOSE_MAX_DOMAIN_SIZE": 4, - } -) - -func (x DecisionStrategyProto_VariableSelectionStrategy) Enum() *DecisionStrategyProto_VariableSelectionStrategy { - p := new(DecisionStrategyProto_VariableSelectionStrategy) - *p = x - return p -} - -func (x DecisionStrategyProto_VariableSelectionStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DecisionStrategyProto_VariableSelectionStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_cp_model_proto_enumTypes[1].Descriptor() -} - -func (DecisionStrategyProto_VariableSelectionStrategy) Type() protoreflect.EnumType { - return &file_ortools_sat_cp_model_proto_enumTypes[1] -} - -func (x DecisionStrategyProto_VariableSelectionStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DecisionStrategyProto_VariableSelectionStrategy.Descriptor instead. -func (DecisionStrategyProto_VariableSelectionStrategy) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{21, 0} -} - -// Once a variable (resp. affine expression) has been chosen, this enum -// describe what decision is taken on its domain. -// -// TODO(user): extend as needed. -type DecisionStrategyProto_DomainReductionStrategy int32 - -const ( - DecisionStrategyProto_SELECT_MIN_VALUE DecisionStrategyProto_DomainReductionStrategy = 0 - DecisionStrategyProto_SELECT_MAX_VALUE DecisionStrategyProto_DomainReductionStrategy = 1 - DecisionStrategyProto_SELECT_LOWER_HALF DecisionStrategyProto_DomainReductionStrategy = 2 - DecisionStrategyProto_SELECT_UPPER_HALF DecisionStrategyProto_DomainReductionStrategy = 3 - DecisionStrategyProto_SELECT_MEDIAN_VALUE DecisionStrategyProto_DomainReductionStrategy = 4 - DecisionStrategyProto_SELECT_RANDOM_HALF DecisionStrategyProto_DomainReductionStrategy = 5 -) - -// Enum value maps for DecisionStrategyProto_DomainReductionStrategy. -var ( - DecisionStrategyProto_DomainReductionStrategy_name = map[int32]string{ - 0: "SELECT_MIN_VALUE", - 1: "SELECT_MAX_VALUE", - 2: "SELECT_LOWER_HALF", - 3: "SELECT_UPPER_HALF", - 4: "SELECT_MEDIAN_VALUE", - 5: "SELECT_RANDOM_HALF", - } - DecisionStrategyProto_DomainReductionStrategy_value = map[string]int32{ - "SELECT_MIN_VALUE": 0, - "SELECT_MAX_VALUE": 1, - "SELECT_LOWER_HALF": 2, - "SELECT_UPPER_HALF": 3, - "SELECT_MEDIAN_VALUE": 4, - "SELECT_RANDOM_HALF": 5, - } -) - -func (x DecisionStrategyProto_DomainReductionStrategy) Enum() *DecisionStrategyProto_DomainReductionStrategy { - p := new(DecisionStrategyProto_DomainReductionStrategy) - *p = x - return p -} - -func (x DecisionStrategyProto_DomainReductionStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DecisionStrategyProto_DomainReductionStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_cp_model_proto_enumTypes[2].Descriptor() -} - -func (DecisionStrategyProto_DomainReductionStrategy) Type() protoreflect.EnumType { - return &file_ortools_sat_cp_model_proto_enumTypes[2] -} - -func (x DecisionStrategyProto_DomainReductionStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DecisionStrategyProto_DomainReductionStrategy.Descriptor instead. -func (DecisionStrategyProto_DomainReductionStrategy) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{21, 1} -} - -// An integer variable. -// -// It will be referred to by an int32 corresponding to its index in a -// CpModelProto variables field. -// -// Depending on the context, a reference to a variable whose domain is in [0, 1] -// can also be seen as a Boolean that will be true if the variable value is 1 -// and false if it is 0. When used in this context, the field name will always -// contain the word "literal". -// -// Negative reference (advanced usage): to simplify the creation of a model and -// for efficiency reasons, all the "literal" or "variable" fields can also -// contain a negative index. A negative index i will refer to the negation of -// the integer variable at index -i -1 or to NOT the literal at the same index. -// -// Ex: A variable index 4 will refer to the integer variable model.variables(4) -// and an index of -5 will refer to the negation of the same variable. A literal -// index 4 will refer to the logical fact that model.variable(4) == 1 and a -// literal index of -5 will refer to the logical fact model.variable(4) == 0. -type IntegerVariableProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // For debug/logging only. Can be empty. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The variable domain given as a sorted list of n disjoint intervals - // [min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}]. - // - // The most common example being just [min, max]. - // If min == max, then this is a constant variable. - // - // We have: - // - domain_size() is always even. - // - min == domain.front(); - // - max == domain.back(); - // - for all i < n : min_i <= max_i - // - for all i < n-1 : max_i + 1 < min_{i+1}. - // - // Note that we check at validation that a variable domain is small enough so - // that we don't run into integer overflow in our algorithms. Because of that, - // you cannot just have "unbounded" variable like [0, kint64max] and should - // try to specify tighter domains. - Domain []int64 `protobuf:"varint,2,rep,packed,name=domain,proto3" json:"domain,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IntegerVariableProto) Reset() { - *x = IntegerVariableProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IntegerVariableProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IntegerVariableProto) ProtoMessage() {} - -func (x *IntegerVariableProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IntegerVariableProto.ProtoReflect.Descriptor instead. -func (*IntegerVariableProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{0} -} - -func (x *IntegerVariableProto) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *IntegerVariableProto) GetDomain() []int64 { - if x != nil { - return x.Domain - } - return nil -} - -// Argument of the constraints of the form OP(literals). -type BoolArgumentProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Literals []int32 `protobuf:"varint,1,rep,packed,name=literals,proto3" json:"literals,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BoolArgumentProto) Reset() { - *x = BoolArgumentProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BoolArgumentProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BoolArgumentProto) ProtoMessage() {} - -func (x *BoolArgumentProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BoolArgumentProto.ProtoReflect.Descriptor instead. -func (*BoolArgumentProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{1} -} - -func (x *BoolArgumentProto) GetLiterals() []int32 { - if x != nil { - return x.Literals - } - return nil -} - -// Some constraints supports linear expression instead of just using a reference -// to a variable. This is especially useful during presolve to reduce the model -// size. -type LinearExpressionProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Vars []int32 `protobuf:"varint,1,rep,packed,name=vars,proto3" json:"vars,omitempty"` - Coeffs []int64 `protobuf:"varint,2,rep,packed,name=coeffs,proto3" json:"coeffs,omitempty"` - Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LinearExpressionProto) Reset() { - *x = LinearExpressionProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LinearExpressionProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LinearExpressionProto) ProtoMessage() {} - -func (x *LinearExpressionProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LinearExpressionProto.ProtoReflect.Descriptor instead. -func (*LinearExpressionProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{2} -} - -func (x *LinearExpressionProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *LinearExpressionProto) GetCoeffs() []int64 { - if x != nil { - return x.Coeffs - } - return nil -} - -func (x *LinearExpressionProto) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -type LinearArgumentProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Target *LinearExpressionProto `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - Exprs []*LinearExpressionProto `protobuf:"bytes,2,rep,name=exprs,proto3" json:"exprs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LinearArgumentProto) Reset() { - *x = LinearArgumentProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LinearArgumentProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LinearArgumentProto) ProtoMessage() {} - -func (x *LinearArgumentProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LinearArgumentProto.ProtoReflect.Descriptor instead. -func (*LinearArgumentProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{3} -} - -func (x *LinearArgumentProto) GetTarget() *LinearExpressionProto { - if x != nil { - return x.Target - } - return nil -} - -func (x *LinearArgumentProto) GetExprs() []*LinearExpressionProto { - if x != nil { - return x.Exprs - } - return nil -} - -// All expressions must take different values. -type AllDifferentConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Exprs []*LinearExpressionProto `protobuf:"bytes,1,rep,name=exprs,proto3" json:"exprs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AllDifferentConstraintProto) Reset() { - *x = AllDifferentConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AllDifferentConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AllDifferentConstraintProto) ProtoMessage() {} - -func (x *AllDifferentConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AllDifferentConstraintProto.ProtoReflect.Descriptor instead. -func (*AllDifferentConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{4} -} - -func (x *AllDifferentConstraintProto) GetExprs() []*LinearExpressionProto { - if x != nil { - return x.Exprs - } - return nil -} - -// The linear sum vars[i] * coeffs[i] must fall in the given domain. The domain -// has the same format as the one in IntegerVariableProto. -// -// Note that the validation code currently checks using the domain of the -// involved variables that the sum can always be computed without integer -// overflow and throws an error otherwise. -type LinearConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Vars []int32 `protobuf:"varint,1,rep,packed,name=vars,proto3" json:"vars,omitempty"` - Coeffs []int64 `protobuf:"varint,2,rep,packed,name=coeffs,proto3" json:"coeffs,omitempty"` // Same size as vars. - Domain []int64 `protobuf:"varint,3,rep,packed,name=domain,proto3" json:"domain,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LinearConstraintProto) Reset() { - *x = LinearConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LinearConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LinearConstraintProto) ProtoMessage() {} - -func (x *LinearConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LinearConstraintProto.ProtoReflect.Descriptor instead. -func (*LinearConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{5} -} - -func (x *LinearConstraintProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *LinearConstraintProto) GetCoeffs() []int64 { - if x != nil { - return x.Coeffs - } - return nil -} - -func (x *LinearConstraintProto) GetDomain() []int64 { - if x != nil { - return x.Domain - } - return nil -} - -// The constraint linear_target = exprs[linear_index]. -// This enforces that index takes one of the value in [0, vars_size()). -type ElementConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` // Legacy field. - Target int32 `protobuf:"varint,2,opt,name=target,proto3" json:"target,omitempty"` // Legacy field. - Vars []int32 `protobuf:"varint,3,rep,packed,name=vars,proto3" json:"vars,omitempty"` // Legacy field. - LinearIndex *LinearExpressionProto `protobuf:"bytes,4,opt,name=linear_index,json=linearIndex,proto3" json:"linear_index,omitempty"` - LinearTarget *LinearExpressionProto `protobuf:"bytes,5,opt,name=linear_target,json=linearTarget,proto3" json:"linear_target,omitempty"` - Exprs []*LinearExpressionProto `protobuf:"bytes,6,rep,name=exprs,proto3" json:"exprs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ElementConstraintProto) Reset() { - *x = ElementConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ElementConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ElementConstraintProto) ProtoMessage() {} - -func (x *ElementConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ElementConstraintProto.ProtoReflect.Descriptor instead. -func (*ElementConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{6} -} - -func (x *ElementConstraintProto) GetIndex() int32 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *ElementConstraintProto) GetTarget() int32 { - if x != nil { - return x.Target - } - return 0 -} - -func (x *ElementConstraintProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *ElementConstraintProto) GetLinearIndex() *LinearExpressionProto { - if x != nil { - return x.LinearIndex - } - return nil -} - -func (x *ElementConstraintProto) GetLinearTarget() *LinearExpressionProto { - if x != nil { - return x.LinearTarget - } - return nil -} - -func (x *ElementConstraintProto) GetExprs() []*LinearExpressionProto { - if x != nil { - return x.Exprs - } - return nil -} - -// This is not really a constraint. It is there so it can be referred by other -// constraints using this "interval" concept. -// -// IMPORTANT: For now, this constraint do not enforce any relations on the -// components, and it is up to the client to add in the model: -// - enforcement => start + size == end. -// - enforcement => size >= 0 // Only needed if size is not already >= 0. -type IntervalConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Start *LinearExpressionProto `protobuf:"bytes,4,opt,name=start,proto3" json:"start,omitempty"` - End *LinearExpressionProto `protobuf:"bytes,5,opt,name=end,proto3" json:"end,omitempty"` - Size *LinearExpressionProto `protobuf:"bytes,6,opt,name=size,proto3" json:"size,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IntervalConstraintProto) Reset() { - *x = IntervalConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IntervalConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IntervalConstraintProto) ProtoMessage() {} - -func (x *IntervalConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IntervalConstraintProto.ProtoReflect.Descriptor instead. -func (*IntervalConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{7} -} - -func (x *IntervalConstraintProto) GetStart() *LinearExpressionProto { - if x != nil { - return x.Start - } - return nil -} - -func (x *IntervalConstraintProto) GetEnd() *LinearExpressionProto { - if x != nil { - return x.End - } - return nil -} - -func (x *IntervalConstraintProto) GetSize() *LinearExpressionProto { - if x != nil { - return x.Size - } - return nil -} - -// All the intervals (index of IntervalConstraintProto) must be disjoint. More -// formally, there must exist a sequence so that for each consecutive intervals, -// we have end_i <= start_{i+1}. In particular, intervals of size zero do matter -// for this constraint. This is also known as a disjunctive constraint in -// scheduling. -type NoOverlapConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Intervals []int32 `protobuf:"varint,1,rep,packed,name=intervals,proto3" json:"intervals,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NoOverlapConstraintProto) Reset() { - *x = NoOverlapConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NoOverlapConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NoOverlapConstraintProto) ProtoMessage() {} - -func (x *NoOverlapConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NoOverlapConstraintProto.ProtoReflect.Descriptor instead. -func (*NoOverlapConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{8} -} - -func (x *NoOverlapConstraintProto) GetIntervals() []int32 { - if x != nil { - return x.Intervals - } - return nil -} - -// The boxes defined by [start_x, end_x) * [start_y, end_y) cannot overlap. -// Furthermore, one box is optional if at least one of the x or y interval is -// optional. -// -// Note that the case of boxes of size zero is special. The following cases -// violate the constraint: -// - a point box inside a box with a non zero area -// - a line box overlapping a box with a non zero area -// - one vertical line box crossing an horizontal line box. -type NoOverlap2DConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - XIntervals []int32 `protobuf:"varint,1,rep,packed,name=x_intervals,json=xIntervals,proto3" json:"x_intervals,omitempty"` - YIntervals []int32 `protobuf:"varint,2,rep,packed,name=y_intervals,json=yIntervals,proto3" json:"y_intervals,omitempty"` // Same size as x_intervals. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NoOverlap2DConstraintProto) Reset() { - *x = NoOverlap2DConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NoOverlap2DConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NoOverlap2DConstraintProto) ProtoMessage() {} - -func (x *NoOverlap2DConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NoOverlap2DConstraintProto.ProtoReflect.Descriptor instead. -func (*NoOverlap2DConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{9} -} - -func (x *NoOverlap2DConstraintProto) GetXIntervals() []int32 { - if x != nil { - return x.XIntervals - } - return nil -} - -func (x *NoOverlap2DConstraintProto) GetYIntervals() []int32 { - if x != nil { - return x.YIntervals - } - return nil -} - -// The sum of the demands of the intervals at each interval point cannot exceed -// a capacity. Note that intervals are interpreted as [start, end) and as -// such intervals like [2,3) and [3,4) do not overlap for the point of view of -// this constraint. Moreover, intervals of size zero are ignored. -// -// All demands must not contain any negative value in their domains. This is -// checked at validation. Even if there are no intervals, this constraint -// implicit enforces capacity >= 0. In other words, a negative capacity is -// considered valid but always infeasible. -type CumulativeConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Capacity *LinearExpressionProto `protobuf:"bytes,1,opt,name=capacity,proto3" json:"capacity,omitempty"` - Intervals []int32 `protobuf:"varint,2,rep,packed,name=intervals,proto3" json:"intervals,omitempty"` - Demands []*LinearExpressionProto `protobuf:"bytes,3,rep,name=demands,proto3" json:"demands,omitempty"` // Same size as intervals. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CumulativeConstraintProto) Reset() { - *x = CumulativeConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CumulativeConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CumulativeConstraintProto) ProtoMessage() {} - -func (x *CumulativeConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CumulativeConstraintProto.ProtoReflect.Descriptor instead. -func (*CumulativeConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{10} -} - -func (x *CumulativeConstraintProto) GetCapacity() *LinearExpressionProto { - if x != nil { - return x.Capacity - } - return nil -} - -func (x *CumulativeConstraintProto) GetIntervals() []int32 { - if x != nil { - return x.Intervals - } - return nil -} - -func (x *CumulativeConstraintProto) GetDemands() []*LinearExpressionProto { - if x != nil { - return x.Demands - } - return nil -} - -// Maintain a reservoir level within bounds. The water level starts at 0, and at -// any time, it must be within [min_level, max_level]. -// -// If the variable active_literals[i] is true, and if the expression -// time_exprs[i] is assigned a value t, then the current level changes by -// level_changes[i] at the time t. Therefore, at any time t: -// -// sum(level_changes[i] * active_literals[i] if time_exprs[i] <= t) -// -// in [min_level, max_level] -// -// Note that min level must be <= 0, and the max level must be >= 0. Please use -// fixed level_changes to simulate initial state. -// -// The array of boolean variables 'actives', if defined, indicates which actions -// are actually performed. If this array is not defined, then it is assumed that -// all actions will be performed. -type ReservoirConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - MinLevel int64 `protobuf:"varint,1,opt,name=min_level,json=minLevel,proto3" json:"min_level,omitempty"` - MaxLevel int64 `protobuf:"varint,2,opt,name=max_level,json=maxLevel,proto3" json:"max_level,omitempty"` - TimeExprs []*LinearExpressionProto `protobuf:"bytes,3,rep,name=time_exprs,json=timeExprs,proto3" json:"time_exprs,omitempty"` - LevelChanges []*LinearExpressionProto `protobuf:"bytes,6,rep,name=level_changes,json=levelChanges,proto3" json:"level_changes,omitempty"` - ActiveLiterals []int32 `protobuf:"varint,5,rep,packed,name=active_literals,json=activeLiterals,proto3" json:"active_literals,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReservoirConstraintProto) Reset() { - *x = ReservoirConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReservoirConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReservoirConstraintProto) ProtoMessage() {} - -func (x *ReservoirConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReservoirConstraintProto.ProtoReflect.Descriptor instead. -func (*ReservoirConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{11} -} - -func (x *ReservoirConstraintProto) GetMinLevel() int64 { - if x != nil { - return x.MinLevel - } - return 0 -} - -func (x *ReservoirConstraintProto) GetMaxLevel() int64 { - if x != nil { - return x.MaxLevel - } - return 0 -} - -func (x *ReservoirConstraintProto) GetTimeExprs() []*LinearExpressionProto { - if x != nil { - return x.TimeExprs - } - return nil -} - -func (x *ReservoirConstraintProto) GetLevelChanges() []*LinearExpressionProto { - if x != nil { - return x.LevelChanges - } - return nil -} - -func (x *ReservoirConstraintProto) GetActiveLiterals() []int32 { - if x != nil { - return x.ActiveLiterals - } - return nil -} - -// The circuit constraint is defined on a graph where the arc presence are -// controlled by literals. Each arc is given by an index in the -// tails/heads/literals lists that must have the same size. -// -// For now, we ignore node indices with no incident arc. All the other nodes -// must have exactly one incoming and one outgoing selected arc (i.e. literal at -// true). All the selected arcs that are not self-loops must form a single -// circuit. Note that multi-arcs are allowed, but only one of them will be true -// at the same time. Multi-self loop are disallowed though. -type CircuitConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Tails []int32 `protobuf:"varint,3,rep,packed,name=tails,proto3" json:"tails,omitempty"` - Heads []int32 `protobuf:"varint,4,rep,packed,name=heads,proto3" json:"heads,omitempty"` - Literals []int32 `protobuf:"varint,5,rep,packed,name=literals,proto3" json:"literals,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CircuitConstraintProto) Reset() { - *x = CircuitConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CircuitConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CircuitConstraintProto) ProtoMessage() {} - -func (x *CircuitConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CircuitConstraintProto.ProtoReflect.Descriptor instead. -func (*CircuitConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{12} -} - -func (x *CircuitConstraintProto) GetTails() []int32 { - if x != nil { - return x.Tails - } - return nil -} - -func (x *CircuitConstraintProto) GetHeads() []int32 { - if x != nil { - return x.Heads - } - return nil -} - -func (x *CircuitConstraintProto) GetLiterals() []int32 { - if x != nil { - return x.Literals - } - return nil -} - -// The "VRP" (Vehicle Routing Problem) constraint. -// -// The direct graph where arc #i (from tails[i] to head[i]) is present iff -// literals[i] is true must satisfy this set of properties: -// - #incoming arcs == 1 except for node 0. -// - #outgoing arcs == 1 except for node 0. -// - for node zero, #incoming arcs == #outgoing arcs. -// - There are no duplicate arcs. -// - Self-arcs are allowed except for node 0. -// - There is no cycle in this graph, except through node 0. -// -// Note: Currently this constraint expects all the nodes in [0, num_nodes) to -// have at least one incident arc. The model will be considered invalid if it -// is not the case. You can add self-arc fixed to one to ignore some nodes if -// needed. -// -// TODO(user): It is probably possible to generalize this constraint to a -// no-cycle in a general graph, or a no-cycle with sum incoming <= 1 and sum -// outgoing <= 1 (more efficient implementation). On the other hand, having this -// specific constraint allow us to add specific "cuts" to a VRP problem. -type RoutesConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Tails []int32 `protobuf:"varint,1,rep,packed,name=tails,proto3" json:"tails,omitempty"` - Heads []int32 `protobuf:"varint,2,rep,packed,name=heads,proto3" json:"heads,omitempty"` - Literals []int32 `protobuf:"varint,3,rep,packed,name=literals,proto3" json:"literals,omitempty"` - // DEPRECATED. These fields are no longer used. The solver ignores them. - Demands []int32 `protobuf:"varint,4,rep,packed,name=demands,proto3" json:"demands,omitempty"` - Capacity int64 `protobuf:"varint,5,opt,name=capacity,proto3" json:"capacity,omitempty"` - // Expressions associated with the nodes of the graph, such as the load of the - // vehicle arriving at a node, or the time at which a vehicle arrives at a - // node. Expressions with the same "dimension" (such as "load" or "time") must - // be listed together. - // This field is optional. If it is set, the linear constraints of size 1 or 2 - // between the variables in these expressions will be used to derive cuts for - // this constraint. If it is not set, the solver will try to automatically - // derive it, from the linear constraints of size 1 or 2 in the model (this - // can fail in complex cases). - Dimensions []*RoutesConstraintProto_NodeExpressions `protobuf:"bytes,6,rep,name=dimensions,proto3" json:"dimensions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RoutesConstraintProto) Reset() { - *x = RoutesConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RoutesConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoutesConstraintProto) ProtoMessage() {} - -func (x *RoutesConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RoutesConstraintProto.ProtoReflect.Descriptor instead. -func (*RoutesConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{13} -} - -func (x *RoutesConstraintProto) GetTails() []int32 { - if x != nil { - return x.Tails - } - return nil -} - -func (x *RoutesConstraintProto) GetHeads() []int32 { - if x != nil { - return x.Heads - } - return nil -} - -func (x *RoutesConstraintProto) GetLiterals() []int32 { - if x != nil { - return x.Literals - } - return nil -} - -func (x *RoutesConstraintProto) GetDemands() []int32 { - if x != nil { - return x.Demands - } - return nil -} - -func (x *RoutesConstraintProto) GetCapacity() int64 { - if x != nil { - return x.Capacity - } - return 0 -} - -func (x *RoutesConstraintProto) GetDimensions() []*RoutesConstraintProto_NodeExpressions { - if x != nil { - return x.Dimensions - } - return nil -} - -// The values of the n-tuple formed by the given expression can only be one of -// the listed n-tuples in values. The n-tuples are encoded in a flattened way: -// -// [tuple0_v0, tuple0_v1, ..., tuple0_v{n-1}, tuple1_v0, ...]. -// -// Corner cases: -// - If all `vars`, `values` and `exprs` are empty, the constraint is trivially -// true, irrespective of the value of `negated`. -// - If `values` is empty but either vars or exprs is not, the constraint is -// trivially false if `negated` is false, and trivially true if `negated` is -// true. -// - If `vars` and `exprs` are empty but `values` is not, the model is invalid. -type TableConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Vars []int32 `protobuf:"varint,1,rep,packed,name=vars,proto3" json:"vars,omitempty"` // Legacy field. - Values []int64 `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` - Exprs []*LinearExpressionProto `protobuf:"bytes,4,rep,name=exprs,proto3" json:"exprs,omitempty"` - // If true, the meaning is "negated", that is we forbid any of the given - // tuple from a feasible assignment. - Negated bool `protobuf:"varint,3,opt,name=negated,proto3" json:"negated,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TableConstraintProto) Reset() { - *x = TableConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TableConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TableConstraintProto) ProtoMessage() {} - -func (x *TableConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TableConstraintProto.ProtoReflect.Descriptor instead. -func (*TableConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{14} -} - -func (x *TableConstraintProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *TableConstraintProto) GetValues() []int64 { - if x != nil { - return x.Values - } - return nil -} - -func (x *TableConstraintProto) GetExprs() []*LinearExpressionProto { - if x != nil { - return x.Exprs - } - return nil -} - -func (x *TableConstraintProto) GetNegated() bool { - if x != nil { - return x.Negated - } - return false -} - -// The two arrays of variable each represent a function, the second is the -// inverse of the first: f_direct[i] == j <=> f_inverse[j] == i. -type InverseConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - FDirect []int32 `protobuf:"varint,1,rep,packed,name=f_direct,json=fDirect,proto3" json:"f_direct,omitempty"` - FInverse []int32 `protobuf:"varint,2,rep,packed,name=f_inverse,json=fInverse,proto3" json:"f_inverse,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InverseConstraintProto) Reset() { - *x = InverseConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InverseConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InverseConstraintProto) ProtoMessage() {} - -func (x *InverseConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InverseConstraintProto.ProtoReflect.Descriptor instead. -func (*InverseConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{15} -} - -func (x *InverseConstraintProto) GetFDirect() []int32 { - if x != nil { - return x.FDirect - } - return nil -} - -func (x *InverseConstraintProto) GetFInverse() []int32 { - if x != nil { - return x.FInverse - } - return nil -} - -// This constraint forces a sequence of expressions to be accepted by an -// automaton. -type AutomatonConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A state is identified by a non-negative number. It is preferable to keep - // all the states dense in says [0, num_states). The automaton starts at - // starting_state and must finish in any of the final states. - StartingState int64 `protobuf:"varint,2,opt,name=starting_state,json=startingState,proto3" json:"starting_state,omitempty"` - FinalStates []int64 `protobuf:"varint,3,rep,packed,name=final_states,json=finalStates,proto3" json:"final_states,omitempty"` - // List of transitions (all 3 vectors have the same size). Both tail and head - // are states, label is any variable value. No two outgoing transitions from - // the same state can have the same label. - TransitionTail []int64 `protobuf:"varint,4,rep,packed,name=transition_tail,json=transitionTail,proto3" json:"transition_tail,omitempty"` - TransitionHead []int64 `protobuf:"varint,5,rep,packed,name=transition_head,json=transitionHead,proto3" json:"transition_head,omitempty"` - TransitionLabel []int64 `protobuf:"varint,6,rep,packed,name=transition_label,json=transitionLabel,proto3" json:"transition_label,omitempty"` - // Legacy field. - Vars []int32 `protobuf:"varint,7,rep,packed,name=vars,proto3" json:"vars,omitempty"` - // The sequence of expressions. The automaton is ran for exprs_size() "steps" - // and the value of exprs[i] corresponds to the transition label at step i. - Exprs []*LinearExpressionProto `protobuf:"bytes,8,rep,name=exprs,proto3" json:"exprs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AutomatonConstraintProto) Reset() { - *x = AutomatonConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AutomatonConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AutomatonConstraintProto) ProtoMessage() {} - -func (x *AutomatonConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AutomatonConstraintProto.ProtoReflect.Descriptor instead. -func (*AutomatonConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{16} -} - -func (x *AutomatonConstraintProto) GetStartingState() int64 { - if x != nil { - return x.StartingState - } - return 0 -} - -func (x *AutomatonConstraintProto) GetFinalStates() []int64 { - if x != nil { - return x.FinalStates - } - return nil -} - -func (x *AutomatonConstraintProto) GetTransitionTail() []int64 { - if x != nil { - return x.TransitionTail - } - return nil -} - -func (x *AutomatonConstraintProto) GetTransitionHead() []int64 { - if x != nil { - return x.TransitionHead - } - return nil -} - -func (x *AutomatonConstraintProto) GetTransitionLabel() []int64 { - if x != nil { - return x.TransitionLabel - } - return nil -} - -func (x *AutomatonConstraintProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *AutomatonConstraintProto) GetExprs() []*LinearExpressionProto { - if x != nil { - return x.Exprs - } - return nil -} - -// A list of variables, without any semantics. -type ListOfVariablesProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Vars []int32 `protobuf:"varint,1,rep,packed,name=vars,proto3" json:"vars,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListOfVariablesProto) Reset() { - *x = ListOfVariablesProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListOfVariablesProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOfVariablesProto) ProtoMessage() {} - -func (x *ListOfVariablesProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOfVariablesProto.ProtoReflect.Descriptor instead. -func (*ListOfVariablesProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{17} -} - -func (x *ListOfVariablesProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -// Next id: 31 -type ConstraintProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // For debug/logging only. Can be empty. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The constraint will be enforced iff all literals listed here are true. If - // this is empty, then the constraint will always be enforced. An enforced - // constraint must be satisfied, and an un-enforced one will simply be - // ignored. - // - // This is also called half-reification. To have an equivalence between a - // literal and a constraint (full reification), one must add both a constraint - // (controlled by a literal l) and its negation (controlled by the negation of - // l). - // - // Important: as of September 2025, some constraints might be less efficient - // with enforcement than without: circuit, routes, no_overlap, no_overlap_2d, - // and cumulative. If performance is not great, consider using a model without - // these constraints enforced. - EnforcementLiteral []int32 `protobuf:"varint,2,rep,packed,name=enforcement_literal,json=enforcementLiteral,proto3" json:"enforcement_literal,omitempty"` - // The actual constraint with its arguments. - // - // Types that are valid to be assigned to Constraint: - // - // *ConstraintProto_BoolOr - // *ConstraintProto_BoolAnd - // *ConstraintProto_AtMostOne - // *ConstraintProto_ExactlyOne - // *ConstraintProto_BoolXor - // *ConstraintProto_IntDiv - // *ConstraintProto_IntMod - // *ConstraintProto_IntProd - // *ConstraintProto_LinMax - // *ConstraintProto_Linear - // *ConstraintProto_AllDiff - // *ConstraintProto_Element - // *ConstraintProto_Circuit - // *ConstraintProto_Routes - // *ConstraintProto_Table - // *ConstraintProto_Automaton - // *ConstraintProto_Inverse - // *ConstraintProto_Reservoir - // *ConstraintProto_Interval - // *ConstraintProto_NoOverlap - // *ConstraintProto_NoOverlap_2D - // *ConstraintProto_Cumulative - // *ConstraintProto_DummyConstraint - Constraint isConstraintProto_Constraint `protobuf_oneof:"constraint"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConstraintProto) Reset() { - *x = ConstraintProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConstraintProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConstraintProto) ProtoMessage() {} - -func (x *ConstraintProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConstraintProto.ProtoReflect.Descriptor instead. -func (*ConstraintProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{18} -} - -func (x *ConstraintProto) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ConstraintProto) GetEnforcementLiteral() []int32 { - if x != nil { - return x.EnforcementLiteral - } - return nil -} - -func (x *ConstraintProto) GetConstraint() isConstraintProto_Constraint { - if x != nil { - return x.Constraint - } - return nil -} - -func (x *ConstraintProto) GetBoolOr() *BoolArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_BoolOr); ok { - return x.BoolOr - } - } - return nil -} - -func (x *ConstraintProto) GetBoolAnd() *BoolArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_BoolAnd); ok { - return x.BoolAnd - } - } - return nil -} - -func (x *ConstraintProto) GetAtMostOne() *BoolArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_AtMostOne); ok { - return x.AtMostOne - } - } - return nil -} - -func (x *ConstraintProto) GetExactlyOne() *BoolArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_ExactlyOne); ok { - return x.ExactlyOne - } - } - return nil -} - -func (x *ConstraintProto) GetBoolXor() *BoolArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_BoolXor); ok { - return x.BoolXor - } - } - return nil -} - -func (x *ConstraintProto) GetIntDiv() *LinearArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_IntDiv); ok { - return x.IntDiv - } - } - return nil -} - -func (x *ConstraintProto) GetIntMod() *LinearArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_IntMod); ok { - return x.IntMod - } - } - return nil -} - -func (x *ConstraintProto) GetIntProd() *LinearArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_IntProd); ok { - return x.IntProd - } - } - return nil -} - -func (x *ConstraintProto) GetLinMax() *LinearArgumentProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_LinMax); ok { - return x.LinMax - } - } - return nil -} - -func (x *ConstraintProto) GetLinear() *LinearConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Linear); ok { - return x.Linear - } - } - return nil -} - -func (x *ConstraintProto) GetAllDiff() *AllDifferentConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_AllDiff); ok { - return x.AllDiff - } - } - return nil -} - -func (x *ConstraintProto) GetElement() *ElementConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Element); ok { - return x.Element - } - } - return nil -} - -func (x *ConstraintProto) GetCircuit() *CircuitConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Circuit); ok { - return x.Circuit - } - } - return nil -} - -func (x *ConstraintProto) GetRoutes() *RoutesConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Routes); ok { - return x.Routes - } - } - return nil -} - -func (x *ConstraintProto) GetTable() *TableConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Table); ok { - return x.Table - } - } - return nil -} - -func (x *ConstraintProto) GetAutomaton() *AutomatonConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Automaton); ok { - return x.Automaton - } - } - return nil -} - -func (x *ConstraintProto) GetInverse() *InverseConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Inverse); ok { - return x.Inverse - } - } - return nil -} - -func (x *ConstraintProto) GetReservoir() *ReservoirConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Reservoir); ok { - return x.Reservoir - } - } - return nil -} - -func (x *ConstraintProto) GetInterval() *IntervalConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Interval); ok { - return x.Interval - } - } - return nil -} - -func (x *ConstraintProto) GetNoOverlap() *NoOverlapConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_NoOverlap); ok { - return x.NoOverlap - } - } - return nil -} - -func (x *ConstraintProto) GetNoOverlap_2D() *NoOverlap2DConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_NoOverlap_2D); ok { - return x.NoOverlap_2D - } - } - return nil -} - -func (x *ConstraintProto) GetCumulative() *CumulativeConstraintProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_Cumulative); ok { - return x.Cumulative - } - } - return nil -} - -func (x *ConstraintProto) GetDummyConstraint() *ListOfVariablesProto { - if x != nil { - if x, ok := x.Constraint.(*ConstraintProto_DummyConstraint); ok { - return x.DummyConstraint - } - } - return nil -} - -type isConstraintProto_Constraint interface { - isConstraintProto_Constraint() -} - -type ConstraintProto_BoolOr struct { - // The bool_or constraint forces at least one literal to be true. - BoolOr *BoolArgumentProto `protobuf:"bytes,3,opt,name=bool_or,json=boolOr,proto3,oneof"` -} - -type ConstraintProto_BoolAnd struct { - // The bool_and constraint forces all of the literals to be true. - // - // This is a "redundant" constraint in the sense that this can easily be - // encoded with many bool_or or at_most_one. It is just more space efficient - // and handled slightly differently internally. - BoolAnd *BoolArgumentProto `protobuf:"bytes,4,opt,name=bool_and,json=boolAnd,proto3,oneof"` -} - -type ConstraintProto_AtMostOne struct { - // The at_most_one constraint enforces that no more than one literal is - // true at the same time. - // - // Note that an at most one constraint of length n could be encoded with n - // bool_and constraint with n-1 term on the right hand side. So in a sense, - // this constraint contribute directly to the "implication-graph" or the - // 2-SAT part of the model. - AtMostOne *BoolArgumentProto `protobuf:"bytes,26,opt,name=at_most_one,json=atMostOne,proto3,oneof"` -} - -type ConstraintProto_ExactlyOne struct { - // The exactly_one constraint force exactly one literal to true and no more. - // - // Anytime a bool_or (it could have been called at_least_one) is included - // into an at_most_one, then the bool_or is actually an exactly one - // constraint, and the extra literal in the at_most_one can be set to false. - // So in this sense, this constraint is not really needed. it is just here - // for a better description of the problem structure and to facilitate some - // algorithm. - ExactlyOne *BoolArgumentProto `protobuf:"bytes,29,opt,name=exactly_one,json=exactlyOne,proto3,oneof"` -} - -type ConstraintProto_BoolXor struct { - // The bool_xor constraint forces an odd number of the literals to be true. - BoolXor *BoolArgumentProto `protobuf:"bytes,5,opt,name=bool_xor,json=boolXor,proto3,oneof"` -} - -type ConstraintProto_IntDiv struct { - // The int_div constraint forces the target to equal exprs[0] / exprs[1]. - // The division is "rounded" towards zero, so we can have for instance - // (2 = 12 / 5) or (-3 = -10 / 3). If you only want exact integer division, - // then you should use instead of t = a / b, the int_prod constraint - // a = b * t. - // - // If 0 belongs to the domain of exprs[1], then the model is deemed invalid. - IntDiv *LinearArgumentProto `protobuf:"bytes,7,opt,name=int_div,json=intDiv,proto3,oneof"` -} - -type ConstraintProto_IntMod struct { - // The int_mod constraint forces the target to equal exprs[0] % exprs[1]. - // The domain of exprs[1] must be strictly positive. The sign of the target - // is the same as the sign of exprs[0]. - IntMod *LinearArgumentProto `protobuf:"bytes,8,opt,name=int_mod,json=intMod,proto3,oneof"` -} - -type ConstraintProto_IntProd struct { - // The int_prod constraint forces the target to equal the product of all - // variables. By convention, because we can just remove term equal to one, - // the empty product forces the target to be one. - // - // Note that the solver checks for potential integer overflow. So the - // product of the maximum absolute value of all the terms (using the initial - // domain) should fit on an int64. Otherwise the model will be declared - // invalid. - IntProd *LinearArgumentProto `protobuf:"bytes,11,opt,name=int_prod,json=intProd,proto3,oneof"` -} - -type ConstraintProto_LinMax struct { - // The lin_max constraint forces the target to equal the maximum of all - // linear expressions. - // Note that this can model a minimum simply by negating all expressions. - LinMax *LinearArgumentProto `protobuf:"bytes,27,opt,name=lin_max,json=linMax,proto3,oneof"` -} - -type ConstraintProto_Linear struct { - // The linear constraint enforces a linear inequality among the variables, - // such as 0 <= x + 2y <= 10. - Linear *LinearConstraintProto `protobuf:"bytes,12,opt,name=linear,proto3,oneof"` -} - -type ConstraintProto_AllDiff struct { - // The all_diff constraint forces all variables to take different values. - AllDiff *AllDifferentConstraintProto `protobuf:"bytes,13,opt,name=all_diff,json=allDiff,proto3,oneof"` -} - -type ConstraintProto_Element struct { - // The element constraint forces the variable with the given index - // to be equal to the target. - Element *ElementConstraintProto `protobuf:"bytes,14,opt,name=element,proto3,oneof"` -} - -type ConstraintProto_Circuit struct { - // The circuit constraint takes a graph and forces the arcs present - // (with arc presence indicated by a literal) to form a unique cycle. - Circuit *CircuitConstraintProto `protobuf:"bytes,15,opt,name=circuit,proto3,oneof"` -} - -type ConstraintProto_Routes struct { - // The routes constraint implements the vehicle routing problem. - Routes *RoutesConstraintProto `protobuf:"bytes,23,opt,name=routes,proto3,oneof"` -} - -type ConstraintProto_Table struct { - // The table constraint enforces what values a tuple of variables may - // take. - Table *TableConstraintProto `protobuf:"bytes,16,opt,name=table,proto3,oneof"` -} - -type ConstraintProto_Automaton struct { - // The automaton constraint forces a sequence of variables to be accepted - // by an automaton. - Automaton *AutomatonConstraintProto `protobuf:"bytes,17,opt,name=automaton,proto3,oneof"` -} - -type ConstraintProto_Inverse struct { - // The inverse constraint forces two arrays to be inverses of each other: - // the values of one are the indices of the other, and vice versa. - Inverse *InverseConstraintProto `protobuf:"bytes,18,opt,name=inverse,proto3,oneof"` -} - -type ConstraintProto_Reservoir struct { - // The reservoir constraint forces the sum of a set of active demands - // to always be between a specified minimum and maximum value during - // specific times. - Reservoir *ReservoirConstraintProto `protobuf:"bytes,24,opt,name=reservoir,proto3,oneof"` -} - -type ConstraintProto_Interval struct { - // The interval constraint takes a start, end, and size, and forces - // start + size == end. - Interval *IntervalConstraintProto `protobuf:"bytes,19,opt,name=interval,proto3,oneof"` -} - -type ConstraintProto_NoOverlap struct { - // The no_overlap constraint prevents a set of intervals from - // overlapping; in scheduling, this is called a disjunctive - // constraint. - NoOverlap *NoOverlapConstraintProto `protobuf:"bytes,20,opt,name=no_overlap,json=noOverlap,proto3,oneof"` -} - -type ConstraintProto_NoOverlap_2D struct { - // The no_overlap_2d constraint prevents a set of boxes from overlapping. - NoOverlap_2D *NoOverlap2DConstraintProto `protobuf:"bytes,21,opt,name=no_overlap_2d,json=noOverlap2d,proto3,oneof"` -} - -type ConstraintProto_Cumulative struct { - // The cumulative constraint ensures that for any integer point, the sum - // of the demands of the intervals containing that point does not exceed - // the capacity. - Cumulative *CumulativeConstraintProto `protobuf:"bytes,22,opt,name=cumulative,proto3,oneof"` -} - -type ConstraintProto_DummyConstraint struct { - // This constraint is not meant to be used and will be rejected by the - // solver. It is meant to mark variable when testing the presolve code. - DummyConstraint *ListOfVariablesProto `protobuf:"bytes,30,opt,name=dummy_constraint,json=dummyConstraint,proto3,oneof"` -} - -func (*ConstraintProto_BoolOr) isConstraintProto_Constraint() {} - -func (*ConstraintProto_BoolAnd) isConstraintProto_Constraint() {} - -func (*ConstraintProto_AtMostOne) isConstraintProto_Constraint() {} - -func (*ConstraintProto_ExactlyOne) isConstraintProto_Constraint() {} - -func (*ConstraintProto_BoolXor) isConstraintProto_Constraint() {} - -func (*ConstraintProto_IntDiv) isConstraintProto_Constraint() {} - -func (*ConstraintProto_IntMod) isConstraintProto_Constraint() {} - -func (*ConstraintProto_IntProd) isConstraintProto_Constraint() {} - -func (*ConstraintProto_LinMax) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Linear) isConstraintProto_Constraint() {} - -func (*ConstraintProto_AllDiff) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Element) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Circuit) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Routes) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Table) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Automaton) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Inverse) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Reservoir) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Interval) isConstraintProto_Constraint() {} - -func (*ConstraintProto_NoOverlap) isConstraintProto_Constraint() {} - -func (*ConstraintProto_NoOverlap_2D) isConstraintProto_Constraint() {} - -func (*ConstraintProto_Cumulative) isConstraintProto_Constraint() {} - -func (*ConstraintProto_DummyConstraint) isConstraintProto_Constraint() {} - -// Optimization objective. -type CpObjectiveProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The linear terms of the objective to minimize. - // For a maximization problem, one can negate all coefficients in the - // objective and set scaling_factor to -1. - Vars []int32 `protobuf:"varint,1,rep,packed,name=vars,proto3" json:"vars,omitempty"` - Coeffs []int64 `protobuf:"varint,4,rep,packed,name=coeffs,proto3" json:"coeffs,omitempty"` - // The displayed objective is always: - // - // scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset). - // - // This is needed to have a consistent objective after presolve or when - // scaling a double problem to express it with integers. - // - // Note that if scaling_factor is zero, then it is assumed to be 1, so that by - // default these fields have no effect. - Offset float64 `protobuf:"fixed64,2,opt,name=offset,proto3" json:"offset,omitempty"` - ScalingFactor float64 `protobuf:"fixed64,3,opt,name=scaling_factor,json=scalingFactor,proto3" json:"scaling_factor,omitempty"` - // If non-empty, only look for an objective value in the given domain. - // Note that this does not depend on the offset or scaling factor, it is a - // domain on the sum of the objective terms only. - Domain []int64 `protobuf:"varint,5,rep,packed,name=domain,proto3" json:"domain,omitempty"` - // Internal field. Do not set. When we scale a FloatObjectiveProto to a - // integer version, we set this to true if the scaling was exact (i.e. all - // original coeff were integer for instance). - // - // TODO(user): Put the error bounds we computed instead? - ScalingWasExact bool `protobuf:"varint,6,opt,name=scaling_was_exact,json=scalingWasExact,proto3" json:"scaling_was_exact,omitempty"` - // Internal fields to recover a bound on the original integer objective from - // the presolved one. Basically, initially the integer objective fit on an - // int64 and is in [Initial_lb, Initial_ub]. During presolve, we might change - // the linear expression to have a new domain [Presolved_lb, Presolved_ub] - // that will also always fit on an int64. - // - // The two domain will always be linked with an affine transformation between - // the two of the form: - // - // old = (new + before_offset) * integer_scaling_factor + after_offset. - // - // Note that we use both offsets to always be able to do the computation while - // staying in the int64 domain. In particular, the after_offset will always - // be in (-integer_scaling_factor, integer_scaling_factor). - IntegerBeforeOffset int64 `protobuf:"varint,7,opt,name=integer_before_offset,json=integerBeforeOffset,proto3" json:"integer_before_offset,omitempty"` - IntegerAfterOffset int64 `protobuf:"varint,9,opt,name=integer_after_offset,json=integerAfterOffset,proto3" json:"integer_after_offset,omitempty"` - IntegerScalingFactor int64 `protobuf:"varint,8,opt,name=integer_scaling_factor,json=integerScalingFactor,proto3" json:"integer_scaling_factor,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CpObjectiveProto) Reset() { - *x = CpObjectiveProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CpObjectiveProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CpObjectiveProto) ProtoMessage() {} - -func (x *CpObjectiveProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CpObjectiveProto.ProtoReflect.Descriptor instead. -func (*CpObjectiveProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{19} -} - -func (x *CpObjectiveProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *CpObjectiveProto) GetCoeffs() []int64 { - if x != nil { - return x.Coeffs - } - return nil -} - -func (x *CpObjectiveProto) GetOffset() float64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *CpObjectiveProto) GetScalingFactor() float64 { - if x != nil { - return x.ScalingFactor - } - return 0 -} - -func (x *CpObjectiveProto) GetDomain() []int64 { - if x != nil { - return x.Domain - } - return nil -} - -func (x *CpObjectiveProto) GetScalingWasExact() bool { - if x != nil { - return x.ScalingWasExact - } - return false -} - -func (x *CpObjectiveProto) GetIntegerBeforeOffset() int64 { - if x != nil { - return x.IntegerBeforeOffset - } - return 0 -} - -func (x *CpObjectiveProto) GetIntegerAfterOffset() int64 { - if x != nil { - return x.IntegerAfterOffset - } - return 0 -} - -func (x *CpObjectiveProto) GetIntegerScalingFactor() int64 { - if x != nil { - return x.IntegerScalingFactor - } - return 0 -} - -// A linear floating point objective: sum coeffs[i] * vars[i] + offset. -// Note that the variable can only still take integer value. -type FloatObjectiveProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - Vars []int32 `protobuf:"varint,1,rep,packed,name=vars,proto3" json:"vars,omitempty"` - Coeffs []float64 `protobuf:"fixed64,2,rep,packed,name=coeffs,proto3" json:"coeffs,omitempty"` - Offset float64 `protobuf:"fixed64,3,opt,name=offset,proto3" json:"offset,omitempty"` - // The optimization direction. The default is to minimize - Maximize bool `protobuf:"varint,4,opt,name=maximize,proto3" json:"maximize,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FloatObjectiveProto) Reset() { - *x = FloatObjectiveProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FloatObjectiveProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FloatObjectiveProto) ProtoMessage() {} - -func (x *FloatObjectiveProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FloatObjectiveProto.ProtoReflect.Descriptor instead. -func (*FloatObjectiveProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{20} -} - -func (x *FloatObjectiveProto) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *FloatObjectiveProto) GetCoeffs() []float64 { - if x != nil { - return x.Coeffs - } - return nil -} - -func (x *FloatObjectiveProto) GetOffset() float64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *FloatObjectiveProto) GetMaximize() bool { - if x != nil { - return x.Maximize - } - return false -} - -// Define the strategy to follow when the solver needs to take a new decision. -// Note that this strategy is only defined on a subset of variables. -type DecisionStrategyProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The variables to be considered for the next decision. The order matter and - // is always used as a tie-breaker after the variable selection strategy - // criteria defined below. - Variables []int32 `protobuf:"varint,1,rep,packed,name=variables,proto3" json:"variables,omitempty"` - // If this is set, then the variables field must be empty. - // We currently only support affine expression. - // - // Note that this is needed so that if a variable has an affine - // representative, we can properly transform a DecisionStrategyProto through - // presolve. - Exprs []*LinearExpressionProto `protobuf:"bytes,5,rep,name=exprs,proto3" json:"exprs,omitempty"` - VariableSelectionStrategy DecisionStrategyProto_VariableSelectionStrategy `protobuf:"varint,2,opt,name=variable_selection_strategy,json=variableSelectionStrategy,proto3,enum=operations_research.sat.DecisionStrategyProto_VariableSelectionStrategy" json:"variable_selection_strategy,omitempty"` - DomainReductionStrategy DecisionStrategyProto_DomainReductionStrategy `protobuf:"varint,3,opt,name=domain_reduction_strategy,json=domainReductionStrategy,proto3,enum=operations_research.sat.DecisionStrategyProto_DomainReductionStrategy" json:"domain_reduction_strategy,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DecisionStrategyProto) Reset() { - *x = DecisionStrategyProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DecisionStrategyProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DecisionStrategyProto) ProtoMessage() {} - -func (x *DecisionStrategyProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DecisionStrategyProto.ProtoReflect.Descriptor instead. -func (*DecisionStrategyProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{21} -} - -func (x *DecisionStrategyProto) GetVariables() []int32 { - if x != nil { - return x.Variables - } - return nil -} - -func (x *DecisionStrategyProto) GetExprs() []*LinearExpressionProto { - if x != nil { - return x.Exprs - } - return nil -} - -func (x *DecisionStrategyProto) GetVariableSelectionStrategy() DecisionStrategyProto_VariableSelectionStrategy { - if x != nil { - return x.VariableSelectionStrategy - } - return DecisionStrategyProto_CHOOSE_FIRST -} - -func (x *DecisionStrategyProto) GetDomainReductionStrategy() DecisionStrategyProto_DomainReductionStrategy { - if x != nil { - return x.DomainReductionStrategy - } - return DecisionStrategyProto_SELECT_MIN_VALUE -} - -// This message encodes a partial (or full) assignment of the variables of a -// CpModelProto. The variable indices should be unique and valid variable -// indices. -type PartialVariableAssignment struct { - state protoimpl.MessageState `protogen:"open.v1"` - Vars []int32 `protobuf:"varint,1,rep,packed,name=vars,proto3" json:"vars,omitempty"` - Values []int64 `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PartialVariableAssignment) Reset() { - *x = PartialVariableAssignment{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PartialVariableAssignment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PartialVariableAssignment) ProtoMessage() {} - -func (x *PartialVariableAssignment) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PartialVariableAssignment.ProtoReflect.Descriptor instead. -func (*PartialVariableAssignment) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{22} -} - -func (x *PartialVariableAssignment) GetVars() []int32 { - if x != nil { - return x.Vars - } - return nil -} - -func (x *PartialVariableAssignment) GetValues() []int64 { - if x != nil { - return x.Values - } - return nil -} - -// A permutation of integers encoded as a list of cycles, hence the "sparse" -// format. The image of an element cycle[i] is cycle[(i + 1) % cycle_length]. -type SparsePermutationProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Each cycle is listed one after the other in the support field. - // The size of each cycle is given (in order) in the cycle_sizes field. - Support []int32 `protobuf:"varint,1,rep,packed,name=support,proto3" json:"support,omitempty"` - CycleSizes []int32 `protobuf:"varint,2,rep,packed,name=cycle_sizes,json=cycleSizes,proto3" json:"cycle_sizes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SparsePermutationProto) Reset() { - *x = SparsePermutationProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SparsePermutationProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SparsePermutationProto) ProtoMessage() {} - -func (x *SparsePermutationProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SparsePermutationProto.ProtoReflect.Descriptor instead. -func (*SparsePermutationProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{23} -} - -func (x *SparsePermutationProto) GetSupport() []int32 { - if x != nil { - return x.Support - } - return nil -} - -func (x *SparsePermutationProto) GetCycleSizes() []int32 { - if x != nil { - return x.CycleSizes - } - return nil -} - -// A dense matrix of numbers encoded in a flat way, row by row. -// That is matrix[i][j] = entries[i * num_cols + j]; -type DenseMatrixProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - NumRows int32 `protobuf:"varint,1,opt,name=num_rows,json=numRows,proto3" json:"num_rows,omitempty"` - NumCols int32 `protobuf:"varint,2,opt,name=num_cols,json=numCols,proto3" json:"num_cols,omitempty"` - Entries []int32 `protobuf:"varint,3,rep,packed,name=entries,proto3" json:"entries,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DenseMatrixProto) Reset() { - *x = DenseMatrixProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DenseMatrixProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DenseMatrixProto) ProtoMessage() {} - -func (x *DenseMatrixProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DenseMatrixProto.ProtoReflect.Descriptor instead. -func (*DenseMatrixProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{24} -} - -func (x *DenseMatrixProto) GetNumRows() int32 { - if x != nil { - return x.NumRows - } - return 0 -} - -func (x *DenseMatrixProto) GetNumCols() int32 { - if x != nil { - return x.NumCols - } - return 0 -} - -func (x *DenseMatrixProto) GetEntries() []int32 { - if x != nil { - return x.Entries - } - return nil -} - -// EXPERIMENTAL. For now, this is meant to be used by the solver and not filled -// by clients. -// -// Hold symmetry information about the set of feasible solutions. If we permute -// the variable values of any feasible solution using one of the permutation -// described here, we should always get another feasible solution. -// -// We usually also enforce that the objective of the new solution is the same. -// -// The group of permutations encoded here is usually computed from the encoding -// of the model, so it is not meant to be a complete representation of the -// feasible solution symmetries, just a valid subgroup. -type SymmetryProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of variable indices permutations that leave the feasible space of - // solution invariant. Usually, we only encode a set of generators of the - // group. - Permutations []*SparsePermutationProto `protobuf:"bytes,1,rep,name=permutations,proto3" json:"permutations,omitempty"` - // An orbitope is a special symmetry structure of the solution space. If the - // variable indices are arranged in a matrix (with no duplicates), then any - // permutation of the columns will be a valid permutation of the feasible - // space. - // - // This arise quite often. The typical example is a graph coloring problem - // where for each node i, you have j booleans to indicate its color. If the - // variables color_of_i_is_j are arranged in a matrix[i][j], then any columns - // permutations leave the problem invariant. - Orbitopes []*DenseMatrixProto `protobuf:"bytes,2,rep,name=orbitopes,proto3" json:"orbitopes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SymmetryProto) Reset() { - *x = SymmetryProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SymmetryProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SymmetryProto) ProtoMessage() {} - -func (x *SymmetryProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[25] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SymmetryProto.ProtoReflect.Descriptor instead. -func (*SymmetryProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{25} -} - -func (x *SymmetryProto) GetPermutations() []*SparsePermutationProto { - if x != nil { - return x.Permutations - } - return nil -} - -func (x *SymmetryProto) GetOrbitopes() []*DenseMatrixProto { - if x != nil { - return x.Orbitopes - } - return nil -} - -// A constraint programming problem. -type CpModelProto struct { - state protoimpl.MessageState `protogen:"open.v1"` - // For debug/logging only. Can be empty. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The associated Protos should be referred by their index in these fields. - Variables []*IntegerVariableProto `protobuf:"bytes,2,rep,name=variables,proto3" json:"variables,omitempty"` - Constraints []*ConstraintProto `protobuf:"bytes,3,rep,name=constraints,proto3" json:"constraints,omitempty"` - // The objective to minimize. Can be empty for pure decision problems. - Objective *CpObjectiveProto `protobuf:"bytes,4,opt,name=objective,proto3" json:"objective,omitempty"` - // Advanced usage. - // It is invalid to have both an objective and a floating point objective. - // - // The objective of the model, in floating point format. The solver will - // automatically scale this to integer during expansion and thus convert it to - // a normal CpObjectiveProto. See the mip* parameters to control how this is - // scaled. In most situation the precision will be good enough, but you can - // see the logs to see what are the precision guaranteed when this is - // converted to a fixed point representation. - // - // Note that even if the precision is bad, the returned objective_value and - // best_objective_bound will be computed correctly. So at the end of the solve - // you can check the gap if you only want precise optimal. - FloatingPointObjective *FloatObjectiveProto `protobuf:"bytes,9,opt,name=floating_point_objective,json=floatingPointObjective,proto3" json:"floating_point_objective,omitempty"` - // Defines the strategy that the solver should follow when the - // search_branching parameter is set to FIXED_SEARCH. Note that this strategy - // is also used as a heuristic when we are not in fixed search. - // - // Advanced Usage: if not all variables appears and the parameter - // "instantiate_all_variables" is set to false, then the solver will not try - // to instantiate the variables that do not appear. Thus, at the end of the - // search, not all variables may be fixed. Currently, we will set them to - // their lower bound in the solution. - SearchStrategy []*DecisionStrategyProto `protobuf:"bytes,5,rep,name=search_strategy,json=searchStrategy,proto3" json:"search_strategy,omitempty"` - // Solution hint. - // - // If a feasible or almost-feasible solution to the problem is already known, - // it may be helpful to pass it to the solver so that it can be used. The - // solver will try to use this information to create its initial feasible - // solution. - // - // Note that it may not always be faster to give a hint like this to the - // solver. There is also no guarantee that the solver will use this hint or - // try to return a solution "close" to this assignment in case of multiple - // optimal solutions. - SolutionHint *PartialVariableAssignment `protobuf:"bytes,6,opt,name=solution_hint,json=solutionHint,proto3" json:"solution_hint,omitempty"` - // A list of literals. The model will be solved assuming all these literals - // are true. Compared to just fixing the domain of these literals, using this - // mechanism is slower but allows in case the model is INFEASIBLE to get a - // potentially small subset of them that can be used to explain the - // infeasibility. - // - // Think (IIS), except when you are only concerned by the provided - // assumptions. This is powerful as it allows to group a set of logically - // related constraint under only one enforcement literal which can potentially - // give you a good and interpretable explanation for infeasiblity. - // - // Such infeasibility explanation will be available in the - // sufficient_assumptions_for_infeasibility response field. - Assumptions []int32 `protobuf:"varint,7,rep,packed,name=assumptions,proto3" json:"assumptions,omitempty"` - // For now, this is not meant to be filled by a client writing a model, but - // by our preprocessing step. - // - // Information about the symmetries of the feasible solution space. - // These usually leaves the objective invariant. - Symmetry *SymmetryProto `protobuf:"bytes,8,opt,name=symmetry,proto3" json:"symmetry,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CpModelProto) Reset() { - *x = CpModelProto{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CpModelProto) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CpModelProto) ProtoMessage() {} - -func (x *CpModelProto) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[26] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CpModelProto.ProtoReflect.Descriptor instead. -func (*CpModelProto) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{26} -} - -func (x *CpModelProto) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CpModelProto) GetVariables() []*IntegerVariableProto { - if x != nil { - return x.Variables - } - return nil -} - -func (x *CpModelProto) GetConstraints() []*ConstraintProto { - if x != nil { - return x.Constraints - } - return nil -} - -func (x *CpModelProto) GetObjective() *CpObjectiveProto { - if x != nil { - return x.Objective - } - return nil -} - -func (x *CpModelProto) GetFloatingPointObjective() *FloatObjectiveProto { - if x != nil { - return x.FloatingPointObjective - } - return nil -} - -func (x *CpModelProto) GetSearchStrategy() []*DecisionStrategyProto { - if x != nil { - return x.SearchStrategy - } - return nil -} - -func (x *CpModelProto) GetSolutionHint() *PartialVariableAssignment { - if x != nil { - return x.SolutionHint - } - return nil -} - -func (x *CpModelProto) GetAssumptions() []int32 { - if x != nil { - return x.Assumptions - } - return nil -} - -func (x *CpModelProto) GetSymmetry() *SymmetryProto { - if x != nil { - return x.Symmetry - } - return nil -} - -// Just a message used to store dense solution. -// This is used by the additional_solutions field. -type CpSolverSolution struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []int64 `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CpSolverSolution) Reset() { - *x = CpSolverSolution{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CpSolverSolution) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CpSolverSolution) ProtoMessage() {} - -func (x *CpSolverSolution) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[27] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CpSolverSolution.ProtoReflect.Descriptor instead. -func (*CpSolverSolution) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{27} -} - -func (x *CpSolverSolution) GetValues() []int64 { - if x != nil { - return x.Values - } - return nil -} - -// The response returned by a solver trying to solve a CpModelProto. -// -// Next id: 32 -type CpSolverResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The status of the solve. - Status CpSolverStatus `protobuf:"varint,1,opt,name=status,proto3,enum=operations_research.sat.CpSolverStatus" json:"status,omitempty"` - // A feasible solution to the given problem. Depending on the returned status - // it may be optimal or just feasible. This is in one-to-one correspondence - // with a CpModelProto::variables repeated field and list the values of all - // the variables. - Solution []int64 `protobuf:"varint,2,rep,packed,name=solution,proto3" json:"solution,omitempty"` - // Only make sense for an optimization problem. The objective value of the - // returned solution if it is non-empty. If there is no solution, then for a - // minimization problem, this will be an upper-bound of the objective of any - // feasible solution, and a lower-bound for a maximization problem. - ObjectiveValue float64 `protobuf:"fixed64,3,opt,name=objective_value,json=objectiveValue,proto3" json:"objective_value,omitempty"` - // Only make sense for an optimization problem. A proven lower-bound on the - // objective for a minimization problem, or a proven upper-bound for a - // maximization problem. - BestObjectiveBound float64 `protobuf:"fixed64,4,opt,name=best_objective_bound,json=bestObjectiveBound,proto3" json:"best_objective_bound,omitempty"` - // If the parameter fill_additional_solutions_in_response is set, then we - // copy all the solutions from our internal solution pool here. - // - // Note that the one returned in the solution field will likely appear here - // too. Do not rely on the solutions order as it depends on our internal - // representation (after postsolve). - AdditionalSolutions []*CpSolverSolution `protobuf:"bytes,27,rep,name=additional_solutions,json=additionalSolutions,proto3" json:"additional_solutions,omitempty"` - // Advanced usage. - // - // If the option fill_tightened_domains_in_response is set, then this field - // will be a copy of the CpModelProto.variables where each domain has been - // reduced using the information the solver was able to derive. Note that this - // is only filled with the info derived during a normal search and we do not - // have any dedicated algorithm to improve it. - // - // Warning: if you didn't set keep_all_feasible_solutions_in_presolve, then - // these domains might exclude valid feasible solution. Otherwise for a - // feasibility problem, all feasible solution should be there. - // - // Warning: For an optimization problem, these will correspond to valid bounds - // for the problem of finding an improving solution to the best one found so - // far. It might be better to solve a feasibility version if one just want to - // explore the feasible region. - TightenedVariables []*IntegerVariableProto `protobuf:"bytes,21,rep,name=tightened_variables,json=tightenedVariables,proto3" json:"tightened_variables,omitempty"` - // A subset of the model "assumptions" field. This will only be filled if the - // status is INFEASIBLE. This subset of assumption will be enough to still get - // an infeasible problem. - // - // This is related to what is called the irreducible inconsistent subsystem or - // IIS. Except one is only concerned by the provided assumptions. There is - // also no guarantee that we return an irreducible (aka minimal subset). - // However, this is based on SAT explanation and there is a good chance it is - // not too large. - // - // If you really want a minimal subset, a possible way to get one is by - // changing your model to minimize the number of assumptions at false, but - // this is likely an harder problem to solve. - // - // Important: Currently, this is minimized only in single-thread and if the - // problem is not an optimization problem, otherwise, it will always include - // all the assumptions. - // - // TODO(user): Allows for returning multiple core at once. - SufficientAssumptionsForInfeasibility []int32 `protobuf:"varint,23,rep,packed,name=sufficient_assumptions_for_infeasibility,json=sufficientAssumptionsForInfeasibility,proto3" json:"sufficient_assumptions_for_infeasibility,omitempty"` - // Contains the integer objective optimized internally. This is only filled if - // the problem had a floating point objective, and on the final response, not - // the ones given to callbacks. - IntegerObjective *CpObjectiveProto `protobuf:"bytes,28,opt,name=integer_objective,json=integerObjective,proto3" json:"integer_objective,omitempty"` - // Advanced usage. - // - // A lower bound on the integer expression of the objective. This is either a - // bound on the expression in the returned integer_objective or on the integer - // expression of the original objective if the problem already has an integer - // objective. - // - // TODO(user): This should be renamed integer_objective_lower_bound. - InnerObjectiveLowerBound int64 `protobuf:"varint,29,opt,name=inner_objective_lower_bound,json=innerObjectiveLowerBound,proto3" json:"inner_objective_lower_bound,omitempty"` - // Some statistics about the solve. - // - // Important: in multithread, this correspond the statistics of the first - // subsolver. Which is usually the one with the user defined parameters. Or - // the default-search if none are specified. - NumIntegers int64 `protobuf:"varint,30,opt,name=num_integers,json=numIntegers,proto3" json:"num_integers,omitempty"` - NumBooleans int64 `protobuf:"varint,10,opt,name=num_booleans,json=numBooleans,proto3" json:"num_booleans,omitempty"` - NumFixedBooleans int64 `protobuf:"varint,31,opt,name=num_fixed_booleans,json=numFixedBooleans,proto3" json:"num_fixed_booleans,omitempty"` - NumConflicts int64 `protobuf:"varint,11,opt,name=num_conflicts,json=numConflicts,proto3" json:"num_conflicts,omitempty"` - NumBranches int64 `protobuf:"varint,12,opt,name=num_branches,json=numBranches,proto3" json:"num_branches,omitempty"` - NumBinaryPropagations int64 `protobuf:"varint,13,opt,name=num_binary_propagations,json=numBinaryPropagations,proto3" json:"num_binary_propagations,omitempty"` - NumIntegerPropagations int64 `protobuf:"varint,14,opt,name=num_integer_propagations,json=numIntegerPropagations,proto3" json:"num_integer_propagations,omitempty"` - NumRestarts int64 `protobuf:"varint,24,opt,name=num_restarts,json=numRestarts,proto3" json:"num_restarts,omitempty"` - NumLpIterations int64 `protobuf:"varint,25,opt,name=num_lp_iterations,json=numLpIterations,proto3" json:"num_lp_iterations,omitempty"` - // The time counted from the beginning of the Solve() call. - WallTime float64 `protobuf:"fixed64,15,opt,name=wall_time,json=wallTime,proto3" json:"wall_time,omitempty"` - UserTime float64 `protobuf:"fixed64,16,opt,name=user_time,json=userTime,proto3" json:"user_time,omitempty"` - DeterministicTime float64 `protobuf:"fixed64,17,opt,name=deterministic_time,json=deterministicTime,proto3" json:"deterministic_time,omitempty"` - // The integral of log(1 + absolute_objective_gap) over time. - GapIntegral float64 `protobuf:"fixed64,22,opt,name=gap_integral,json=gapIntegral,proto3" json:"gap_integral,omitempty"` - // Additional information about how the solution was found. It also stores - // model or parameters errors that caused the model to be invalid. - SolutionInfo string `protobuf:"bytes,20,opt,name=solution_info,json=solutionInfo,proto3" json:"solution_info,omitempty"` - // The solve log will be filled if the parameter log_to_response is set to - // true. - SolveLog string `protobuf:"bytes,26,opt,name=solve_log,json=solveLog,proto3" json:"solve_log,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CpSolverResponse) Reset() { - *x = CpSolverResponse{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CpSolverResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CpSolverResponse) ProtoMessage() {} - -func (x *CpSolverResponse) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[28] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CpSolverResponse.ProtoReflect.Descriptor instead. -func (*CpSolverResponse) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{28} -} - -func (x *CpSolverResponse) GetStatus() CpSolverStatus { - if x != nil { - return x.Status - } - return CpSolverStatus_UNKNOWN -} - -func (x *CpSolverResponse) GetSolution() []int64 { - if x != nil { - return x.Solution - } - return nil -} - -func (x *CpSolverResponse) GetObjectiveValue() float64 { - if x != nil { - return x.ObjectiveValue - } - return 0 -} - -func (x *CpSolverResponse) GetBestObjectiveBound() float64 { - if x != nil { - return x.BestObjectiveBound - } - return 0 -} - -func (x *CpSolverResponse) GetAdditionalSolutions() []*CpSolverSolution { - if x != nil { - return x.AdditionalSolutions - } - return nil -} - -func (x *CpSolverResponse) GetTightenedVariables() []*IntegerVariableProto { - if x != nil { - return x.TightenedVariables - } - return nil -} - -func (x *CpSolverResponse) GetSufficientAssumptionsForInfeasibility() []int32 { - if x != nil { - return x.SufficientAssumptionsForInfeasibility - } - return nil -} - -func (x *CpSolverResponse) GetIntegerObjective() *CpObjectiveProto { - if x != nil { - return x.IntegerObjective - } - return nil -} - -func (x *CpSolverResponse) GetInnerObjectiveLowerBound() int64 { - if x != nil { - return x.InnerObjectiveLowerBound - } - return 0 -} - -func (x *CpSolverResponse) GetNumIntegers() int64 { - if x != nil { - return x.NumIntegers - } - return 0 -} - -func (x *CpSolverResponse) GetNumBooleans() int64 { - if x != nil { - return x.NumBooleans - } - return 0 -} - -func (x *CpSolverResponse) GetNumFixedBooleans() int64 { - if x != nil { - return x.NumFixedBooleans - } - return 0 -} - -func (x *CpSolverResponse) GetNumConflicts() int64 { - if x != nil { - return x.NumConflicts - } - return 0 -} - -func (x *CpSolverResponse) GetNumBranches() int64 { - if x != nil { - return x.NumBranches - } - return 0 -} - -func (x *CpSolverResponse) GetNumBinaryPropagations() int64 { - if x != nil { - return x.NumBinaryPropagations - } - return 0 -} - -func (x *CpSolverResponse) GetNumIntegerPropagations() int64 { - if x != nil { - return x.NumIntegerPropagations - } - return 0 -} - -func (x *CpSolverResponse) GetNumRestarts() int64 { - if x != nil { - return x.NumRestarts - } - return 0 -} - -func (x *CpSolverResponse) GetNumLpIterations() int64 { - if x != nil { - return x.NumLpIterations - } - return 0 -} - -func (x *CpSolverResponse) GetWallTime() float64 { - if x != nil { - return x.WallTime - } - return 0 -} - -func (x *CpSolverResponse) GetUserTime() float64 { - if x != nil { - return x.UserTime - } - return 0 -} - -func (x *CpSolverResponse) GetDeterministicTime() float64 { - if x != nil { - return x.DeterministicTime - } - return 0 -} - -func (x *CpSolverResponse) GetGapIntegral() float64 { - if x != nil { - return x.GapIntegral - } - return 0 -} - -func (x *CpSolverResponse) GetSolutionInfo() string { - if x != nil { - return x.SolutionInfo - } - return "" -} - -func (x *CpSolverResponse) GetSolveLog() string { - if x != nil { - return x.SolveLog - } - return "" -} - -// A set of linear expressions associated with the nodes. -type RoutesConstraintProto_NodeExpressions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The i-th element is the linear expression associated with the i-th node. - Exprs []*LinearExpressionProto `protobuf:"bytes,1,rep,name=exprs,proto3" json:"exprs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RoutesConstraintProto_NodeExpressions) Reset() { - *x = RoutesConstraintProto_NodeExpressions{} - mi := &file_ortools_sat_cp_model_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RoutesConstraintProto_NodeExpressions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoutesConstraintProto_NodeExpressions) ProtoMessage() {} - -func (x *RoutesConstraintProto_NodeExpressions) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_cp_model_proto_msgTypes[29] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RoutesConstraintProto_NodeExpressions.ProtoReflect.Descriptor instead. -func (*RoutesConstraintProto_NodeExpressions) Descriptor() ([]byte, []int) { - return file_ortools_sat_cp_model_proto_rawDescGZIP(), []int{13, 0} -} - -func (x *RoutesConstraintProto_NodeExpressions) GetExprs() []*LinearExpressionProto { - if x != nil { - return x.Exprs - } - return nil -} - -var File_ortools_sat_cp_model_proto protoreflect.FileDescriptor - -const file_ortools_sat_cp_model_proto_rawDesc = "" + - "\n" + - "\x1aortools/sat/cp_model.proto\x12\x17operations_research.sat\"B\n" + - "\x14IntegerVariableProto\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + - "\x06domain\x18\x02 \x03(\x03R\x06domain\"/\n" + - "\x11BoolArgumentProto\x12\x1a\n" + - "\bliterals\x18\x01 \x03(\x05R\bliterals\"[\n" + - "\x15LinearExpressionProto\x12\x12\n" + - "\x04vars\x18\x01 \x03(\x05R\x04vars\x12\x16\n" + - "\x06coeffs\x18\x02 \x03(\x03R\x06coeffs\x12\x16\n" + - "\x06offset\x18\x03 \x01(\x03R\x06offset\"\xa3\x01\n" + - "\x13LinearArgumentProto\x12F\n" + - "\x06target\x18\x01 \x01(\v2..operations_research.sat.LinearExpressionProtoR\x06target\x12D\n" + - "\x05exprs\x18\x02 \x03(\v2..operations_research.sat.LinearExpressionProtoR\x05exprs\"c\n" + - "\x1bAllDifferentConstraintProto\x12D\n" + - "\x05exprs\x18\x01 \x03(\v2..operations_research.sat.LinearExpressionProtoR\x05exprs\"[\n" + - "\x15LinearConstraintProto\x12\x12\n" + - "\x04vars\x18\x01 \x03(\x05R\x04vars\x12\x16\n" + - "\x06coeffs\x18\x02 \x03(\x03R\x06coeffs\x12\x16\n" + - "\x06domain\x18\x03 \x03(\x03R\x06domain\"\xc8\x02\n" + - "\x16ElementConstraintProto\x12\x14\n" + - "\x05index\x18\x01 \x01(\x05R\x05index\x12\x16\n" + - "\x06target\x18\x02 \x01(\x05R\x06target\x12\x12\n" + - "\x04vars\x18\x03 \x03(\x05R\x04vars\x12Q\n" + - "\flinear_index\x18\x04 \x01(\v2..operations_research.sat.LinearExpressionProtoR\vlinearIndex\x12S\n" + - "\rlinear_target\x18\x05 \x01(\v2..operations_research.sat.LinearExpressionProtoR\flinearTarget\x12D\n" + - "\x05exprs\x18\x06 \x03(\v2..operations_research.sat.LinearExpressionProtoR\x05exprs\"\xe5\x01\n" + - "\x17IntervalConstraintProto\x12D\n" + - "\x05start\x18\x04 \x01(\v2..operations_research.sat.LinearExpressionProtoR\x05start\x12@\n" + - "\x03end\x18\x05 \x01(\v2..operations_research.sat.LinearExpressionProtoR\x03end\x12B\n" + - "\x04size\x18\x06 \x01(\v2..operations_research.sat.LinearExpressionProtoR\x04size\"8\n" + - "\x18NoOverlapConstraintProto\x12\x1c\n" + - "\tintervals\x18\x01 \x03(\x05R\tintervals\"^\n" + - "\x1aNoOverlap2DConstraintProto\x12\x1f\n" + - "\vx_intervals\x18\x01 \x03(\x05R\n" + - "xIntervals\x12\x1f\n" + - "\vy_intervals\x18\x02 \x03(\x05R\n" + - "yIntervals\"\xcf\x01\n" + - "\x19CumulativeConstraintProto\x12J\n" + - "\bcapacity\x18\x01 \x01(\v2..operations_research.sat.LinearExpressionProtoR\bcapacity\x12\x1c\n" + - "\tintervals\x18\x02 \x03(\x05R\tintervals\x12H\n" + - "\ademands\x18\x03 \x03(\v2..operations_research.sat.LinearExpressionProtoR\ademands\"\xa7\x02\n" + - "\x18ReservoirConstraintProto\x12\x1b\n" + - "\tmin_level\x18\x01 \x01(\x03R\bminLevel\x12\x1b\n" + - "\tmax_level\x18\x02 \x01(\x03R\bmaxLevel\x12M\n" + - "\n" + - "time_exprs\x18\x03 \x03(\v2..operations_research.sat.LinearExpressionProtoR\ttimeExprs\x12S\n" + - "\rlevel_changes\x18\x06 \x03(\v2..operations_research.sat.LinearExpressionProtoR\flevelChanges\x12'\n" + - "\x0factive_literals\x18\x05 \x03(\x05R\x0eactiveLiteralsJ\x04\b\x04\x10\x05\"`\n" + - "\x16CircuitConstraintProto\x12\x14\n" + - "\x05tails\x18\x03 \x03(\x05R\x05tails\x12\x14\n" + - "\x05heads\x18\x04 \x03(\x05R\x05heads\x12\x1a\n" + - "\bliterals\x18\x05 \x03(\x05R\bliterals\"\xce\x02\n" + - "\x15RoutesConstraintProto\x12\x14\n" + - "\x05tails\x18\x01 \x03(\x05R\x05tails\x12\x14\n" + - "\x05heads\x18\x02 \x03(\x05R\x05heads\x12\x1a\n" + - "\bliterals\x18\x03 \x03(\x05R\bliterals\x12\x18\n" + - "\ademands\x18\x04 \x03(\x05R\ademands\x12\x1a\n" + - "\bcapacity\x18\x05 \x01(\x03R\bcapacity\x12^\n" + - "\n" + - "dimensions\x18\x06 \x03(\v2>.operations_research.sat.RoutesConstraintProto.NodeExpressionsR\n" + - "dimensions\x1aW\n" + - "\x0fNodeExpressions\x12D\n" + - "\x05exprs\x18\x01 \x03(\v2..operations_research.sat.LinearExpressionProtoR\x05exprs\"\xa2\x01\n" + - "\x14TableConstraintProto\x12\x12\n" + - "\x04vars\x18\x01 \x03(\x05R\x04vars\x12\x16\n" + - "\x06values\x18\x02 \x03(\x03R\x06values\x12D\n" + - "\x05exprs\x18\x04 \x03(\v2..operations_research.sat.LinearExpressionProtoR\x05exprs\x12\x18\n" + - "\anegated\x18\x03 \x01(\bR\anegated\"P\n" + - "\x16InverseConstraintProto\x12\x19\n" + - "\bf_direct\x18\x01 \x03(\x05R\afDirect\x12\x1b\n" + - "\tf_inverse\x18\x02 \x03(\x05R\bfInverse\"\xbb\x02\n" + - "\x18AutomatonConstraintProto\x12%\n" + - "\x0estarting_state\x18\x02 \x01(\x03R\rstartingState\x12!\n" + - "\ffinal_states\x18\x03 \x03(\x03R\vfinalStates\x12'\n" + - "\x0ftransition_tail\x18\x04 \x03(\x03R\x0etransitionTail\x12'\n" + - "\x0ftransition_head\x18\x05 \x03(\x03R\x0etransitionHead\x12)\n" + - "\x10transition_label\x18\x06 \x03(\x03R\x0ftransitionLabel\x12\x12\n" + - "\x04vars\x18\a \x03(\x05R\x04vars\x12D\n" + - "\x05exprs\x18\b \x03(\v2..operations_research.sat.LinearExpressionProtoR\x05exprs\"*\n" + - "\x14ListOfVariablesProto\x12\x12\n" + - "\x04vars\x18\x01 \x03(\x05R\x04vars\"\xec\x0e\n" + - "\x0fConstraintProto\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12/\n" + - "\x13enforcement_literal\x18\x02 \x03(\x05R\x12enforcementLiteral\x12E\n" + - "\abool_or\x18\x03 \x01(\v2*.operations_research.sat.BoolArgumentProtoH\x00R\x06boolOr\x12G\n" + - "\bbool_and\x18\x04 \x01(\v2*.operations_research.sat.BoolArgumentProtoH\x00R\aboolAnd\x12L\n" + - "\vat_most_one\x18\x1a \x01(\v2*.operations_research.sat.BoolArgumentProtoH\x00R\tatMostOne\x12M\n" + - "\vexactly_one\x18\x1d \x01(\v2*.operations_research.sat.BoolArgumentProtoH\x00R\n" + - "exactlyOne\x12G\n" + - "\bbool_xor\x18\x05 \x01(\v2*.operations_research.sat.BoolArgumentProtoH\x00R\aboolXor\x12G\n" + - "\aint_div\x18\a \x01(\v2,.operations_research.sat.LinearArgumentProtoH\x00R\x06intDiv\x12G\n" + - "\aint_mod\x18\b \x01(\v2,.operations_research.sat.LinearArgumentProtoH\x00R\x06intMod\x12I\n" + - "\bint_prod\x18\v \x01(\v2,.operations_research.sat.LinearArgumentProtoH\x00R\aintProd\x12G\n" + - "\alin_max\x18\x1b \x01(\v2,.operations_research.sat.LinearArgumentProtoH\x00R\x06linMax\x12H\n" + - "\x06linear\x18\f \x01(\v2..operations_research.sat.LinearConstraintProtoH\x00R\x06linear\x12Q\n" + - "\ball_diff\x18\r \x01(\v24.operations_research.sat.AllDifferentConstraintProtoH\x00R\aallDiff\x12K\n" + - "\aelement\x18\x0e \x01(\v2/.operations_research.sat.ElementConstraintProtoH\x00R\aelement\x12K\n" + - "\acircuit\x18\x0f \x01(\v2/.operations_research.sat.CircuitConstraintProtoH\x00R\acircuit\x12H\n" + - "\x06routes\x18\x17 \x01(\v2..operations_research.sat.RoutesConstraintProtoH\x00R\x06routes\x12E\n" + - "\x05table\x18\x10 \x01(\v2-.operations_research.sat.TableConstraintProtoH\x00R\x05table\x12Q\n" + - "\tautomaton\x18\x11 \x01(\v21.operations_research.sat.AutomatonConstraintProtoH\x00R\tautomaton\x12K\n" + - "\ainverse\x18\x12 \x01(\v2/.operations_research.sat.InverseConstraintProtoH\x00R\ainverse\x12Q\n" + - "\treservoir\x18\x18 \x01(\v21.operations_research.sat.ReservoirConstraintProtoH\x00R\treservoir\x12N\n" + - "\binterval\x18\x13 \x01(\v20.operations_research.sat.IntervalConstraintProtoH\x00R\binterval\x12R\n" + - "\n" + - "no_overlap\x18\x14 \x01(\v21.operations_research.sat.NoOverlapConstraintProtoH\x00R\tnoOverlap\x12Y\n" + - "\rno_overlap_2d\x18\x15 \x01(\v23.operations_research.sat.NoOverlap2DConstraintProtoH\x00R\vnoOverlap2d\x12T\n" + - "\n" + - "cumulative\x18\x16 \x01(\v22.operations_research.sat.CumulativeConstraintProtoH\x00R\n" + - "cumulative\x12Z\n" + - "\x10dummy_constraint\x18\x1e \x01(\v2-.operations_research.sat.ListOfVariablesProtoH\x00R\x0fdummyConstraintB\f\n" + - "\n" + - "constraint\"\xdd\x02\n" + - "\x10CpObjectiveProto\x12\x12\n" + - "\x04vars\x18\x01 \x03(\x05R\x04vars\x12\x16\n" + - "\x06coeffs\x18\x04 \x03(\x03R\x06coeffs\x12\x16\n" + - "\x06offset\x18\x02 \x01(\x01R\x06offset\x12%\n" + - "\x0escaling_factor\x18\x03 \x01(\x01R\rscalingFactor\x12\x16\n" + - "\x06domain\x18\x05 \x03(\x03R\x06domain\x12*\n" + - "\x11scaling_was_exact\x18\x06 \x01(\bR\x0fscalingWasExact\x122\n" + - "\x15integer_before_offset\x18\a \x01(\x03R\x13integerBeforeOffset\x120\n" + - "\x14integer_after_offset\x18\t \x01(\x03R\x12integerAfterOffset\x124\n" + - "\x16integer_scaling_factor\x18\b \x01(\x03R\x14integerScalingFactor\"u\n" + - "\x13FloatObjectiveProto\x12\x12\n" + - "\x04vars\x18\x01 \x03(\x05R\x04vars\x12\x16\n" + - "\x06coeffs\x18\x02 \x03(\x01R\x06coeffs\x12\x16\n" + - "\x06offset\x18\x03 \x01(\x01R\x06offset\x12\x1a\n" + - "\bmaximize\x18\x04 \x01(\bR\bmaximize\"\xc9\x05\n" + - "\x15DecisionStrategyProto\x12\x1c\n" + - "\tvariables\x18\x01 \x03(\x05R\tvariables\x12D\n" + - "\x05exprs\x18\x05 \x03(\v2..operations_research.sat.LinearExpressionProtoR\x05exprs\x12\x88\x01\n" + - "\x1bvariable_selection_strategy\x18\x02 \x01(\x0e2H.operations_research.sat.DecisionStrategyProto.VariableSelectionStrategyR\x19variableSelectionStrategy\x12\x82\x01\n" + - "\x19domain_reduction_strategy\x18\x03 \x01(\x0e2F.operations_research.sat.DecisionStrategyProto.DomainReductionStrategyR\x17domainReductionStrategy\"\x94\x01\n" + - "\x19VariableSelectionStrategy\x12\x10\n" + - "\fCHOOSE_FIRST\x10\x00\x12\x15\n" + - "\x11CHOOSE_LOWEST_MIN\x10\x01\x12\x16\n" + - "\x12CHOOSE_HIGHEST_MAX\x10\x02\x12\x1a\n" + - "\x16CHOOSE_MIN_DOMAIN_SIZE\x10\x03\x12\x1a\n" + - "\x16CHOOSE_MAX_DOMAIN_SIZE\x10\x04\"\xa4\x01\n" + - "\x17DomainReductionStrategy\x12\x14\n" + - "\x10SELECT_MIN_VALUE\x10\x00\x12\x14\n" + - "\x10SELECT_MAX_VALUE\x10\x01\x12\x15\n" + - "\x11SELECT_LOWER_HALF\x10\x02\x12\x15\n" + - "\x11SELECT_UPPER_HALF\x10\x03\x12\x17\n" + - "\x13SELECT_MEDIAN_VALUE\x10\x04\x12\x16\n" + - "\x12SELECT_RANDOM_HALF\x10\x05\"G\n" + - "\x19PartialVariableAssignment\x12\x12\n" + - "\x04vars\x18\x01 \x03(\x05R\x04vars\x12\x16\n" + - "\x06values\x18\x02 \x03(\x03R\x06values\"S\n" + - "\x16SparsePermutationProto\x12\x18\n" + - "\asupport\x18\x01 \x03(\x05R\asupport\x12\x1f\n" + - "\vcycle_sizes\x18\x02 \x03(\x05R\n" + - "cycleSizes\"b\n" + - "\x10DenseMatrixProto\x12\x19\n" + - "\bnum_rows\x18\x01 \x01(\x05R\anumRows\x12\x19\n" + - "\bnum_cols\x18\x02 \x01(\x05R\anumCols\x12\x18\n" + - "\aentries\x18\x03 \x03(\x05R\aentries\"\xad\x01\n" + - "\rSymmetryProto\x12S\n" + - "\fpermutations\x18\x01 \x03(\v2/.operations_research.sat.SparsePermutationProtoR\fpermutations\x12G\n" + - "\torbitopes\x18\x02 \x03(\v2).operations_research.sat.DenseMatrixProtoR\torbitopes\"\x84\x05\n" + - "\fCpModelProto\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12K\n" + - "\tvariables\x18\x02 \x03(\v2-.operations_research.sat.IntegerVariableProtoR\tvariables\x12J\n" + - "\vconstraints\x18\x03 \x03(\v2(.operations_research.sat.ConstraintProtoR\vconstraints\x12G\n" + - "\tobjective\x18\x04 \x01(\v2).operations_research.sat.CpObjectiveProtoR\tobjective\x12f\n" + - "\x18floating_point_objective\x18\t \x01(\v2,.operations_research.sat.FloatObjectiveProtoR\x16floatingPointObjective\x12W\n" + - "\x0fsearch_strategy\x18\x05 \x03(\v2..operations_research.sat.DecisionStrategyProtoR\x0esearchStrategy\x12W\n" + - "\rsolution_hint\x18\x06 \x01(\v22.operations_research.sat.PartialVariableAssignmentR\fsolutionHint\x12 \n" + - "\vassumptions\x18\a \x03(\x05R\vassumptions\x12B\n" + - "\bsymmetry\x18\b \x01(\v2&.operations_research.sat.SymmetryProtoR\bsymmetry\"*\n" + - "\x10CpSolverSolution\x12\x16\n" + - "\x06values\x18\x01 \x03(\x03R\x06values\"\xc3\t\n" + - "\x10CpSolverResponse\x12?\n" + - "\x06status\x18\x01 \x01(\x0e2'.operations_research.sat.CpSolverStatusR\x06status\x12\x1a\n" + - "\bsolution\x18\x02 \x03(\x03R\bsolution\x12'\n" + - "\x0fobjective_value\x18\x03 \x01(\x01R\x0eobjectiveValue\x120\n" + - "\x14best_objective_bound\x18\x04 \x01(\x01R\x12bestObjectiveBound\x12\\\n" + - "\x14additional_solutions\x18\x1b \x03(\v2).operations_research.sat.CpSolverSolutionR\x13additionalSolutions\x12^\n" + - "\x13tightened_variables\x18\x15 \x03(\v2-.operations_research.sat.IntegerVariableProtoR\x12tightenedVariables\x12W\n" + - "(sufficient_assumptions_for_infeasibility\x18\x17 \x03(\x05R%sufficientAssumptionsForInfeasibility\x12V\n" + - "\x11integer_objective\x18\x1c \x01(\v2).operations_research.sat.CpObjectiveProtoR\x10integerObjective\x12=\n" + - "\x1binner_objective_lower_bound\x18\x1d \x01(\x03R\x18innerObjectiveLowerBound\x12!\n" + - "\fnum_integers\x18\x1e \x01(\x03R\vnumIntegers\x12!\n" + - "\fnum_booleans\x18\n" + - " \x01(\x03R\vnumBooleans\x12,\n" + - "\x12num_fixed_booleans\x18\x1f \x01(\x03R\x10numFixedBooleans\x12#\n" + - "\rnum_conflicts\x18\v \x01(\x03R\fnumConflicts\x12!\n" + - "\fnum_branches\x18\f \x01(\x03R\vnumBranches\x126\n" + - "\x17num_binary_propagations\x18\r \x01(\x03R\x15numBinaryPropagations\x128\n" + - "\x18num_integer_propagations\x18\x0e \x01(\x03R\x16numIntegerPropagations\x12!\n" + - "\fnum_restarts\x18\x18 \x01(\x03R\vnumRestarts\x12*\n" + - "\x11num_lp_iterations\x18\x19 \x01(\x03R\x0fnumLpIterations\x12\x1b\n" + - "\twall_time\x18\x0f \x01(\x01R\bwallTime\x12\x1b\n" + - "\tuser_time\x18\x10 \x01(\x01R\buserTime\x12-\n" + - "\x12deterministic_time\x18\x11 \x01(\x01R\x11deterministicTime\x12!\n" + - "\fgap_integral\x18\x16 \x01(\x01R\vgapIntegral\x12#\n" + - "\rsolution_info\x18\x14 \x01(\tR\fsolutionInfo\x12\x1b\n" + - "\tsolve_log\x18\x1a \x01(\tR\bsolveLog*[\n" + - "\x0eCpSolverStatus\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\x11\n" + - "\rMODEL_INVALID\x10\x01\x12\f\n" + - "\bFEASIBLE\x10\x02\x12\x0e\n" + - "\n" + - "INFEASIBLE\x10\x03\x12\v\n" + - "\aOPTIMAL\x10\x04Bv\n" + - "\x16com.google.ortools.satB\x0fCpModelProtobufP\x01Z4github.com/google/or-tools/ortools/sat/proto/cpmodel\xaa\x02\x12Google.OrTools.Satb\x06proto3" - -var ( - file_ortools_sat_cp_model_proto_rawDescOnce sync.Once - file_ortools_sat_cp_model_proto_rawDescData []byte -) - -func file_ortools_sat_cp_model_proto_rawDescGZIP() []byte { - file_ortools_sat_cp_model_proto_rawDescOnce.Do(func() { - file_ortools_sat_cp_model_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ortools_sat_cp_model_proto_rawDesc), len(file_ortools_sat_cp_model_proto_rawDesc))) - }) - return file_ortools_sat_cp_model_proto_rawDescData -} - -var file_ortools_sat_cp_model_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_ortools_sat_cp_model_proto_msgTypes = make([]protoimpl.MessageInfo, 30) -var file_ortools_sat_cp_model_proto_goTypes = []any{ - (CpSolverStatus)(0), // 0: operations_research.sat.CpSolverStatus - (DecisionStrategyProto_VariableSelectionStrategy)(0), // 1: operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy - (DecisionStrategyProto_DomainReductionStrategy)(0), // 2: operations_research.sat.DecisionStrategyProto.DomainReductionStrategy - (*IntegerVariableProto)(nil), // 3: operations_research.sat.IntegerVariableProto - (*BoolArgumentProto)(nil), // 4: operations_research.sat.BoolArgumentProto - (*LinearExpressionProto)(nil), // 5: operations_research.sat.LinearExpressionProto - (*LinearArgumentProto)(nil), // 6: operations_research.sat.LinearArgumentProto - (*AllDifferentConstraintProto)(nil), // 7: operations_research.sat.AllDifferentConstraintProto - (*LinearConstraintProto)(nil), // 8: operations_research.sat.LinearConstraintProto - (*ElementConstraintProto)(nil), // 9: operations_research.sat.ElementConstraintProto - (*IntervalConstraintProto)(nil), // 10: operations_research.sat.IntervalConstraintProto - (*NoOverlapConstraintProto)(nil), // 11: operations_research.sat.NoOverlapConstraintProto - (*NoOverlap2DConstraintProto)(nil), // 12: operations_research.sat.NoOverlap2DConstraintProto - (*CumulativeConstraintProto)(nil), // 13: operations_research.sat.CumulativeConstraintProto - (*ReservoirConstraintProto)(nil), // 14: operations_research.sat.ReservoirConstraintProto - (*CircuitConstraintProto)(nil), // 15: operations_research.sat.CircuitConstraintProto - (*RoutesConstraintProto)(nil), // 16: operations_research.sat.RoutesConstraintProto - (*TableConstraintProto)(nil), // 17: operations_research.sat.TableConstraintProto - (*InverseConstraintProto)(nil), // 18: operations_research.sat.InverseConstraintProto - (*AutomatonConstraintProto)(nil), // 19: operations_research.sat.AutomatonConstraintProto - (*ListOfVariablesProto)(nil), // 20: operations_research.sat.ListOfVariablesProto - (*ConstraintProto)(nil), // 21: operations_research.sat.ConstraintProto - (*CpObjectiveProto)(nil), // 22: operations_research.sat.CpObjectiveProto - (*FloatObjectiveProto)(nil), // 23: operations_research.sat.FloatObjectiveProto - (*DecisionStrategyProto)(nil), // 24: operations_research.sat.DecisionStrategyProto - (*PartialVariableAssignment)(nil), // 25: operations_research.sat.PartialVariableAssignment - (*SparsePermutationProto)(nil), // 26: operations_research.sat.SparsePermutationProto - (*DenseMatrixProto)(nil), // 27: operations_research.sat.DenseMatrixProto - (*SymmetryProto)(nil), // 28: operations_research.sat.SymmetryProto - (*CpModelProto)(nil), // 29: operations_research.sat.CpModelProto - (*CpSolverSolution)(nil), // 30: operations_research.sat.CpSolverSolution - (*CpSolverResponse)(nil), // 31: operations_research.sat.CpSolverResponse - (*RoutesConstraintProto_NodeExpressions)(nil), // 32: operations_research.sat.RoutesConstraintProto.NodeExpressions -} -var file_ortools_sat_cp_model_proto_depIdxs = []int32{ - 5, // 0: operations_research.sat.LinearArgumentProto.target:type_name -> operations_research.sat.LinearExpressionProto - 5, // 1: operations_research.sat.LinearArgumentProto.exprs:type_name -> operations_research.sat.LinearExpressionProto - 5, // 2: operations_research.sat.AllDifferentConstraintProto.exprs:type_name -> operations_research.sat.LinearExpressionProto - 5, // 3: operations_research.sat.ElementConstraintProto.linear_index:type_name -> operations_research.sat.LinearExpressionProto - 5, // 4: operations_research.sat.ElementConstraintProto.linear_target:type_name -> operations_research.sat.LinearExpressionProto - 5, // 5: operations_research.sat.ElementConstraintProto.exprs:type_name -> operations_research.sat.LinearExpressionProto - 5, // 6: operations_research.sat.IntervalConstraintProto.start:type_name -> operations_research.sat.LinearExpressionProto - 5, // 7: operations_research.sat.IntervalConstraintProto.end:type_name -> operations_research.sat.LinearExpressionProto - 5, // 8: operations_research.sat.IntervalConstraintProto.size:type_name -> operations_research.sat.LinearExpressionProto - 5, // 9: operations_research.sat.CumulativeConstraintProto.capacity:type_name -> operations_research.sat.LinearExpressionProto - 5, // 10: operations_research.sat.CumulativeConstraintProto.demands:type_name -> operations_research.sat.LinearExpressionProto - 5, // 11: operations_research.sat.ReservoirConstraintProto.time_exprs:type_name -> operations_research.sat.LinearExpressionProto - 5, // 12: operations_research.sat.ReservoirConstraintProto.level_changes:type_name -> operations_research.sat.LinearExpressionProto - 32, // 13: operations_research.sat.RoutesConstraintProto.dimensions:type_name -> operations_research.sat.RoutesConstraintProto.NodeExpressions - 5, // 14: operations_research.sat.TableConstraintProto.exprs:type_name -> operations_research.sat.LinearExpressionProto - 5, // 15: operations_research.sat.AutomatonConstraintProto.exprs:type_name -> operations_research.sat.LinearExpressionProto - 4, // 16: operations_research.sat.ConstraintProto.bool_or:type_name -> operations_research.sat.BoolArgumentProto - 4, // 17: operations_research.sat.ConstraintProto.bool_and:type_name -> operations_research.sat.BoolArgumentProto - 4, // 18: operations_research.sat.ConstraintProto.at_most_one:type_name -> operations_research.sat.BoolArgumentProto - 4, // 19: operations_research.sat.ConstraintProto.exactly_one:type_name -> operations_research.sat.BoolArgumentProto - 4, // 20: operations_research.sat.ConstraintProto.bool_xor:type_name -> operations_research.sat.BoolArgumentProto - 6, // 21: operations_research.sat.ConstraintProto.int_div:type_name -> operations_research.sat.LinearArgumentProto - 6, // 22: operations_research.sat.ConstraintProto.int_mod:type_name -> operations_research.sat.LinearArgumentProto - 6, // 23: operations_research.sat.ConstraintProto.int_prod:type_name -> operations_research.sat.LinearArgumentProto - 6, // 24: operations_research.sat.ConstraintProto.lin_max:type_name -> operations_research.sat.LinearArgumentProto - 8, // 25: operations_research.sat.ConstraintProto.linear:type_name -> operations_research.sat.LinearConstraintProto - 7, // 26: operations_research.sat.ConstraintProto.all_diff:type_name -> operations_research.sat.AllDifferentConstraintProto - 9, // 27: operations_research.sat.ConstraintProto.element:type_name -> operations_research.sat.ElementConstraintProto - 15, // 28: operations_research.sat.ConstraintProto.circuit:type_name -> operations_research.sat.CircuitConstraintProto - 16, // 29: operations_research.sat.ConstraintProto.routes:type_name -> operations_research.sat.RoutesConstraintProto - 17, // 30: operations_research.sat.ConstraintProto.table:type_name -> operations_research.sat.TableConstraintProto - 19, // 31: operations_research.sat.ConstraintProto.automaton:type_name -> operations_research.sat.AutomatonConstraintProto - 18, // 32: operations_research.sat.ConstraintProto.inverse:type_name -> operations_research.sat.InverseConstraintProto - 14, // 33: operations_research.sat.ConstraintProto.reservoir:type_name -> operations_research.sat.ReservoirConstraintProto - 10, // 34: operations_research.sat.ConstraintProto.interval:type_name -> operations_research.sat.IntervalConstraintProto - 11, // 35: operations_research.sat.ConstraintProto.no_overlap:type_name -> operations_research.sat.NoOverlapConstraintProto - 12, // 36: operations_research.sat.ConstraintProto.no_overlap_2d:type_name -> operations_research.sat.NoOverlap2DConstraintProto - 13, // 37: operations_research.sat.ConstraintProto.cumulative:type_name -> operations_research.sat.CumulativeConstraintProto - 20, // 38: operations_research.sat.ConstraintProto.dummy_constraint:type_name -> operations_research.sat.ListOfVariablesProto - 5, // 39: operations_research.sat.DecisionStrategyProto.exprs:type_name -> operations_research.sat.LinearExpressionProto - 1, // 40: operations_research.sat.DecisionStrategyProto.variable_selection_strategy:type_name -> operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy - 2, // 41: operations_research.sat.DecisionStrategyProto.domain_reduction_strategy:type_name -> operations_research.sat.DecisionStrategyProto.DomainReductionStrategy - 26, // 42: operations_research.sat.SymmetryProto.permutations:type_name -> operations_research.sat.SparsePermutationProto - 27, // 43: operations_research.sat.SymmetryProto.orbitopes:type_name -> operations_research.sat.DenseMatrixProto - 3, // 44: operations_research.sat.CpModelProto.variables:type_name -> operations_research.sat.IntegerVariableProto - 21, // 45: operations_research.sat.CpModelProto.constraints:type_name -> operations_research.sat.ConstraintProto - 22, // 46: operations_research.sat.CpModelProto.objective:type_name -> operations_research.sat.CpObjectiveProto - 23, // 47: operations_research.sat.CpModelProto.floating_point_objective:type_name -> operations_research.sat.FloatObjectiveProto - 24, // 48: operations_research.sat.CpModelProto.search_strategy:type_name -> operations_research.sat.DecisionStrategyProto - 25, // 49: operations_research.sat.CpModelProto.solution_hint:type_name -> operations_research.sat.PartialVariableAssignment - 28, // 50: operations_research.sat.CpModelProto.symmetry:type_name -> operations_research.sat.SymmetryProto - 0, // 51: operations_research.sat.CpSolverResponse.status:type_name -> operations_research.sat.CpSolverStatus - 30, // 52: operations_research.sat.CpSolverResponse.additional_solutions:type_name -> operations_research.sat.CpSolverSolution - 3, // 53: operations_research.sat.CpSolverResponse.tightened_variables:type_name -> operations_research.sat.IntegerVariableProto - 22, // 54: operations_research.sat.CpSolverResponse.integer_objective:type_name -> operations_research.sat.CpObjectiveProto - 5, // 55: operations_research.sat.RoutesConstraintProto.NodeExpressions.exprs:type_name -> operations_research.sat.LinearExpressionProto - 56, // [56:56] is the sub-list for method output_type - 56, // [56:56] is the sub-list for method input_type - 56, // [56:56] is the sub-list for extension type_name - 56, // [56:56] is the sub-list for extension extendee - 0, // [0:56] is the sub-list for field type_name -} - -func init() { file_ortools_sat_cp_model_proto_init() } -func file_ortools_sat_cp_model_proto_init() { - if File_ortools_sat_cp_model_proto != nil { - return - } - file_ortools_sat_cp_model_proto_msgTypes[18].OneofWrappers = []any{ - (*ConstraintProto_BoolOr)(nil), - (*ConstraintProto_BoolAnd)(nil), - (*ConstraintProto_AtMostOne)(nil), - (*ConstraintProto_ExactlyOne)(nil), - (*ConstraintProto_BoolXor)(nil), - (*ConstraintProto_IntDiv)(nil), - (*ConstraintProto_IntMod)(nil), - (*ConstraintProto_IntProd)(nil), - (*ConstraintProto_LinMax)(nil), - (*ConstraintProto_Linear)(nil), - (*ConstraintProto_AllDiff)(nil), - (*ConstraintProto_Element)(nil), - (*ConstraintProto_Circuit)(nil), - (*ConstraintProto_Routes)(nil), - (*ConstraintProto_Table)(nil), - (*ConstraintProto_Automaton)(nil), - (*ConstraintProto_Inverse)(nil), - (*ConstraintProto_Reservoir)(nil), - (*ConstraintProto_Interval)(nil), - (*ConstraintProto_NoOverlap)(nil), - (*ConstraintProto_NoOverlap_2D)(nil), - (*ConstraintProto_Cumulative)(nil), - (*ConstraintProto_DummyConstraint)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_ortools_sat_cp_model_proto_rawDesc), len(file_ortools_sat_cp_model_proto_rawDesc)), - NumEnums: 3, - NumMessages: 30, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ortools_sat_cp_model_proto_goTypes, - DependencyIndexes: file_ortools_sat_cp_model_proto_depIdxs, - EnumInfos: file_ortools_sat_cp_model_proto_enumTypes, - MessageInfos: file_ortools_sat_cp_model_proto_msgTypes, - }.Build() - File_ortools_sat_cp_model_proto = out.File - file_ortools_sat_cp_model_proto_goTypes = nil - file_ortools_sat_cp_model_proto_depIdxs = nil -} diff --git a/gen/go/ortools/sat/sat_parameters.pb.go b/gen/go/ortools/sat/sat_parameters.pb.go deleted file mode 100644 index 01a8f3a..0000000 --- a/gen/go/ortools/sat/sat_parameters.pb.go +++ /dev/null @@ -1,5057 +0,0 @@ -// Copyright 2010-2025 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. - -// LINT: LEGACY_NAMES - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.12 -// protoc v6.33.5 -// source: ortools/sat/sat_parameters.proto - -package sat - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - math "math" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Variables without activity (i.e. at the beginning of the search) will be -// tried in this preferred order. -type SatParameters_VariableOrder int32 - -const ( - SatParameters_IN_ORDER SatParameters_VariableOrder = 0 // As specified by the problem. - SatParameters_IN_REVERSE_ORDER SatParameters_VariableOrder = 1 - SatParameters_IN_RANDOM_ORDER SatParameters_VariableOrder = 2 -) - -// Enum value maps for SatParameters_VariableOrder. -var ( - SatParameters_VariableOrder_name = map[int32]string{ - 0: "IN_ORDER", - 1: "IN_REVERSE_ORDER", - 2: "IN_RANDOM_ORDER", - } - SatParameters_VariableOrder_value = map[string]int32{ - "IN_ORDER": 0, - "IN_REVERSE_ORDER": 1, - "IN_RANDOM_ORDER": 2, - } -) - -func (x SatParameters_VariableOrder) Enum() *SatParameters_VariableOrder { - p := new(SatParameters_VariableOrder) - *p = x - return p -} - -func (x SatParameters_VariableOrder) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_VariableOrder) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[0].Descriptor() -} - -func (SatParameters_VariableOrder) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[0] -} - -func (x SatParameters_VariableOrder) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_VariableOrder) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_VariableOrder(num) - return nil -} - -// Deprecated: Use SatParameters_VariableOrder.Descriptor instead. -func (SatParameters_VariableOrder) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 0} -} - -// Specifies the initial polarity (true/false) when the solver branches on a -// variable. This can be modified later by the user, or the phase saving -// heuristic. -// -// Note(user): POLARITY_FALSE is usually a good choice because of the -// "natural" way to express a linear boolean problem. -type SatParameters_Polarity int32 - -const ( - SatParameters_POLARITY_TRUE SatParameters_Polarity = 0 - SatParameters_POLARITY_FALSE SatParameters_Polarity = 1 - SatParameters_POLARITY_RANDOM SatParameters_Polarity = 2 -) - -// Enum value maps for SatParameters_Polarity. -var ( - SatParameters_Polarity_name = map[int32]string{ - 0: "POLARITY_TRUE", - 1: "POLARITY_FALSE", - 2: "POLARITY_RANDOM", - } - SatParameters_Polarity_value = map[string]int32{ - "POLARITY_TRUE": 0, - "POLARITY_FALSE": 1, - "POLARITY_RANDOM": 2, - } -) - -func (x SatParameters_Polarity) Enum() *SatParameters_Polarity { - p := new(SatParameters_Polarity) - *p = x - return p -} - -func (x SatParameters_Polarity) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_Polarity) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[1].Descriptor() -} - -func (SatParameters_Polarity) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[1] -} - -func (x SatParameters_Polarity) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_Polarity) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_Polarity(num) - return nil -} - -// Deprecated: Use SatParameters_Polarity.Descriptor instead. -func (SatParameters_Polarity) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 1} -} - -// Do we try to minimize conflicts (greedily) when creating them. -type SatParameters_ConflictMinimizationAlgorithm int32 - -const ( - SatParameters_NONE SatParameters_ConflictMinimizationAlgorithm = 0 - SatParameters_SIMPLE SatParameters_ConflictMinimizationAlgorithm = 1 - SatParameters_RECURSIVE SatParameters_ConflictMinimizationAlgorithm = 2 -) - -// Enum value maps for SatParameters_ConflictMinimizationAlgorithm. -var ( - SatParameters_ConflictMinimizationAlgorithm_name = map[int32]string{ - 0: "NONE", - 1: "SIMPLE", - 2: "RECURSIVE", - } - SatParameters_ConflictMinimizationAlgorithm_value = map[string]int32{ - "NONE": 0, - "SIMPLE": 1, - "RECURSIVE": 2, - } -) - -func (x SatParameters_ConflictMinimizationAlgorithm) Enum() *SatParameters_ConflictMinimizationAlgorithm { - p := new(SatParameters_ConflictMinimizationAlgorithm) - *p = x - return p -} - -func (x SatParameters_ConflictMinimizationAlgorithm) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_ConflictMinimizationAlgorithm) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[2].Descriptor() -} - -func (SatParameters_ConflictMinimizationAlgorithm) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[2] -} - -func (x SatParameters_ConflictMinimizationAlgorithm) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_ConflictMinimizationAlgorithm) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_ConflictMinimizationAlgorithm(num) - return nil -} - -// Deprecated: Use SatParameters_ConflictMinimizationAlgorithm.Descriptor instead. -func (SatParameters_ConflictMinimizationAlgorithm) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 2} -} - -// Whether to expoit the binary clause to minimize learned clauses further. -type SatParameters_BinaryMinizationAlgorithm int32 - -const ( - SatParameters_NO_BINARY_MINIMIZATION SatParameters_BinaryMinizationAlgorithm = 0 - SatParameters_BINARY_MINIMIZATION_FROM_UIP SatParameters_BinaryMinizationAlgorithm = 1 - SatParameters_BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONS SatParameters_BinaryMinizationAlgorithm = 5 -) - -// Enum value maps for SatParameters_BinaryMinizationAlgorithm. -var ( - SatParameters_BinaryMinizationAlgorithm_name = map[int32]string{ - 0: "NO_BINARY_MINIMIZATION", - 1: "BINARY_MINIMIZATION_FROM_UIP", - 5: "BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONS", - } - SatParameters_BinaryMinizationAlgorithm_value = map[string]int32{ - "NO_BINARY_MINIMIZATION": 0, - "BINARY_MINIMIZATION_FROM_UIP": 1, - "BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONS": 5, - } -) - -func (x SatParameters_BinaryMinizationAlgorithm) Enum() *SatParameters_BinaryMinizationAlgorithm { - p := new(SatParameters_BinaryMinizationAlgorithm) - *p = x - return p -} - -func (x SatParameters_BinaryMinizationAlgorithm) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_BinaryMinizationAlgorithm) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[3].Descriptor() -} - -func (SatParameters_BinaryMinizationAlgorithm) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[3] -} - -func (x SatParameters_BinaryMinizationAlgorithm) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_BinaryMinizationAlgorithm) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_BinaryMinizationAlgorithm(num) - return nil -} - -// Deprecated: Use SatParameters_BinaryMinizationAlgorithm.Descriptor instead. -func (SatParameters_BinaryMinizationAlgorithm) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 3} -} - -// The clauses that will be kept during a cleanup are the ones that come -// first under this order. We always keep or exclude ties together. -type SatParameters_ClauseOrdering int32 - -const ( - // Order clause by decreasing activity, then by increasing LBD. - SatParameters_CLAUSE_ACTIVITY SatParameters_ClauseOrdering = 0 - // Order clause by increasing LBD, then by decreasing activity. - SatParameters_CLAUSE_LBD SatParameters_ClauseOrdering = 1 -) - -// Enum value maps for SatParameters_ClauseOrdering. -var ( - SatParameters_ClauseOrdering_name = map[int32]string{ - 0: "CLAUSE_ACTIVITY", - 1: "CLAUSE_LBD", - } - SatParameters_ClauseOrdering_value = map[string]int32{ - "CLAUSE_ACTIVITY": 0, - "CLAUSE_LBD": 1, - } -) - -func (x SatParameters_ClauseOrdering) Enum() *SatParameters_ClauseOrdering { - p := new(SatParameters_ClauseOrdering) - *p = x - return p -} - -func (x SatParameters_ClauseOrdering) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_ClauseOrdering) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[4].Descriptor() -} - -func (SatParameters_ClauseOrdering) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[4] -} - -func (x SatParameters_ClauseOrdering) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_ClauseOrdering) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_ClauseOrdering(num) - return nil -} - -// Deprecated: Use SatParameters_ClauseOrdering.Descriptor instead. -func (SatParameters_ClauseOrdering) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 4} -} - -// Restart algorithms. -// -// A reference for the more advanced ones is: -// Gilles Audemard, Laurent Simon, "Refining Restarts Strategies for SAT -// and UNSAT", Principles and Practice of Constraint Programming Lecture -// Notes in Computer Science 2012, pp 118-126 -type SatParameters_RestartAlgorithm int32 - -const ( - SatParameters_NO_RESTART SatParameters_RestartAlgorithm = 0 - // Just follow a Luby sequence times restart_period. - SatParameters_LUBY_RESTART SatParameters_RestartAlgorithm = 1 - // Moving average restart based on the decision level of conflicts. - SatParameters_DL_MOVING_AVERAGE_RESTART SatParameters_RestartAlgorithm = 2 - // Moving average restart based on the LBD of conflicts. - SatParameters_LBD_MOVING_AVERAGE_RESTART SatParameters_RestartAlgorithm = 3 - // Fixed period restart every restart period. - SatParameters_FIXED_RESTART SatParameters_RestartAlgorithm = 4 -) - -// Enum value maps for SatParameters_RestartAlgorithm. -var ( - SatParameters_RestartAlgorithm_name = map[int32]string{ - 0: "NO_RESTART", - 1: "LUBY_RESTART", - 2: "DL_MOVING_AVERAGE_RESTART", - 3: "LBD_MOVING_AVERAGE_RESTART", - 4: "FIXED_RESTART", - } - SatParameters_RestartAlgorithm_value = map[string]int32{ - "NO_RESTART": 0, - "LUBY_RESTART": 1, - "DL_MOVING_AVERAGE_RESTART": 2, - "LBD_MOVING_AVERAGE_RESTART": 3, - "FIXED_RESTART": 4, - } -) - -func (x SatParameters_RestartAlgorithm) Enum() *SatParameters_RestartAlgorithm { - p := new(SatParameters_RestartAlgorithm) - *p = x - return p -} - -func (x SatParameters_RestartAlgorithm) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_RestartAlgorithm) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[5].Descriptor() -} - -func (SatParameters_RestartAlgorithm) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[5] -} - -func (x SatParameters_RestartAlgorithm) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_RestartAlgorithm) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_RestartAlgorithm(num) - return nil -} - -// Deprecated: Use SatParameters_RestartAlgorithm.Descriptor instead. -func (SatParameters_RestartAlgorithm) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 5} -} - -// In what order do we add the assumptions in a core-based max-sat algorithm -type SatParameters_MaxSatAssumptionOrder int32 - -const ( - SatParameters_DEFAULT_ASSUMPTION_ORDER SatParameters_MaxSatAssumptionOrder = 0 - SatParameters_ORDER_ASSUMPTION_BY_DEPTH SatParameters_MaxSatAssumptionOrder = 1 - SatParameters_ORDER_ASSUMPTION_BY_WEIGHT SatParameters_MaxSatAssumptionOrder = 2 -) - -// Enum value maps for SatParameters_MaxSatAssumptionOrder. -var ( - SatParameters_MaxSatAssumptionOrder_name = map[int32]string{ - 0: "DEFAULT_ASSUMPTION_ORDER", - 1: "ORDER_ASSUMPTION_BY_DEPTH", - 2: "ORDER_ASSUMPTION_BY_WEIGHT", - } - SatParameters_MaxSatAssumptionOrder_value = map[string]int32{ - "DEFAULT_ASSUMPTION_ORDER": 0, - "ORDER_ASSUMPTION_BY_DEPTH": 1, - "ORDER_ASSUMPTION_BY_WEIGHT": 2, - } -) - -func (x SatParameters_MaxSatAssumptionOrder) Enum() *SatParameters_MaxSatAssumptionOrder { - p := new(SatParameters_MaxSatAssumptionOrder) - *p = x - return p -} - -func (x SatParameters_MaxSatAssumptionOrder) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_MaxSatAssumptionOrder) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[6].Descriptor() -} - -func (SatParameters_MaxSatAssumptionOrder) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[6] -} - -func (x SatParameters_MaxSatAssumptionOrder) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_MaxSatAssumptionOrder) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_MaxSatAssumptionOrder(num) - return nil -} - -// Deprecated: Use SatParameters_MaxSatAssumptionOrder.Descriptor instead. -func (SatParameters_MaxSatAssumptionOrder) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 6} -} - -// What stratification algorithm we use in the presence of weight. -type SatParameters_MaxSatStratificationAlgorithm int32 - -const ( - // No stratification of the problem. - SatParameters_STRATIFICATION_NONE SatParameters_MaxSatStratificationAlgorithm = 0 - // Start with literals with the highest weight, and when SAT, add the - // literals with the next highest weight and so on. - SatParameters_STRATIFICATION_DESCENT SatParameters_MaxSatStratificationAlgorithm = 1 - // Start with all literals. Each time a core is found with a given minimum - // weight, do not consider literals with a lower weight for the next core - // computation. If the subproblem is SAT, do like in STRATIFICATION_DESCENT - // and just add the literals with the next highest weight. - SatParameters_STRATIFICATION_ASCENT SatParameters_MaxSatStratificationAlgorithm = 2 -) - -// Enum value maps for SatParameters_MaxSatStratificationAlgorithm. -var ( - SatParameters_MaxSatStratificationAlgorithm_name = map[int32]string{ - 0: "STRATIFICATION_NONE", - 1: "STRATIFICATION_DESCENT", - 2: "STRATIFICATION_ASCENT", - } - SatParameters_MaxSatStratificationAlgorithm_value = map[string]int32{ - "STRATIFICATION_NONE": 0, - "STRATIFICATION_DESCENT": 1, - "STRATIFICATION_ASCENT": 2, - } -) - -func (x SatParameters_MaxSatStratificationAlgorithm) Enum() *SatParameters_MaxSatStratificationAlgorithm { - p := new(SatParameters_MaxSatStratificationAlgorithm) - *p = x - return p -} - -func (x SatParameters_MaxSatStratificationAlgorithm) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_MaxSatStratificationAlgorithm) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[7].Descriptor() -} - -func (SatParameters_MaxSatStratificationAlgorithm) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[7] -} - -func (x SatParameters_MaxSatStratificationAlgorithm) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_MaxSatStratificationAlgorithm) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_MaxSatStratificationAlgorithm(num) - return nil -} - -// Deprecated: Use SatParameters_MaxSatStratificationAlgorithm.Descriptor instead. -func (SatParameters_MaxSatStratificationAlgorithm) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 7} -} - -// The search branching will be used to decide how to branch on unfixed nodes. -type SatParameters_SearchBranching int32 - -const ( - // Try to fix all literals using the underlying SAT solver's heuristics, - // then generate and fix literals until integer variables are fixed. New - // literals on integer variables are generated using the fixed search - // specified by the user or our default one. - SatParameters_AUTOMATIC_SEARCH SatParameters_SearchBranching = 0 - // If used then all decisions taken by the solver are made using a fixed - // order as specified in the API or in the CpModelProto search_strategy - // field. - SatParameters_FIXED_SEARCH SatParameters_SearchBranching = 1 - // Simple portfolio search used by LNS workers. - SatParameters_PORTFOLIO_SEARCH SatParameters_SearchBranching = 2 - // If used, the solver will use heuristics from the LP relaxation. This - // exploit the reduced costs of the variables in the relaxation. - SatParameters_LP_SEARCH SatParameters_SearchBranching = 3 - // If used, the solver uses the pseudo costs for branching. Pseudo costs - // are computed using the historical change in objective bounds when some - // decision are taken. Note that this works whether we use an LP or not. - SatParameters_PSEUDO_COST_SEARCH SatParameters_SearchBranching = 4 - // Mainly exposed here for testing. This quickly tries a lot of randomized - // heuristics with a low conflict limit. It usually provides a good first - // solution. - SatParameters_PORTFOLIO_WITH_QUICK_RESTART_SEARCH SatParameters_SearchBranching = 5 - // Mainly used internally. This is like FIXED_SEARCH, except we follow the - // solution_hint field of the CpModelProto rather than using the information - // provided in the search_strategy. - SatParameters_HINT_SEARCH SatParameters_SearchBranching = 6 - // Similar to FIXED_SEARCH, but differ in how the variable not listed into - // the fixed search heuristics are branched on. This will always start the - // search tree according to the specified fixed search strategy, but will - // complete it using the default automatic search. - SatParameters_PARTIAL_FIXED_SEARCH SatParameters_SearchBranching = 7 - // Randomized search. Used to increase entropy in the search. - SatParameters_RANDOMIZED_SEARCH SatParameters_SearchBranching = 8 -) - -// Enum value maps for SatParameters_SearchBranching. -var ( - SatParameters_SearchBranching_name = map[int32]string{ - 0: "AUTOMATIC_SEARCH", - 1: "FIXED_SEARCH", - 2: "PORTFOLIO_SEARCH", - 3: "LP_SEARCH", - 4: "PSEUDO_COST_SEARCH", - 5: "PORTFOLIO_WITH_QUICK_RESTART_SEARCH", - 6: "HINT_SEARCH", - 7: "PARTIAL_FIXED_SEARCH", - 8: "RANDOMIZED_SEARCH", - } - SatParameters_SearchBranching_value = map[string]int32{ - "AUTOMATIC_SEARCH": 0, - "FIXED_SEARCH": 1, - "PORTFOLIO_SEARCH": 2, - "LP_SEARCH": 3, - "PSEUDO_COST_SEARCH": 4, - "PORTFOLIO_WITH_QUICK_RESTART_SEARCH": 5, - "HINT_SEARCH": 6, - "PARTIAL_FIXED_SEARCH": 7, - "RANDOMIZED_SEARCH": 8, - } -) - -func (x SatParameters_SearchBranching) Enum() *SatParameters_SearchBranching { - p := new(SatParameters_SearchBranching) - *p = x - return p -} - -func (x SatParameters_SearchBranching) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_SearchBranching) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[8].Descriptor() -} - -func (SatParameters_SearchBranching) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[8] -} - -func (x SatParameters_SearchBranching) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_SearchBranching) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_SearchBranching(num) - return nil -} - -// Deprecated: Use SatParameters_SearchBranching.Descriptor instead. -func (SatParameters_SearchBranching) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 8} -} - -type SatParameters_SharedTreeSplitStrategy int32 - -const ( - // Uses the default strategy, currently equivalent to - // SPLIT_STRATEGY_DISCREPANCY. - SatParameters_SPLIT_STRATEGY_AUTO SatParameters_SharedTreeSplitStrategy = 0 - // Only accept splits if the node to be split's depth+discrepancy is minimal - // for the desired number of leaves. - // The preferred child for discrepancy calculation is the one with the - // lowest objective lower bound or the original branch direction if the - // bounds are equal. This rule allows twice as many workers to work in the - // preferred subtree as non-preferred. - SatParameters_SPLIT_STRATEGY_DISCREPANCY SatParameters_SharedTreeSplitStrategy = 1 - // Only split nodes with an objective lb equal to the global lb. If there is - // no objective, this is equivalent to SPLIT_STRATEGY_FIRST_PROPOSAL. - SatParameters_SPLIT_STRATEGY_OBJECTIVE_LB SatParameters_SharedTreeSplitStrategy = 2 - // Attempt to keep the shared tree balanced. - SatParameters_SPLIT_STRATEGY_BALANCED_TREE SatParameters_SharedTreeSplitStrategy = 3 - // Workers race to split their subtree, the winner's proposal is accepted. - SatParameters_SPLIT_STRATEGY_FIRST_PROPOSAL SatParameters_SharedTreeSplitStrategy = 4 -) - -// Enum value maps for SatParameters_SharedTreeSplitStrategy. -var ( - SatParameters_SharedTreeSplitStrategy_name = map[int32]string{ - 0: "SPLIT_STRATEGY_AUTO", - 1: "SPLIT_STRATEGY_DISCREPANCY", - 2: "SPLIT_STRATEGY_OBJECTIVE_LB", - 3: "SPLIT_STRATEGY_BALANCED_TREE", - 4: "SPLIT_STRATEGY_FIRST_PROPOSAL", - } - SatParameters_SharedTreeSplitStrategy_value = map[string]int32{ - "SPLIT_STRATEGY_AUTO": 0, - "SPLIT_STRATEGY_DISCREPANCY": 1, - "SPLIT_STRATEGY_OBJECTIVE_LB": 2, - "SPLIT_STRATEGY_BALANCED_TREE": 3, - "SPLIT_STRATEGY_FIRST_PROPOSAL": 4, - } -) - -func (x SatParameters_SharedTreeSplitStrategy) Enum() *SatParameters_SharedTreeSplitStrategy { - p := new(SatParameters_SharedTreeSplitStrategy) - *p = x - return p -} - -func (x SatParameters_SharedTreeSplitStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_SharedTreeSplitStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[9].Descriptor() -} - -func (SatParameters_SharedTreeSplitStrategy) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[9] -} - -func (x SatParameters_SharedTreeSplitStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_SharedTreeSplitStrategy) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_SharedTreeSplitStrategy(num) - return nil -} - -// Deprecated: Use SatParameters_SharedTreeSplitStrategy.Descriptor instead. -func (SatParameters_SharedTreeSplitStrategy) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 9} -} - -// Rounding method to use for feasibility pump. -type SatParameters_FPRoundingMethod int32 - -const ( - // Rounds to the nearest integer value. - SatParameters_NEAREST_INTEGER SatParameters_FPRoundingMethod = 0 - // Counts the number of linear constraints restricting the variable in the - // increasing values (up locks) and decreasing values (down locks). Rounds - // the variable in the direction of lesser locks. - SatParameters_LOCK_BASED SatParameters_FPRoundingMethod = 1 - // Similar to lock based rounding except this only considers locks of active - // constraints from the last lp solve. - SatParameters_ACTIVE_LOCK_BASED SatParameters_FPRoundingMethod = 3 - // This is expensive rounding algorithm. We round variables one by one and - // propagate the bounds in between. If none of the rounded values fall in - // the continuous domain specified by lower and upper bound, we use the - // current lower/upper bound (whichever one is closest) instead of rounding - // the fractional lp solution value. If both the rounded values are in the - // domain, we round to nearest integer. - SatParameters_PROPAGATION_ASSISTED SatParameters_FPRoundingMethod = 2 -) - -// Enum value maps for SatParameters_FPRoundingMethod. -var ( - SatParameters_FPRoundingMethod_name = map[int32]string{ - 0: "NEAREST_INTEGER", - 1: "LOCK_BASED", - 3: "ACTIVE_LOCK_BASED", - 2: "PROPAGATION_ASSISTED", - } - SatParameters_FPRoundingMethod_value = map[string]int32{ - "NEAREST_INTEGER": 0, - "LOCK_BASED": 1, - "ACTIVE_LOCK_BASED": 3, - "PROPAGATION_ASSISTED": 2, - } -) - -func (x SatParameters_FPRoundingMethod) Enum() *SatParameters_FPRoundingMethod { - p := new(SatParameters_FPRoundingMethod) - *p = x - return p -} - -func (x SatParameters_FPRoundingMethod) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SatParameters_FPRoundingMethod) Descriptor() protoreflect.EnumDescriptor { - return file_ortools_sat_sat_parameters_proto_enumTypes[10].Descriptor() -} - -func (SatParameters_FPRoundingMethod) Type() protoreflect.EnumType { - return &file_ortools_sat_sat_parameters_proto_enumTypes[10] -} - -func (x SatParameters_FPRoundingMethod) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SatParameters_FPRoundingMethod) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SatParameters_FPRoundingMethod(num) - return nil -} - -// Deprecated: Use SatParameters_FPRoundingMethod.Descriptor instead. -func (SatParameters_FPRoundingMethod) EnumDescriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0, 10} -} - -// Contains the definitions for all the sat algorithm parameters and their -// default values. -// -// NEXT TAG: 356 -type SatParameters struct { - state protoimpl.MessageState `protogen:"open.v1"` - // In some context, like in a portfolio of search, it makes sense to name a - // given parameters set for logging purpose. - Name *string `protobuf:"bytes,171,opt,name=name,def=" json:"name,omitempty"` - PreferredVariableOrder *SatParameters_VariableOrder `protobuf:"varint,1,opt,name=preferred_variable_order,json=preferredVariableOrder,enum=operations_research.sat.SatParameters_VariableOrder,def=0" json:"preferred_variable_order,omitempty"` - InitialPolarity *SatParameters_Polarity `protobuf:"varint,2,opt,name=initial_polarity,json=initialPolarity,enum=operations_research.sat.SatParameters_Polarity,def=1" json:"initial_polarity,omitempty"` - // If this is true, then the polarity of a variable will be the last value it - // was assigned to, or its default polarity if it was never assigned since the - // call to ResetDecisionHeuristic(). - // - // Actually, we use a newer version where we follow the last value in the - // longest non-conflicting partial assignment in the current phase. - // - // This is called 'literal phase saving'. For details see 'A Lightweight - // Component Caching Scheme for Satisfiability Solvers' K. Pipatsrisawat and - // A.Darwiche, In 10th International Conference on Theory and Applications of - // Satisfiability Testing, 2007. - UsePhaseSaving *bool `protobuf:"varint,44,opt,name=use_phase_saving,json=usePhaseSaving,def=1" json:"use_phase_saving,omitempty"` - // If non-zero, then we change the polarity heuristic after that many number - // of conflicts in an arithmetically increasing fashion. So x the first time, - // 2 * x the second time, etc... - PolarityRephaseIncrement *int32 `protobuf:"varint,168,opt,name=polarity_rephase_increment,json=polarityRephaseIncrement,def=1000" json:"polarity_rephase_increment,omitempty"` - // If true and we have first solution LS workers, tries in some phase to - // follow a LS solutions that violates has litle constraints as possible. - PolarityExploitLsHints *bool `protobuf:"varint,309,opt,name=polarity_exploit_ls_hints,json=polarityExploitLsHints,def=0" json:"polarity_exploit_ls_hints,omitempty"` - // The proportion of polarity chosen at random. Note that this take - // precedence over the phase saving heuristic. This is different from - // initial_polarity:POLARITY_RANDOM because it will select a new random - // polarity each time the variable is branched upon instead of selecting one - // initially and then always taking this choice. - RandomPolarityRatio *float64 `protobuf:"fixed64,45,opt,name=random_polarity_ratio,json=randomPolarityRatio,def=0" json:"random_polarity_ratio,omitempty"` - // A number between 0 and 1 that indicates the proportion of branching - // variables that are selected randomly instead of choosing the first variable - // from the given variable_ordering strategy. - RandomBranchesRatio *float64 `protobuf:"fixed64,32,opt,name=random_branches_ratio,json=randomBranchesRatio,def=0" json:"random_branches_ratio,omitempty"` - // Whether we use the ERWA (Exponential Recency Weighted Average) heuristic as - // described in "Learning Rate Based Branching Heuristic for SAT solvers", - // J.H.Liang, V. Ganesh, P. Poupart, K.Czarnecki, SAT 2016. - UseErwaHeuristic *bool `protobuf:"varint,75,opt,name=use_erwa_heuristic,json=useErwaHeuristic,def=0" json:"use_erwa_heuristic,omitempty"` - // The initial value of the variables activity. A non-zero value only make - // sense when use_erwa_heuristic is true. Experiments with a value of 1e-2 - // together with the ERWA heuristic showed slighthly better result than simply - // using zero. The idea is that when the "learning rate" of a variable becomes - // lower than this value, then we prefer to branch on never explored before - // variables. This is not in the ERWA paper. - InitialVariablesActivity *float64 `protobuf:"fixed64,76,opt,name=initial_variables_activity,json=initialVariablesActivity,def=0" json:"initial_variables_activity,omitempty"` - // When this is true, then the variables that appear in any of the reason of - // the variables in a conflict have their activity bumped. This is addition to - // the variables in the conflict, and the one that were used during conflict - // resolution. - AlsoBumpVariablesInConflictReasons *bool `protobuf:"varint,77,opt,name=also_bump_variables_in_conflict_reasons,json=alsoBumpVariablesInConflictReasons,def=0" json:"also_bump_variables_in_conflict_reasons,omitempty"` - MinimizationAlgorithm *SatParameters_ConflictMinimizationAlgorithm `protobuf:"varint,4,opt,name=minimization_algorithm,json=minimizationAlgorithm,enum=operations_research.sat.SatParameters_ConflictMinimizationAlgorithm,def=2" json:"minimization_algorithm,omitempty"` - BinaryMinimizationAlgorithm *SatParameters_BinaryMinizationAlgorithm `protobuf:"varint,34,opt,name=binary_minimization_algorithm,json=binaryMinimizationAlgorithm,enum=operations_research.sat.SatParameters_BinaryMinizationAlgorithm,def=5" json:"binary_minimization_algorithm,omitempty"` - // At a really low cost, during the 1-UIP conflict computation, it is easy to - // detect if some of the involved reasons are subsumed by the current - // conflict. When this is true, such clauses are detached and later removed - // from the problem. - SubsumptionDuringConflictAnalysis *bool `protobuf:"varint,56,opt,name=subsumption_during_conflict_analysis,json=subsumptionDuringConflictAnalysis,def=1" json:"subsumption_during_conflict_analysis,omitempty"` - // It is possible that "intermediate" clauses during conflict resolution - // subsumes some of the clauses that propagated. This is quite cheap to detect - // and result in more subsumption/strengthening of clauses. - ExtraSubsumptionDuringConflictAnalysis *bool `protobuf:"varint,351,opt,name=extra_subsumption_during_conflict_analysis,json=extraSubsumptionDuringConflictAnalysis,def=1" json:"extra_subsumption_during_conflict_analysis,omitempty"` - // Try even more subsumption options during conflict analysis. - DecisionSubsumptionDuringConflictAnalysis *bool `protobuf:"varint,353,opt,name=decision_subsumption_during_conflict_analysis,json=decisionSubsumptionDuringConflictAnalysis,def=1" json:"decision_subsumption_during_conflict_analysis,omitempty"` - // If >=0, each time we have a conflict, we try to subsume the last n learned - // clause with it. - EagerlySubsumeLastNConflicts *int32 `protobuf:"varint,343,opt,name=eagerly_subsume_last_n_conflicts,json=eagerlySubsumeLastNConflicts,def=4" json:"eagerly_subsume_last_n_conflicts,omitempty"` - // If we remove clause that we now are "implied" by others. Note that this - // might not always be good as we might loose some propagation power. - SubsumeDuringVivification *bool `protobuf:"varint,355,opt,name=subsume_during_vivification,json=subsumeDuringVivification,def=1" json:"subsume_during_vivification,omitempty"` - // If true, try to backtrack as little as possible on conflict and re-imply - // the clauses later. - // This means we discard less propagation than traditional backjumping, but - // requites additional bookkeeping to handle reimplication. - // See: https://doi.org/10.1007/978-3-319-94144-8_7 - UseChronologicalBacktracking *bool `protobuf:"varint,330,opt,name=use_chronological_backtracking,json=useChronologicalBacktracking,def=0" json:"use_chronological_backtracking,omitempty"` - // If chronological backtracking is enabled, this is the maximum number of - // levels we will backjump over, otherwise we will backtrack. - MaxBackjumpLevels *int32 `protobuf:"varint,331,opt,name=max_backjump_levels,json=maxBackjumpLevels,def=50" json:"max_backjump_levels,omitempty"` - // If chronological backtracking is enabled, this is the minimum number of - // conflicts before we will consider backjumping. - ChronologicalBacktrackMinConflicts *int32 `protobuf:"varint,332,opt,name=chronological_backtrack_min_conflicts,json=chronologicalBacktrackMinConflicts,def=1000" json:"chronological_backtrack_min_conflicts,omitempty"` - // Trigger a cleanup when this number of "deletable" clauses is learned. - ClauseCleanupPeriod *int32 `protobuf:"varint,11,opt,name=clause_cleanup_period,json=clauseCleanupPeriod,def=10000" json:"clause_cleanup_period,omitempty"` - // Increase clause_cleanup_period by this amount after each cleanup. - ClauseCleanupPeriodIncrement *int32 `protobuf:"varint,337,opt,name=clause_cleanup_period_increment,json=clauseCleanupPeriodIncrement,def=0" json:"clause_cleanup_period_increment,omitempty"` - // During a cleanup, we will always keep that number of "deletable" clauses. - // Note that this doesn't include the "protected" clauses. - ClauseCleanupTarget *int32 `protobuf:"varint,13,opt,name=clause_cleanup_target,json=clauseCleanupTarget,def=0" json:"clause_cleanup_target,omitempty"` - // During a cleanup, if clause_cleanup_target is 0, we will delete the - // clause_cleanup_ratio of "deletable" clauses instead of aiming for a fixed - // target of clauses to keep. - ClauseCleanupRatio *float64 `protobuf:"fixed64,190,opt,name=clause_cleanup_ratio,json=clauseCleanupRatio,def=0.5" json:"clause_cleanup_ratio,omitempty"` - // All the clauses with a LBD (literal blocks distance) lower or equal to this - // parameters will always be kept. - // - // Note that the LBD of a clause that just propagated is 1 + number of - // different decision levels of its literals. So that the "classic" LBD of a - // learned conflict is the same as its LBD when we backjump and then propagate - // it. - ClauseCleanupLbdBound *int32 `protobuf:"varint,59,opt,name=clause_cleanup_lbd_bound,json=clauseCleanupLbdBound,def=5" json:"clause_cleanup_lbd_bound,omitempty"` - // All the clause with a LBD lower or equal to this will be kept except if - // its activity hasn't been bumped in the last 32 cleanup phase. Note that - // this has no effect if it is <= clause_cleanup_lbd_bound. - ClauseCleanupLbdTier1 *int32 `protobuf:"varint,349,opt,name=clause_cleanup_lbd_tier1,json=clauseCleanupLbdTier1,def=0" json:"clause_cleanup_lbd_tier1,omitempty"` - // All the clause with a LBD lower or equal to this will be kept except if its - // activity hasn't been bumped since the previous cleanup phase. Note that - // this has no effect if it is <= clause_cleanup_lbd_bound or <= - // clause_cleanup_lbd_tier1. - ClauseCleanupLbdTier2 *int32 `protobuf:"varint,350,opt,name=clause_cleanup_lbd_tier2,json=clauseCleanupLbdTier2,def=0" json:"clause_cleanup_lbd_tier2,omitempty"` - ClauseCleanupOrdering *SatParameters_ClauseOrdering `protobuf:"varint,60,opt,name=clause_cleanup_ordering,json=clauseCleanupOrdering,enum=operations_research.sat.SatParameters_ClauseOrdering,def=0" json:"clause_cleanup_ordering,omitempty"` - // Same as for the clauses, but for the learned pseudo-Boolean constraints. - PbCleanupIncrement *int32 `protobuf:"varint,46,opt,name=pb_cleanup_increment,json=pbCleanupIncrement,def=200" json:"pb_cleanup_increment,omitempty"` - PbCleanupRatio *float64 `protobuf:"fixed64,47,opt,name=pb_cleanup_ratio,json=pbCleanupRatio,def=0.5" json:"pb_cleanup_ratio,omitempty"` - // Each time a conflict is found, the activities of some variables are - // increased by one. Then, the activity of all variables are multiplied by - // variable_activity_decay. - // - // To implement this efficiently, the activity of all the variables is not - // decayed at each conflict. Instead, the activity increment is multiplied by - // 1 / decay. When an activity reach max_variable_activity_value, all the - // activity are multiplied by 1 / max_variable_activity_value. - VariableActivityDecay *float64 `protobuf:"fixed64,15,opt,name=variable_activity_decay,json=variableActivityDecay,def=0.8" json:"variable_activity_decay,omitempty"` - MaxVariableActivityValue *float64 `protobuf:"fixed64,16,opt,name=max_variable_activity_value,json=maxVariableActivityValue,def=1e+100" json:"max_variable_activity_value,omitempty"` - // The activity starts at 0.8 and increment by 0.01 every 5000 conflicts until - // 0.95. This "hack" seems to work well and comes from: - // - // Glucose 2.3 in the SAT 2013 Competition - SAT Competition 2013 - // http://edacc4.informatik.uni-ulm.de/SC13/solver-description-download/136 - GlucoseMaxDecay *float64 `protobuf:"fixed64,22,opt,name=glucose_max_decay,json=glucoseMaxDecay,def=0.95" json:"glucose_max_decay,omitempty"` - GlucoseDecayIncrement *float64 `protobuf:"fixed64,23,opt,name=glucose_decay_increment,json=glucoseDecayIncrement,def=0.01" json:"glucose_decay_increment,omitempty"` - GlucoseDecayIncrementPeriod *int32 `protobuf:"varint,24,opt,name=glucose_decay_increment_period,json=glucoseDecayIncrementPeriod,def=5000" json:"glucose_decay_increment_period,omitempty"` - // Clause activity parameters (same effect as the one on the variables). - ClauseActivityDecay *float64 `protobuf:"fixed64,17,opt,name=clause_activity_decay,json=clauseActivityDecay,def=0.999" json:"clause_activity_decay,omitempty"` - MaxClauseActivityValue *float64 `protobuf:"fixed64,18,opt,name=max_clause_activity_value,json=maxClauseActivityValue,def=1e+20" json:"max_clause_activity_value,omitempty"` - // The restart strategies will change each time the strategy_counter is - // increased. The current strategy will simply be the one at index - // strategy_counter modulo the number of strategy. Note that if this list - // includes a NO_RESTART, nothing will change when it is reached because the - // strategy_counter will only increment after a restart. - // - // The idea of switching of search strategy tailored for SAT/UNSAT comes from - // Chanseok Oh with his COMiniSatPS solver, see http://cs.nyu.edu/~chanseok/. - // But more generally, it seems REALLY beneficial to try different strategy. - RestartAlgorithms []SatParameters_RestartAlgorithm `protobuf:"varint,61,rep,name=restart_algorithms,json=restartAlgorithms,enum=operations_research.sat.SatParameters_RestartAlgorithm" json:"restart_algorithms,omitempty"` - DefaultRestartAlgorithms *string `protobuf:"bytes,70,opt,name=default_restart_algorithms,json=defaultRestartAlgorithms,def=LUBY_RESTART,LBD_MOVING_AVERAGE_RESTART,DL_MOVING_AVERAGE_RESTART" json:"default_restart_algorithms,omitempty"` - // Restart period for the FIXED_RESTART strategy. This is also the multiplier - // used by the LUBY_RESTART strategy. - RestartPeriod *int32 `protobuf:"varint,30,opt,name=restart_period,json=restartPeriod,def=50" json:"restart_period,omitempty"` - // Size of the window for the moving average restarts. - RestartRunningWindowSize *int32 `protobuf:"varint,62,opt,name=restart_running_window_size,json=restartRunningWindowSize,def=50" json:"restart_running_window_size,omitempty"` - // In the moving average restart algorithms, a restart is triggered if the - // window average times this ratio is greater that the global average. - RestartDlAverageRatio *float64 `protobuf:"fixed64,63,opt,name=restart_dl_average_ratio,json=restartDlAverageRatio,def=1" json:"restart_dl_average_ratio,omitempty"` - RestartLbdAverageRatio *float64 `protobuf:"fixed64,71,opt,name=restart_lbd_average_ratio,json=restartLbdAverageRatio,def=1" json:"restart_lbd_average_ratio,omitempty"` - // Block a moving restart algorithm if the trail size of the current conflict - // is greater than the multiplier times the moving average of the trail size - // at the previous conflicts. - UseBlockingRestart *bool `protobuf:"varint,64,opt,name=use_blocking_restart,json=useBlockingRestart,def=0" json:"use_blocking_restart,omitempty"` - BlockingRestartWindowSize *int32 `protobuf:"varint,65,opt,name=blocking_restart_window_size,json=blockingRestartWindowSize,def=5000" json:"blocking_restart_window_size,omitempty"` - BlockingRestartMultiplier *float64 `protobuf:"fixed64,66,opt,name=blocking_restart_multiplier,json=blockingRestartMultiplier,def=1.4" json:"blocking_restart_multiplier,omitempty"` - // After each restart, if the number of conflict since the last strategy - // change is greater that this, then we increment a "strategy_counter" that - // can be use to change the search strategy used by the following restarts. - NumConflictsBeforeStrategyChanges *int32 `protobuf:"varint,68,opt,name=num_conflicts_before_strategy_changes,json=numConflictsBeforeStrategyChanges,def=0" json:"num_conflicts_before_strategy_changes,omitempty"` - // The parameter num_conflicts_before_strategy_changes is increased by that - // much after each strategy change. - StrategyChangeIncreaseRatio *float64 `protobuf:"fixed64,69,opt,name=strategy_change_increase_ratio,json=strategyChangeIncreaseRatio,def=0" json:"strategy_change_increase_ratio,omitempty"` - // Maximum time allowed in seconds to solve a problem. - // The counter will starts at the beginning of the Solve() call. - MaxTimeInSeconds *float64 `protobuf:"fixed64,36,opt,name=max_time_in_seconds,json=maxTimeInSeconds,def=inf" json:"max_time_in_seconds,omitempty"` - // Maximum time allowed in deterministic time to solve a problem. - // The deterministic time should be correlated with the real time used by the - // solver, the time unit being as close as possible to a second. - MaxDeterministicTime *float64 `protobuf:"fixed64,67,opt,name=max_deterministic_time,json=maxDeterministicTime,def=inf" json:"max_deterministic_time,omitempty"` - // Stops after that number of batches has been scheduled. This only make sense - // when interleave_search is true. - MaxNumDeterministicBatches *int32 `protobuf:"varint,291,opt,name=max_num_deterministic_batches,json=maxNumDeterministicBatches,def=0" json:"max_num_deterministic_batches,omitempty"` - // Maximum number of conflicts allowed to solve a problem. - // - // TODO(user): Maybe change the way the conflict limit is enforced? - // currently it is enforced on each independent internal SAT solve, rather - // than on the overall number of conflicts across all solves. So in the - // context of an optimization problem, this is not really usable directly by a - // client. - MaxNumberOfConflicts *int64 `protobuf:"varint,37,opt,name=max_number_of_conflicts,json=maxNumberOfConflicts,def=9223372036854775807" json:"max_number_of_conflicts,omitempty"` // kint64max - // Maximum memory allowed for the whole thread containing the solver. The - // solver will abort as soon as it detects that this limit is crossed. As a - // result, this limit is approximative, but usually the solver will not go too - // much over. - // - // TODO(user): This is only used by the pure SAT solver, generalize to CP-SAT. - MaxMemoryInMb *int64 `protobuf:"varint,40,opt,name=max_memory_in_mb,json=maxMemoryInMb,def=10000" json:"max_memory_in_mb,omitempty"` - // Stop the search when the gap between the best feasible objective (O) and - // our best objective bound (B) is smaller than a limit. - // The exact definition is: - // - Absolute: abs(O - B) - // - Relative: abs(O - B) / max(1, abs(O)). - // - // Important: The relative gap depends on the objective offset! If you - // artificially shift the objective, you will get widely different value of - // the relative gap. - // - // Note that if the gap is reached, the search status will be OPTIMAL. But - // one can check the best objective bound to see the actual gap. - // - // If the objective is integer, then any absolute gap < 1 will lead to a true - // optimal. If the objective is floating point, a gap of zero make little - // sense so is is why we use a non-zero default value. At the end of the - // search, we will display a warning if OPTIMAL is reported yet the gap is - // greater than this absolute gap. - AbsoluteGapLimit *float64 `protobuf:"fixed64,159,opt,name=absolute_gap_limit,json=absoluteGapLimit,def=0.0001" json:"absolute_gap_limit,omitempty"` - RelativeGapLimit *float64 `protobuf:"fixed64,160,opt,name=relative_gap_limit,json=relativeGapLimit,def=0" json:"relative_gap_limit,omitempty"` - // At the beginning of each solve, the random number generator used in some - // part of the solver is reinitialized to this seed. If you change the random - // seed, the solver may make different choices during the solving process. - // - // For some problems, the running time may vary a lot depending on small - // change in the solving algorithm. Running the solver with different seeds - // enables to have more robust benchmarks when evaluating new features. - RandomSeed *int32 `protobuf:"varint,31,opt,name=random_seed,json=randomSeed,def=1" json:"random_seed,omitempty"` - // This is mainly here to test the solver variability. Note that in tests, if - // not explicitly set to false, all 3 options will be set to true so that - // clients do not rely on the solver returning a specific solution if they are - // many equivalent optimal solutions. - PermuteVariableRandomly *bool `protobuf:"varint,178,opt,name=permute_variable_randomly,json=permuteVariableRandomly,def=0" json:"permute_variable_randomly,omitempty"` - PermutePresolveConstraintOrder *bool `protobuf:"varint,179,opt,name=permute_presolve_constraint_order,json=permutePresolveConstraintOrder,def=0" json:"permute_presolve_constraint_order,omitempty"` - UseAbslRandom *bool `protobuf:"varint,180,opt,name=use_absl_random,json=useAbslRandom,def=0" json:"use_absl_random,omitempty"` - // Whether the solver should log the search progress. This is the maing - // logging parameter and if this is false, none of the logging (callbacks, - // log_to_stdout, log_to_response, ...) will do anything. - LogSearchProgress *bool `protobuf:"varint,41,opt,name=log_search_progress,json=logSearchProgress,def=0" json:"log_search_progress,omitempty"` - // Whether the solver should display per sub-solver search statistics. - // This is only useful is log_search_progress is set to true, and if the - // number of search workers is > 1. Note that in all case we display a bit - // of stats with one line per subsolver. - LogSubsolverStatistics *bool `protobuf:"varint,189,opt,name=log_subsolver_statistics,json=logSubsolverStatistics,def=0" json:"log_subsolver_statistics,omitempty"` - // Add a prefix to all logs. - LogPrefix *string `protobuf:"bytes,185,opt,name=log_prefix,json=logPrefix,def=" json:"log_prefix,omitempty"` - // Log to stdout. - LogToStdout *bool `protobuf:"varint,186,opt,name=log_to_stdout,json=logToStdout,def=1" json:"log_to_stdout,omitempty"` - // Log to response proto. - LogToResponse *bool `protobuf:"varint,187,opt,name=log_to_response,json=logToResponse,def=0" json:"log_to_response,omitempty"` - // Experimental. - // - // This is an old experiment, it might cause crashes in multi-thread and you - // should double check the solver result. It can still be used if you only - // care about feasible solutions (these are checked) and it gives good result - // on your problem. We might revive it at some point. - // - // Whether to use pseudo-Boolean resolution to analyze a conflict. Note that - // this option only make sense if your problem is modelized using - // pseudo-Boolean constraints. If you only have clauses, this shouldn't change - // anything (except slow the solver down). - UsePbResolution *bool `protobuf:"varint,43,opt,name=use_pb_resolution,json=usePbResolution,def=0" json:"use_pb_resolution,omitempty"` - // A different algorithm during PB resolution. It minimizes the number of - // calls to ReduceCoefficients() which can be time consuming. However, the - // search space will be different and if the coefficients are large, this may - // lead to integer overflows that could otherwise be prevented. - MinimizeReductionDuringPbResolution *bool `protobuf:"varint,48,opt,name=minimize_reduction_during_pb_resolution,json=minimizeReductionDuringPbResolution,def=0" json:"minimize_reduction_during_pb_resolution,omitempty"` - // Whether or not the assumption levels are taken into account during the LBD - // computation. According to the reference below, not counting them improves - // the solver in some situation. Note that this only impact solves under - // assumptions. - // - // Gilles Audemard, Jean-Marie Lagniez, Laurent Simon, "Improving Glucose for - // Incremental SAT Solving with Assumptions: Application to MUS Extraction" - // Theory and Applications of Satisfiability Testing - SAT 2013, Lecture Notes - // in Computer Science Volume 7962, 2013, pp 309-317. - CountAssumptionLevelsInLbd *bool `protobuf:"varint,49,opt,name=count_assumption_levels_in_lbd,json=countAssumptionLevelsInLbd,def=1" json:"count_assumption_levels_in_lbd,omitempty"` - // During presolve, only try to perform the bounded variable elimination (BVE) - // of a variable x if the number of occurrences of x times the number of - // occurrences of not(x) is not greater than this parameter. - PresolveBveThreshold *int32 `protobuf:"varint,54,opt,name=presolve_bve_threshold,json=presolveBveThreshold,def=500" json:"presolve_bve_threshold,omitempty"` - // Internal parameter. During BVE, if we eliminate a variable x, by default we - // will push all clauses containing x and all clauses containing not(x) to the - // postsolve. However, it is possible to write the postsolve code so that only - // one such set is needed. The idea is that, if we push the set containing a - // literal l, is to set l to false except if it is needed to satisfy one of - // the clause in the set. This is always beneficial, but for historical - // reason, not all our postsolve algorithm support this. - FilterSatPostsolveClauses *bool `protobuf:"varint,324,opt,name=filter_sat_postsolve_clauses,json=filterSatPostsolveClauses,def=0" json:"filter_sat_postsolve_clauses,omitempty"` - // During presolve, we apply BVE only if this weight times the number of - // clauses plus the number of clause literals is not increased. - PresolveBveClauseWeight *int32 `protobuf:"varint,55,opt,name=presolve_bve_clause_weight,json=presolveBveClauseWeight,def=3" json:"presolve_bve_clause_weight,omitempty"` - // The maximum "deterministic" time limit to spend in probing. A value of - // zero will disable the probing. - // - // TODO(user): Clean up. The first one is used in CP-SAT, the other in pure - // SAT presolve. - ProbingDeterministicTimeLimit *float64 `protobuf:"fixed64,226,opt,name=probing_deterministic_time_limit,json=probingDeterministicTimeLimit,def=1" json:"probing_deterministic_time_limit,omitempty"` - PresolveProbingDeterministicTimeLimit *float64 `protobuf:"fixed64,57,opt,name=presolve_probing_deterministic_time_limit,json=presolveProbingDeterministicTimeLimit,def=30" json:"presolve_probing_deterministic_time_limit,omitempty"` - // Whether we use an heuristic to detect some basic case of blocked clause - // in the SAT presolve. - PresolveBlockedClause *bool `protobuf:"varint,88,opt,name=presolve_blocked_clause,json=presolveBlockedClause,def=1" json:"presolve_blocked_clause,omitempty"` - // Whether or not we use Bounded Variable Addition (BVA) in the presolve. - PresolveUseBva *bool `protobuf:"varint,72,opt,name=presolve_use_bva,json=presolveUseBva,def=1" json:"presolve_use_bva,omitempty"` - // Apply Bounded Variable Addition (BVA) if the number of clauses is reduced - // by stricly more than this threshold. The algorithm described in the paper - // uses 0, but quick experiments showed that 1 is a good value. It may not be - // worth it to add a new variable just to remove one clause. - PresolveBvaThreshold *int32 `protobuf:"varint,73,opt,name=presolve_bva_threshold,json=presolveBvaThreshold,def=1" json:"presolve_bva_threshold,omitempty"` - // In case of large reduction in a presolve iteration, we perform multiple - // presolve iterations. This parameter controls the maximum number of such - // presolve iterations. - MaxPresolveIterations *int32 `protobuf:"varint,138,opt,name=max_presolve_iterations,json=maxPresolveIterations,def=3" json:"max_presolve_iterations,omitempty"` - // Whether we presolve the cp_model before solving it. - CpModelPresolve *bool `protobuf:"varint,86,opt,name=cp_model_presolve,json=cpModelPresolve,def=1" json:"cp_model_presolve,omitempty"` - // How much effort do we spend on probing. 0 disables it completely. - CpModelProbingLevel *int32 `protobuf:"varint,110,opt,name=cp_model_probing_level,json=cpModelProbingLevel,def=2" json:"cp_model_probing_level,omitempty"` - // Whether we also use the sat presolve when cp_model_presolve is true. - CpModelUseSatPresolve *bool `protobuf:"varint,93,opt,name=cp_model_use_sat_presolve,json=cpModelUseSatPresolve,def=1" json:"cp_model_use_sat_presolve,omitempty"` - // If we try to load at most ones and exactly ones constraints when running - // the pure SAT presolve. Or if we just ignore them. - // - // If one detects at_most_one via merge_at_most_one_work_limit or exactly one - // with find_clauses_that_are_exactly_one, it might be good to also set this - // to true. - LoadAtMostOnesInSatPresolve *bool `protobuf:"varint,335,opt,name=load_at_most_ones_in_sat_presolve,json=loadAtMostOnesInSatPresolve,def=0" json:"load_at_most_ones_in_sat_presolve,omitempty"` - // If cp_model_presolve is true and there is a large proportion of fixed - // variable after the first model copy, remap all the model to a dense set of - // variable before the full presolve even starts. This should help for LNS on - // large models. - RemoveFixedVariablesEarly *bool `protobuf:"varint,310,opt,name=remove_fixed_variables_early,json=removeFixedVariablesEarly,def=1" json:"remove_fixed_variables_early,omitempty"` - // If true, we detect variable that are unique to a table constraint and only - // there to encode a cost on each tuple. This is usually the case when a WCSP - // (weighted constraint program) is encoded into CP-SAT format. - // - // This can lead to a dramatic speed-up for such problems but is still - // experimental at this point. - DetectTableWithCost *bool `protobuf:"varint,216,opt,name=detect_table_with_cost,json=detectTableWithCost,def=0" json:"detect_table_with_cost,omitempty"` - // How much we try to "compress" a table constraint. Compressing more leads to - // less Booleans and faster propagation but can reduced the quality of the lp - // relaxation. Values goes from 0 to 3 where we always try to fully compress a - // table. At 2, we try to automatically decide if it is worth it. - TableCompressionLevel *int32 `protobuf:"varint,217,opt,name=table_compression_level,json=tableCompressionLevel,def=2" json:"table_compression_level,omitempty"` - // If true, expand all_different constraints that are not permutations. - // Permutations (#Variables = #Values) are always expanded. - ExpandAlldiffConstraints *bool `protobuf:"varint,170,opt,name=expand_alldiff_constraints,json=expandAlldiffConstraints,def=0" json:"expand_alldiff_constraints,omitempty"` - // Max domain size for all_different constraints to be expanded. - MaxAlldiffDomainSize *int32 `protobuf:"varint,320,opt,name=max_alldiff_domain_size,json=maxAlldiffDomainSize,def=256" json:"max_alldiff_domain_size,omitempty"` - // If true, expand the reservoir constraints by creating booleans for all - // possible precedences between event and encoding the constraint. - ExpandReservoirConstraints *bool `protobuf:"varint,182,opt,name=expand_reservoir_constraints,json=expandReservoirConstraints,def=1" json:"expand_reservoir_constraints,omitempty"` - // Max domain size for expanding linear2 constraints (ax + by ==/!= c). - MaxDomainSizeForLinear2Expansion *int32 `protobuf:"varint,340,opt,name=max_domain_size_for_linear2_expansion,json=maxDomainSizeForLinear2Expansion,def=8" json:"max_domain_size_for_linear2_expansion,omitempty"` - // Mainly useful for testing. - // - // If this and expand_reservoir_constraints is true, we use a different - // encoding of the reservoir constraint using circuit instead of precedences. - // Note that this is usually slower, but can exercise different part of the - // solver. Note that contrary to the precedence encoding, this easily support - // variable demands. - // - // WARNING: with this encoding, the constraint takes a slightly different - // meaning. There must exist a permutation of the events occurring at the same - // time such that the level is within the reservoir after each of these events - // (in this permuted order). So we cannot have +100 and -100 at the same time - // if the level must be between 0 and 10 (as authorized by the reservoir - // constraint). - ExpandReservoirUsingCircuit *bool `protobuf:"varint,288,opt,name=expand_reservoir_using_circuit,json=expandReservoirUsingCircuit,def=0" json:"expand_reservoir_using_circuit,omitempty"` - // Encore cumulative with fixed demands and capacity as a reservoir - // constraint. The only reason you might want to do that is to test the - // reservoir propagation code! - EncodeCumulativeAsReservoir *bool `protobuf:"varint,287,opt,name=encode_cumulative_as_reservoir,json=encodeCumulativeAsReservoir,def=0" json:"encode_cumulative_as_reservoir,omitempty"` - // If the number of expressions in the lin_max is less that the max size - // parameter, model expansion replaces target = max(xi) by linear constraint - // with the introduction of new booleans bi such that bi => target == xi. - // - // This is mainly for experimenting compared to a custom lin_max propagator. - MaxLinMaxSizeForExpansion *int32 `protobuf:"varint,280,opt,name=max_lin_max_size_for_expansion,json=maxLinMaxSizeForExpansion,def=0" json:"max_lin_max_size_for_expansion,omitempty"` - // If true, it disable all constraint expansion. - // This should only be used to test the presolve of expanded constraints. - DisableConstraintExpansion *bool `protobuf:"varint,181,opt,name=disable_constraint_expansion,json=disableConstraintExpansion,def=0" json:"disable_constraint_expansion,omitempty"` - // Linear constraint with a complex right hand side (more than a single - // interval) need to be expanded, there is a couple of way to do that. - EncodeComplexLinearConstraintWithInteger *bool `protobuf:"varint,223,opt,name=encode_complex_linear_constraint_with_integer,json=encodeComplexLinearConstraintWithInteger,def=0" json:"encode_complex_linear_constraint_with_integer,omitempty"` - // During presolve, we use a maximum clique heuristic to merge together - // no-overlap constraints or at most one constraints. This code can be slow, - // so we have a limit in place on the number of explored nodes in the - // underlying graph. The internal limit is an int64, but we use double here to - // simplify manual input. - MergeNoOverlapWorkLimit *float64 `protobuf:"fixed64,145,opt,name=merge_no_overlap_work_limit,json=mergeNoOverlapWorkLimit,def=1e+12" json:"merge_no_overlap_work_limit,omitempty"` - MergeAtMostOneWorkLimit *float64 `protobuf:"fixed64,146,opt,name=merge_at_most_one_work_limit,json=mergeAtMostOneWorkLimit,def=1e+08" json:"merge_at_most_one_work_limit,omitempty"` - // How much substitution (also called free variable aggregation in MIP - // litterature) should we perform at presolve. This currently only concerns - // variable appearing only in linear constraints. For now the value 0 turns it - // off and any positive value performs substitution. - PresolveSubstitutionLevel *int32 `protobuf:"varint,147,opt,name=presolve_substitution_level,json=presolveSubstitutionLevel,def=1" json:"presolve_substitution_level,omitempty"` - // If true, we will extract from linear constraints, enforcement literals of - // the form "integer variable at bound => simplified constraint". This should - // always be beneficial except that we don't always handle them as efficiently - // as we could for now. This causes problem on manna81.mps (LP relaxation not - // as tight it seems) and on neos-3354841-apure.mps.gz (too many literals - // created this way). - PresolveExtractIntegerEnforcement *bool `protobuf:"varint,174,opt,name=presolve_extract_integer_enforcement,json=presolveExtractIntegerEnforcement,def=0" json:"presolve_extract_integer_enforcement,omitempty"` - // A few presolve operations involve detecting constraints included in other - // constraint. Since there can be a quadratic number of such pairs, and - // processing them usually involve scanning them, the complexity of these - // operations can be big. This enforce a local deterministic limit on the - // number of entries scanned. Default is 1e8. - // - // A value of zero will disable these presolve rules completely. - PresolveInclusionWorkLimit *int64 `protobuf:"varint,201,opt,name=presolve_inclusion_work_limit,json=presolveInclusionWorkLimit,def=100000000" json:"presolve_inclusion_work_limit,omitempty"` - // If true, we don't keep names in our internal copy of the user given model. - IgnoreNames *bool `protobuf:"varint,202,opt,name=ignore_names,json=ignoreNames,def=1" json:"ignore_names,omitempty"` - // Run a max-clique code amongst all the x != y we can find and try to infer - // set of variables that are all different. This allows to close neos16.mps - // for instance. Note that we only run this code if there is no all_diff - // already in the model so that if a user want to add some all_diff, we assume - // it is well done and do not try to add more. - // - // This will also detect and add no_overlap constraints, if all the relations - // x != y have "offsets" between them. I.e. x > y + offset. - InferAllDiffs *bool `protobuf:"varint,233,opt,name=infer_all_diffs,json=inferAllDiffs,def=1" json:"infer_all_diffs,omitempty"` - // Try to find large "rectangle" in the linear constraint matrix with - // identical lines. If such rectangle is big enough, we can introduce a new - // integer variable corresponding to the common expression and greatly reduce - // the number of non-zero. - FindBigLinearOverlap *bool `protobuf:"varint,234,opt,name=find_big_linear_overlap,json=findBigLinearOverlap,def=1" json:"find_big_linear_overlap,omitempty"` - // By propagating (or just using binary clauses), one can detect that all - // literal of a clause are actually in at most one relationship. Thus this - // constraint can be promoted to an exactly one constraints. This should help - // as it convey more structure. Note that this is expensive, so we have a - // deterministic limit in place. - FindClausesThatAreExactlyOne *bool `protobuf:"varint,333,opt,name=find_clauses_that_are_exactly_one,json=findClausesThatAreExactlyOne,def=1" json:"find_clauses_that_are_exactly_one,omitempty"` - // Enable or disable "inprocessing" which is some SAT presolving done at - // each restart to the root level. - UseSatInprocessing *bool `protobuf:"varint,163,opt,name=use_sat_inprocessing,json=useSatInprocessing,def=1" json:"use_sat_inprocessing,omitempty"` - // Proportion of deterministic time we should spend on inprocessing. - // At each "restart", if the proportion is below this ratio, we will do some - // inprocessing, otherwise, we skip it for this restart. - InprocessingDtimeRatio *float64 `protobuf:"fixed64,273,opt,name=inprocessing_dtime_ratio,json=inprocessingDtimeRatio,def=0.2" json:"inprocessing_dtime_ratio,omitempty"` - // The amount of dtime we should spend on probing for each inprocessing round. - InprocessingProbingDtime *float64 `protobuf:"fixed64,274,opt,name=inprocessing_probing_dtime,json=inprocessingProbingDtime,def=1" json:"inprocessing_probing_dtime,omitempty"` - // Parameters for an heuristic similar to the one described in "An effective - // learnt clause minimization approach for CDCL Sat Solvers", - // https://www.ijcai.org/proceedings/2017/0098.pdf - // - // This is the amount of dtime we should spend on this technique during each - // inprocessing phase. - // - // The minimization technique is the same as the one used to minimize core in - // max-sat. We also minimize problem clauses and not just the learned clause - // that we keep forever like in the paper. - InprocessingMinimizationDtime *float64 `protobuf:"fixed64,275,opt,name=inprocessing_minimization_dtime,json=inprocessingMinimizationDtime,def=1" json:"inprocessing_minimization_dtime,omitempty"` - InprocessingMinimizationUseConflictAnalysis *bool `protobuf:"varint,297,opt,name=inprocessing_minimization_use_conflict_analysis,json=inprocessingMinimizationUseConflictAnalysis,def=1" json:"inprocessing_minimization_use_conflict_analysis,omitempty"` - InprocessingMinimizationUseAllOrderings *bool `protobuf:"varint,298,opt,name=inprocessing_minimization_use_all_orderings,json=inprocessingMinimizationUseAllOrderings,def=0" json:"inprocessing_minimization_use_all_orderings,omitempty"` - // Whether we use the algorithm described in "Clausal Congruence closure", - // Armin Biere, Katalin Fazekas, Mathias Fleury, Nils Froleyks, 2024. - // - // Note that we only have a basic version currently. - InprocessingUseCongruenceClosure *bool `protobuf:"varint,342,opt,name=inprocessing_use_congruence_closure,json=inprocessingUseCongruenceClosure,def=1" json:"inprocessing_use_congruence_closure,omitempty"` - // Whether we use the SAT sweeping algorithm described in "Clausal Equivalence - // Sweeping", Armin Biere, Katalin Fazekas, Mathias Fleury, Nils Froleyks, - // 2025. - InprocessingUseSatSweeping *bool `protobuf:"varint,354,opt,name=inprocessing_use_sat_sweeping,json=inprocessingUseSatSweeping,def=0" json:"inprocessing_use_sat_sweeping,omitempty"` - // Specify the number of parallel workers (i.e. threads) to use during search. - // This should usually be lower than your number of available cpus + - // hyperthread in your machine. - // - // A value of 0 means the solver will try to use all cores on the machine. - // A number of 1 means no parallelism. - // - // Note that 'num_workers' is the preferred name, but if it is set to zero, - // we will still read the deprecated 'num_search_workers'. - // - // As of 2020-04-10, if you're using SAT via MPSolver (to solve integer - // programs) this field is overridden with a value of 8, if the field is not - // set *explicitly*. Thus, always set this field explicitly or via - // MPSolver::SetNumThreads(). - NumWorkers *int32 `protobuf:"varint,206,opt,name=num_workers,json=numWorkers,def=0" json:"num_workers,omitempty"` - NumSearchWorkers *int32 `protobuf:"varint,100,opt,name=num_search_workers,json=numSearchWorkers,def=0" json:"num_search_workers,omitempty"` - // We distinguish subsolvers that consume a full thread, and the ones that are - // always interleaved. If left at zero, we will fix this with a default - // formula that depends on num_workers. But if you start modifying what runs, - // you might want to fix that to a given value depending on the num_workers - // you use. - NumFullSubsolvers *int32 `protobuf:"varint,294,opt,name=num_full_subsolvers,json=numFullSubsolvers,def=0" json:"num_full_subsolvers,omitempty"` - // In multi-thread, the solver can be mainly seen as a portfolio of solvers - // with different parameters. This field indicates the names of the parameters - // that are used in multithread. This only applies to "full" subsolvers. - // - // See cp_model_search.cc to see a list of the names and the default value (if - // left empty) that looks like: - // - default_lp (linearization_level:1) - // - fixed (only if fixed search specified or scheduling) - // - no_lp (linearization_level:0) - // - max_lp (linearization_level:2) - // - pseudo_costs (only if objective, change search heuristic) - // - reduced_costs (only if objective, change search heuristic) - // - quick_restart (kind of probing) - // - quick_restart_no_lp (kind of probing with linearization_level:0) - // - lb_tree_search (to improve lower bound, MIP like tree search) - // - probing (continuous probing and shaving) - // - // Also, note that some set of parameters will be ignored if they do not make - // sense. For instance if there is no objective, pseudo_cost or reduced_cost - // search will be ignored. Core based search will only work if the objective - // has many terms. If there is no fixed strategy fixed will be ignored. And so - // on. - // - // The order is important, as only the first num_full_subsolvers will be - // scheduled. You can see in the log which one are selected for a given run. - Subsolvers []string `protobuf:"bytes,207,rep,name=subsolvers" json:"subsolvers,omitempty"` - // A convenient way to add more workers types. - // These will be added at the beginning of the list. - ExtraSubsolvers []string `protobuf:"bytes,219,rep,name=extra_subsolvers,json=extraSubsolvers" json:"extra_subsolvers,omitempty"` - // Rather than fully specifying subsolvers, it is often convenient to just - // remove the ones that are not useful on a given problem or only keep - // specific ones for testing. Each string is interpreted as a "glob", so we - // support '*' and '?'. - // - // The way this work is that we will only accept a name that match a filter - // pattern (if non-empty) and do not match an ignore pattern. Note also that - // these fields work on LNS or LS names even if these are currently not - // specified via the subsolvers field. - IgnoreSubsolvers []string `protobuf:"bytes,209,rep,name=ignore_subsolvers,json=ignoreSubsolvers" json:"ignore_subsolvers,omitempty"` - FilterSubsolvers []string `protobuf:"bytes,293,rep,name=filter_subsolvers,json=filterSubsolvers" json:"filter_subsolvers,omitempty"` - // It is possible to specify additional subsolver configuration. These can be - // referred by their params.name() in the fields above. Note that only the - // specified field will "overwrite" the ones of the base parameter. If a - // subsolver_params has the name of an existing subsolver configuration, the - // named parameters will be merged into the subsolver configuration. - SubsolverParams []*SatParameters `protobuf:"bytes,210,rep,name=subsolver_params,json=subsolverParams" json:"subsolver_params,omitempty"` - // Experimental. If this is true, then we interleave all our major search - // strategy and distribute the work amongst num_workers. - // - // The search is deterministic (independently of num_workers!), and we - // schedule and wait for interleave_batch_size task to be completed before - // synchronizing and scheduling the next batch of tasks. - InterleaveSearch *bool `protobuf:"varint,136,opt,name=interleave_search,json=interleaveSearch,def=0" json:"interleave_search,omitempty"` - InterleaveBatchSize *int32 `protobuf:"varint,134,opt,name=interleave_batch_size,json=interleaveBatchSize,def=0" json:"interleave_batch_size,omitempty"` - // Allows objective sharing between workers. - ShareObjectiveBounds *bool `protobuf:"varint,113,opt,name=share_objective_bounds,json=shareObjectiveBounds,def=1" json:"share_objective_bounds,omitempty"` - // Allows sharing of the bounds of modified variables at level 0. - ShareLevelZeroBounds *bool `protobuf:"varint,114,opt,name=share_level_zero_bounds,json=shareLevelZeroBounds,def=1" json:"share_level_zero_bounds,omitempty"` - // Allows sharing of the bounds on linear2 discovered at level 0. This is - // mainly interesting on scheduling type of problems when we branch on - // precedences. - // - // Warning: This currently non-deterministic. - ShareLinear2Bounds *bool `protobuf:"varint,326,opt,name=share_linear2_bounds,json=shareLinear2Bounds,def=0" json:"share_linear2_bounds,omitempty"` - // Allows sharing of new learned binary clause between workers. - ShareBinaryClauses *bool `protobuf:"varint,203,opt,name=share_binary_clauses,json=shareBinaryClauses,def=1" json:"share_binary_clauses,omitempty"` - // Allows sharing of short glue clauses between workers. - // Implicitly disabled if share_binary_clauses is false. - ShareGlueClauses *bool `protobuf:"varint,285,opt,name=share_glue_clauses,json=shareGlueClauses,def=1" json:"share_glue_clauses,omitempty"` - // Minimize and detect subsumption of shared clauses immediately after they - // are imported. - MinimizeSharedClauses *bool `protobuf:"varint,300,opt,name=minimize_shared_clauses,json=minimizeSharedClauses,def=1" json:"minimize_shared_clauses,omitempty"` - // The amount of dtime between each export of shared glue clauses. - ShareGlueClausesDtime *float64 `protobuf:"fixed64,322,opt,name=share_glue_clauses_dtime,json=shareGlueClausesDtime,def=1" json:"share_glue_clauses_dtime,omitempty"` - // If true, inferred clauses are checked with an LRAT checker as they are - // learned, in presolve (reduced to trivial simplifications if - // cp_model_presolve is false), and in each worker. As of December 2025, this - // only works with pure SAT problems, with - // - cp_model_presolve = false, - // - linearization_level <= 1, - // - symmetry_level <= 1. - CheckLratProof *bool `protobuf:"varint,344,opt,name=check_lrat_proof,json=checkLratProof,def=0" json:"check_lrat_proof,omitempty"` - // If true, and if output_lrat_proof is true and the problem is UNSAT, check - // that the merged proof file is valid, i.e., that clause sharing between - // workers is correct. This checks each inferred clause, so you might want to - // disable check_lrat_proof to avoid redundant work. As of November 2025, this - // only works for pure SAT problems, with num_workers = 1. - CheckMergedLratProof *bool `protobuf:"varint,352,opt,name=check_merged_lrat_proof,json=checkMergedLratProof,def=0" json:"check_merged_lrat_proof,omitempty"` - // If true, an LRAT proof that all the clauses inferred by the solver are - // valid is output to several files (one for presolve -- reduced to trivial - // simplifications if cp_model_presolve is false, one per worker, and one for - // the merged proof). As of December 2025, this only works for pure SAT - // problems, with - // - cp_model_presolve = false, - // - linearization_level <= 1, - // - symmetry_level <= 1. - OutputLratProof *bool `protobuf:"varint,345,opt,name=output_lrat_proof,json=outputLratProof,def=0" json:"output_lrat_proof,omitempty"` - // If true, and if the problem is UNSAT, a DRAT proof of this UNSAT property - // is checked after the solver has finished. As of November 2025, this only - // works for pure SAT problems, with - // - num_workers = 1, - // - cp_model_presolve = false, - // - linearization_level <= 1, - // - symmetry_level <= 1. - CheckDratProof *bool `protobuf:"varint,346,opt,name=check_drat_proof,json=checkDratProof,def=0" json:"check_drat_proof,omitempty"` - // If true, a DRAT proof that all the clauses inferred by the solver are valid - // is output to a file. As of December 2025, this only works for pure SAT - // problems, with - // - num_workers = 1, - // - cp_model_presolve = false, - // - linearization_level <= 1, - // - symmetry_level <= 1. - OutputDratProof *bool `protobuf:"varint,347,opt,name=output_drat_proof,json=outputDratProof,def=0" json:"output_drat_proof,omitempty"` - // The maximum time allowed to check the DRAT proof (this can take more time - // than the solve itself). Only used if check_drat_proof is true. - MaxDratTimeInSeconds *float64 `protobuf:"fixed64,348,opt,name=max_drat_time_in_seconds,json=maxDratTimeInSeconds,def=inf" json:"max_drat_time_in_seconds,omitempty"` - // We have two different postsolve code. The default one should be better and - // it allows for a more powerful presolve, but it can be useful to postsolve - // using the full solver instead. - DebugPostsolveWithFullSolver *bool `protobuf:"varint,162,opt,name=debug_postsolve_with_full_solver,json=debugPostsolveWithFullSolver,def=0" json:"debug_postsolve_with_full_solver,omitempty"` - // If positive, try to stop just after that many presolve rules have been - // applied. This is mainly useful for debugging presolve. - DebugMaxNumPresolveOperations *int32 `protobuf:"varint,151,opt,name=debug_max_num_presolve_operations,json=debugMaxNumPresolveOperations,def=0" json:"debug_max_num_presolve_operations,omitempty"` - // Crash if we do not manage to complete the hint into a full solution. - DebugCrashOnBadHint *bool `protobuf:"varint,195,opt,name=debug_crash_on_bad_hint,json=debugCrashOnBadHint,def=0" json:"debug_crash_on_bad_hint,omitempty"` - // Crash if presolve breaks a feasible hint. - DebugCrashIfPresolveBreaksHint *bool `protobuf:"varint,306,opt,name=debug_crash_if_presolve_breaks_hint,json=debugCrashIfPresolveBreaksHint,def=0" json:"debug_crash_if_presolve_breaks_hint,omitempty"` - // Crash if the LRAT UNSAT proof is invalid. - DebugCrashIfLratCheckFails *bool `protobuf:"varint,339,opt,name=debug_crash_if_lrat_check_fails,json=debugCrashIfLratCheckFails,def=0" json:"debug_crash_if_lrat_check_fails,omitempty"` - // For an optimization problem, whether we follow some hints in order to find - // a better first solution. For a variable with hint, the solver will always - // try to follow the hint. It will revert to the variable_branching default - // otherwise. - UseOptimizationHints *bool `protobuf:"varint,35,opt,name=use_optimization_hints,json=useOptimizationHints,def=1" json:"use_optimization_hints,omitempty"` - // If positive, we spend some effort on each core: - // - At level 1, we use a simple heuristic to try to minimize an UNSAT core. - // - At level 2, we use propagation to minimize the core but also identify - // literal in at most one relationship in this core. - CoreMinimizationLevel *int32 `protobuf:"varint,50,opt,name=core_minimization_level,json=coreMinimizationLevel,def=2" json:"core_minimization_level,omitempty"` - // Whether we try to find more independent cores for a given set of - // assumptions in the core based max-SAT algorithms. - FindMultipleCores *bool `protobuf:"varint,84,opt,name=find_multiple_cores,json=findMultipleCores,def=1" json:"find_multiple_cores,omitempty"` - // If true, when the max-sat algo find a core, we compute the minimal number - // of literals in the core that needs to be true to have a feasible solution. - // This is also called core exhaustion in more recent max-SAT papers. - CoverOptimization *bool `protobuf:"varint,89,opt,name=cover_optimization,json=coverOptimization,def=1" json:"cover_optimization,omitempty"` - MaxSatAssumptionOrder *SatParameters_MaxSatAssumptionOrder `protobuf:"varint,51,opt,name=max_sat_assumption_order,json=maxSatAssumptionOrder,enum=operations_research.sat.SatParameters_MaxSatAssumptionOrder,def=0" json:"max_sat_assumption_order,omitempty"` - // If true, adds the assumption in the reverse order of the one defined by - // max_sat_assumption_order. - MaxSatReverseAssumptionOrder *bool `protobuf:"varint,52,opt,name=max_sat_reverse_assumption_order,json=maxSatReverseAssumptionOrder,def=0" json:"max_sat_reverse_assumption_order,omitempty"` - MaxSatStratification *SatParameters_MaxSatStratificationAlgorithm `protobuf:"varint,53,opt,name=max_sat_stratification,json=maxSatStratification,enum=operations_research.sat.SatParameters_MaxSatStratificationAlgorithm,def=1" json:"max_sat_stratification,omitempty"` - // Some search decisions might cause a really large number of propagations to - // happen when integer variables with large domains are only reduced by 1 at - // each step. If we propagate more than the number of variable times this - // parameters we try to take counter-measure. Setting this to 0.0 disable this - // feature. - // - // TODO(user): Setting this to something like 10 helps in most cases, but the - // code is currently buggy and can cause the solve to enter a bad state where - // no progress is made. - PropagationLoopDetectionFactor *float64 `protobuf:"fixed64,221,opt,name=propagation_loop_detection_factor,json=propagationLoopDetectionFactor,def=10" json:"propagation_loop_detection_factor,omitempty"` - // When this is true, then a disjunctive constraint will try to use the - // precedence relations between time intervals to propagate their bounds - // further. For instance if task A and B are both before C and task A and B - // are in disjunction, then we can deduce that task C must start after - // duration(A) + duration(B) instead of simply max(duration(A), duration(B)), - // provided that the start time for all task was currently zero. - // - // This always result in better propagation, but it is usually slow, so - // depending on the problem, turning this off may lead to a faster solution. - UsePrecedencesInDisjunctiveConstraint *bool `protobuf:"varint,74,opt,name=use_precedences_in_disjunctive_constraint,json=usePrecedencesInDisjunctiveConstraint,def=1" json:"use_precedences_in_disjunctive_constraint,omitempty"` - // At root level, we might compute the transitive closure of "precedences" - // relations so that we can exploit that in scheduling problems. Setting this - // to zero disable the feature. - TransitivePrecedencesWorkLimit *int32 `protobuf:"varint,327,opt,name=transitive_precedences_work_limit,json=transitivePrecedencesWorkLimit,def=1000000" json:"transitive_precedences_work_limit,omitempty"` - // Create one literal for each disjunction of two pairs of tasks. This slows - // down the solve time, but improves the lower bound of the objective in the - // makespan case. This will be triggered if the number of intervals is less or - // equal than the parameter and if use_strong_propagation_in_disjunctive is - // true. - MaxSizeToCreatePrecedenceLiteralsInDisjunctive *int32 `protobuf:"varint,229,opt,name=max_size_to_create_precedence_literals_in_disjunctive,json=maxSizeToCreatePrecedenceLiteralsInDisjunctive,def=60" json:"max_size_to_create_precedence_literals_in_disjunctive,omitempty"` - // Enable stronger and more expensive propagation on no_overlap constraint. - UseStrongPropagationInDisjunctive *bool `protobuf:"varint,230,opt,name=use_strong_propagation_in_disjunctive,json=useStrongPropagationInDisjunctive,def=0" json:"use_strong_propagation_in_disjunctive,omitempty"` - // Whether we try to branch on decision "interval A before interval B" rather - // than on intervals bounds. This usually works better, but slow down a bit - // the time to find the first solution. - // - // These parameters are still EXPERIMENTAL, the result should be correct, but - // it some corner cases, they can cause some failing CHECK in the solver. - UseDynamicPrecedenceInDisjunctive *bool `protobuf:"varint,263,opt,name=use_dynamic_precedence_in_disjunctive,json=useDynamicPrecedenceInDisjunctive,def=0" json:"use_dynamic_precedence_in_disjunctive,omitempty"` - UseDynamicPrecedenceInCumulative *bool `protobuf:"varint,268,opt,name=use_dynamic_precedence_in_cumulative,json=useDynamicPrecedenceInCumulative,def=0" json:"use_dynamic_precedence_in_cumulative,omitempty"` - // When this is true, the cumulative constraint is reinforced with overload - // checking, i.e., an additional level of reasoning based on energy. This - // additional level supplements the default level of reasoning as well as - // timetable edge finding. - // - // This always result in better propagation, but it is usually slow, so - // depending on the problem, turning this off may lead to a faster solution. - UseOverloadCheckerInCumulative *bool `protobuf:"varint,78,opt,name=use_overload_checker_in_cumulative,json=useOverloadCheckerInCumulative,def=0" json:"use_overload_checker_in_cumulative,omitempty"` - // Enable a heuristic to solve cumulative constraints using a modified energy - // constraint. We modify the usual energy definition by applying a - // super-additive function (also called "conservative scale" or "dual-feasible - // function") to the demand and the durations of the tasks. - // - // This heuristic is fast but for most problems it does not help much to find - // a solution. - UseConservativeScaleOverloadChecker *bool `protobuf:"varint,286,opt,name=use_conservative_scale_overload_checker,json=useConservativeScaleOverloadChecker,def=0" json:"use_conservative_scale_overload_checker,omitempty"` - // When this is true, the cumulative constraint is reinforced with timetable - // edge finding, i.e., an additional level of reasoning based on the - // conjunction of energy and mandatory parts. This additional level - // supplements the default level of reasoning as well as overload_checker. - // - // This always result in better propagation, but it is usually slow, so - // depending on the problem, turning this off may lead to a faster solution. - UseTimetableEdgeFindingInCumulative *bool `protobuf:"varint,79,opt,name=use_timetable_edge_finding_in_cumulative,json=useTimetableEdgeFindingInCumulative,def=0" json:"use_timetable_edge_finding_in_cumulative,omitempty"` - // Max number of intervals for the timetable_edge_finding algorithm to - // propagate. A value of 0 disables the constraint. - MaxNumIntervalsForTimetableEdgeFinding *int32 `protobuf:"varint,260,opt,name=max_num_intervals_for_timetable_edge_finding,json=maxNumIntervalsForTimetableEdgeFinding,def=100" json:"max_num_intervals_for_timetable_edge_finding,omitempty"` - // If true, detect and create constraint for integer variable that are "after" - // a set of intervals in the same cumulative constraint. - // - // Experimental: by default we just use "direct" precedences. If - // exploit_all_precedences is true, we explore the full precedence graph. This - // assumes we have a DAG otherwise it fails. - UseHardPrecedencesInCumulative *bool `protobuf:"varint,215,opt,name=use_hard_precedences_in_cumulative,json=useHardPrecedencesInCumulative,def=0" json:"use_hard_precedences_in_cumulative,omitempty"` - ExploitAllPrecedences *bool `protobuf:"varint,220,opt,name=exploit_all_precedences,json=exploitAllPrecedences,def=0" json:"exploit_all_precedences,omitempty"` - // When this is true, the cumulative constraint is reinforced with propagators - // from the disjunctive constraint to improve the inference on a set of tasks - // that are disjunctive at the root of the problem. This additional level - // supplements the default level of reasoning. - // - // Propagators of the cumulative constraint will not be used at all if all the - // tasks are disjunctive at root node. - // - // This always result in better propagation, but it is usually slow, so - // depending on the problem, turning this off may lead to a faster solution. - UseDisjunctiveConstraintInCumulative *bool `protobuf:"varint,80,opt,name=use_disjunctive_constraint_in_cumulative,json=useDisjunctiveConstraintInCumulative,def=1" json:"use_disjunctive_constraint_in_cumulative,omitempty"` - // If less than this number of boxes are present in a no-overlap 2d, we - // create 4 Booleans per pair of boxes: - // - Box 2 is after Box 1 on x. - // - Box 1 is after Box 2 on x. - // - Box 2 is after Box 1 on y. - // - Box 1 is after Box 2 on y. - // - // Note that at least one of them must be true, and at most one on x and one - // on y can be true. - // - // This can significantly help in closing small problem. The SAT reasoning - // can be a lot more powerful when we take decision on such positional - // relations. - NoOverlap_2DBooleanRelationsLimit *int32 `protobuf:"varint,321,opt,name=no_overlap_2d_boolean_relations_limit,json=noOverlap2dBooleanRelationsLimit,def=10" json:"no_overlap_2d_boolean_relations_limit,omitempty"` - // When this is true, the no_overlap_2d constraint is reinforced with - // propagators from the cumulative constraints. It consists of ignoring the - // position of rectangles in one position and projecting the no_overlap_2d on - // the other dimension to create a cumulative constraint. This is done on both - // axis. This additional level supplements the default level of reasoning. - UseTimetablingInNoOverlap_2D *bool `protobuf:"varint,200,opt,name=use_timetabling_in_no_overlap_2d,json=useTimetablingInNoOverlap2d,def=0" json:"use_timetabling_in_no_overlap_2d,omitempty"` - // When this is true, the no_overlap_2d constraint is reinforced with - // energetic reasoning. This additional level supplements the default level of - // reasoning. - UseEnergeticReasoningInNoOverlap_2D *bool `protobuf:"varint,213,opt,name=use_energetic_reasoning_in_no_overlap_2d,json=useEnergeticReasoningInNoOverlap2d,def=0" json:"use_energetic_reasoning_in_no_overlap_2d,omitempty"` - // When this is true, the no_overlap_2d constraint is reinforced with - // an energetic reasoning that uses an area-based energy. This can be combined - // with the two other overlap heuristics above. - UseAreaEnergeticReasoningInNoOverlap_2D *bool `protobuf:"varint,271,opt,name=use_area_energetic_reasoning_in_no_overlap_2d,json=useAreaEnergeticReasoningInNoOverlap2d,def=0" json:"use_area_energetic_reasoning_in_no_overlap_2d,omitempty"` - UseTryEdgeReasoningInNoOverlap_2D *bool `protobuf:"varint,299,opt,name=use_try_edge_reasoning_in_no_overlap_2d,json=useTryEdgeReasoningInNoOverlap2d,def=0" json:"use_try_edge_reasoning_in_no_overlap_2d,omitempty"` - // If the number of pairs to look is below this threshold, do an extra step of - // propagation in the no_overlap_2d constraint by looking at all pairs of - // intervals. - MaxPairsPairwiseReasoningInNoOverlap_2D *int32 `protobuf:"varint,276,opt,name=max_pairs_pairwise_reasoning_in_no_overlap_2d,json=maxPairsPairwiseReasoningInNoOverlap2d,def=1250" json:"max_pairs_pairwise_reasoning_in_no_overlap_2d,omitempty"` - // Detects when the space where items of a no_overlap_2d constraint can placed - // is disjoint (ie., fixed boxes split the domain). When it is the case, we - // can introduce a boolean for each pair encoding whether - // the item is in the component or not. Then we replace the original - // no_overlap_2d constraint by one no_overlap_2d constraint for each - // component, with the new booleans as the enforcement_literal of the - // intervals. This is equivalent to expanding the original no_overlap_2d - // constraint into a bin packing problem with each connected component being a - // bin. This heuristic is only done when the number of regions to split - // is less than this parameter and <= 1 disables it. - MaximumRegionsToSplitInDisconnectedNoOverlap_2D *int32 `protobuf:"varint,315,opt,name=maximum_regions_to_split_in_disconnected_no_overlap_2d,json=maximumRegionsToSplitInDisconnectedNoOverlap2d,def=0" json:"maximum_regions_to_split_in_disconnected_no_overlap_2d,omitempty"` - // When set, this activates a propagator for the no_overlap_2d constraint that - // uses any eventual linear constraints of the model in the form - // `{start interval 1} - {end interval 2} + c*w <= ub` to detect that two - // intervals must overlap in one dimension for some values of `w`. This is - // particularly useful for problems where the distance between two boxes is - // part of the model. - UseLinear3ForNoOverlap_2DPrecedences *bool `protobuf:"varint,323,opt,name=use_linear3_for_no_overlap_2d_precedences,json=useLinear3ForNoOverlap2dPrecedences,def=1" json:"use_linear3_for_no_overlap_2d_precedences,omitempty"` - // When set, it activates a few scheduling parameters to improve the lower - // bound of scheduling problems. This is only effective with multiple workers - // as it modifies the reduced_cost, lb_tree_search, and probing workers. - UseDualSchedulingHeuristics *bool `protobuf:"varint,214,opt,name=use_dual_scheduling_heuristics,json=useDualSchedulingHeuristics,def=1" json:"use_dual_scheduling_heuristics,omitempty"` - // Turn on extra propagation for the circuit constraint. - // This can be quite slow. - UseAllDifferentForCircuit *bool `protobuf:"varint,311,opt,name=use_all_different_for_circuit,json=useAllDifferentForCircuit,def=0" json:"use_all_different_for_circuit,omitempty"` - // If the size of a subset of nodes of a RoutesConstraint is less than this - // value, use linear constraints of size 1 and 2 (such as capacity and time - // window constraints) enforced by the arc literals to compute cuts for this - // subset (unless the subset size is less than - // routing_cut_subset_size_for_tight_binary_relation_bound, in which case the - // corresponding algorithm is used instead). The algorithm for these cuts has - // a O(n^3) complexity, where n is the subset size. Hence the value of this - // parameter should not be too large (e.g. 10 or 20). - RoutingCutSubsetSizeForBinaryRelationBound *int32 `protobuf:"varint,312,opt,name=routing_cut_subset_size_for_binary_relation_bound,json=routingCutSubsetSizeForBinaryRelationBound,def=0" json:"routing_cut_subset_size_for_binary_relation_bound,omitempty"` - // Similar to above, but with a different algorithm producing better cuts, at - // the price of a higher O(2^n) complexity, where n is the subset size. Hence - // the value of this parameter should be small (e.g. less than 10). - RoutingCutSubsetSizeForTightBinaryRelationBound *int32 `protobuf:"varint,313,opt,name=routing_cut_subset_size_for_tight_binary_relation_bound,json=routingCutSubsetSizeForTightBinaryRelationBound,def=0" json:"routing_cut_subset_size_for_tight_binary_relation_bound,omitempty"` - // Similar to above, but with an even stronger algorithm in O(n!). We try to - // be defensive and abort early or not run that often. Still the value of - // that parameter shouldn't really be much more than 10. - RoutingCutSubsetSizeForExactBinaryRelationBound *int32 `protobuf:"varint,316,opt,name=routing_cut_subset_size_for_exact_binary_relation_bound,json=routingCutSubsetSizeForExactBinaryRelationBound,def=8" json:"routing_cut_subset_size_for_exact_binary_relation_bound,omitempty"` - // Similar to routing_cut_subset_size_for_exact_binary_relation_bound but - // use a bound based on shortest path distances (which respect triangular - // inequality). This allows to derive bounds that are valid for any superset - // of a given subset. This is slow, so it shouldn't really be larger than 10. - RoutingCutSubsetSizeForShortestPathsBound *int32 `protobuf:"varint,318,opt,name=routing_cut_subset_size_for_shortest_paths_bound,json=routingCutSubsetSizeForShortestPathsBound,def=8" json:"routing_cut_subset_size_for_shortest_paths_bound,omitempty"` - // The amount of "effort" to spend in dynamic programming for computing - // routing cuts. This is in term of basic operations needed by the algorithm - // in the worst case, so a value like 1e8 should take less than a second to - // compute. - RoutingCutDpEffort *float64 `protobuf:"fixed64,314,opt,name=routing_cut_dp_effort,json=routingCutDpEffort,def=1e+07" json:"routing_cut_dp_effort,omitempty"` - // If the length of an infeasible path is less than this value, a cut will be - // added to exclude it. - RoutingCutMaxInfeasiblePathLength *int32 `protobuf:"varint,317,opt,name=routing_cut_max_infeasible_path_length,json=routingCutMaxInfeasiblePathLength,def=6" json:"routing_cut_max_infeasible_path_length,omitempty"` - SearchBranching *SatParameters_SearchBranching `protobuf:"varint,82,opt,name=search_branching,json=searchBranching,enum=operations_research.sat.SatParameters_SearchBranching,def=0" json:"search_branching,omitempty"` - // Conflict limit used in the phase that exploit the solution hint. - HintConflictLimit *int32 `protobuf:"varint,153,opt,name=hint_conflict_limit,json=hintConflictLimit,def=10" json:"hint_conflict_limit,omitempty"` - // If true, the solver tries to repair the solution given in the hint. This - // search terminates after the 'hint_conflict_limit' is reached and the solver - // switches to regular search. If false, then we do a FIXED_SEARCH using the - // hint until the hint_conflict_limit is reached. - RepairHint *bool `protobuf:"varint,167,opt,name=repair_hint,json=repairHint,def=0" json:"repair_hint,omitempty"` - // If true, variables appearing in the solution hints will be fixed to their - // hinted value. - FixVariablesToTheirHintedValue *bool `protobuf:"varint,192,opt,name=fix_variables_to_their_hinted_value,json=fixVariablesToTheirHintedValue,def=0" json:"fix_variables_to_their_hinted_value,omitempty"` - // If true, search will continuously probe Boolean variables, and integer - // variable bounds. This parameter is set to true in parallel on the probing - // worker. - UseProbingSearch *bool `protobuf:"varint,176,opt,name=use_probing_search,json=useProbingSearch,def=0" json:"use_probing_search,omitempty"` - // Use extended probing (probe bool_or, at_most_one, exactly_one). - UseExtendedProbing *bool `protobuf:"varint,269,opt,name=use_extended_probing,json=useExtendedProbing,def=1" json:"use_extended_probing,omitempty"` - // How many combinations of pairs or triplets of variables we want to scan. - ProbingNumCombinationsLimit *int32 `protobuf:"varint,272,opt,name=probing_num_combinations_limit,json=probingNumCombinationsLimit,def=20000" json:"probing_num_combinations_limit,omitempty"` - // Add a shaving phase (where the solver tries to prove that the lower or - // upper bound of a variable are infeasible) to the probing search. (<= 0 - // disables it). - ShavingDeterministicTimeInProbingSearch *float64 `protobuf:"fixed64,204,opt,name=shaving_deterministic_time_in_probing_search,json=shavingDeterministicTimeInProbingSearch,def=0.001" json:"shaving_deterministic_time_in_probing_search,omitempty"` - // Specifies the amount of deterministic time spent of each try at shaving a - // bound in the shaving search. - ShavingSearchDeterministicTime *float64 `protobuf:"fixed64,205,opt,name=shaving_search_deterministic_time,json=shavingSearchDeterministicTime,def=0.1" json:"shaving_search_deterministic_time,omitempty"` - // Specifies the threshold between two modes in the shaving procedure. - // If the range of the variable/objective is less than this threshold, then - // the shaving procedure will try to remove values one by one. Otherwise, it - // will try to remove one range at a time. - ShavingSearchThreshold *int64 `protobuf:"varint,290,opt,name=shaving_search_threshold,json=shavingSearchThreshold,def=64" json:"shaving_search_threshold,omitempty"` - // If true, search will search in ascending max objective value (when - // minimizing) starting from the lower bound of the objective. - UseObjectiveLbSearch *bool `protobuf:"varint,228,opt,name=use_objective_lb_search,json=useObjectiveLbSearch,def=0" json:"use_objective_lb_search,omitempty"` - // This search differs from the previous search as it will not use assumptions - // to bound the objective, and it will recreate a full model with the - // hardcoded objective value. - UseObjectiveShavingSearch *bool `protobuf:"varint,253,opt,name=use_objective_shaving_search,json=useObjectiveShavingSearch,def=0" json:"use_objective_shaving_search,omitempty"` - // This search takes all Boolean or integer variables, and maximize or - // minimize them in order to reduce their domain. -1 is automatic, otherwise - // value 0 disables it, and 1, 2, or 3 changes something. - VariablesShavingLevel *int32 `protobuf:"varint,289,opt,name=variables_shaving_level,json=variablesShavingLevel,def=-1" json:"variables_shaving_level,omitempty"` - // The solver ignores the pseudo costs of variables with number of recordings - // less than this threshold. - PseudoCostReliabilityThreshold *int64 `protobuf:"varint,123,opt,name=pseudo_cost_reliability_threshold,json=pseudoCostReliabilityThreshold,def=100" json:"pseudo_cost_reliability_threshold,omitempty"` - // The default optimization method is a simple "linear scan", each time trying - // to find a better solution than the previous one. If this is true, then we - // use a core-based approach (like in max-SAT) when we try to increase the - // lower bound instead. - OptimizeWithCore *bool `protobuf:"varint,83,opt,name=optimize_with_core,json=optimizeWithCore,def=0" json:"optimize_with_core,omitempty"` - // Do a more conventional tree search (by opposition to SAT based one) where - // we keep all the explored node in a tree. This is meant to be used in a - // portfolio and focus on improving the objective lower bound. Keeping the - // whole tree allow us to report a better objective lower bound coming from - // the worst open node in the tree. - OptimizeWithLbTreeSearch *bool `protobuf:"varint,188,opt,name=optimize_with_lb_tree_search,json=optimizeWithLbTreeSearch,def=0" json:"optimize_with_lb_tree_search,omitempty"` - // Experimental. Save the current LP basis at each node of the search tree so - // that when we jump around, we can load it and reduce the number of LP - // iterations needed. - // - // It currently works okay if we do not change the lp with cuts or - // simplification... More work is needed to make it robust in all cases. - SaveLpBasisInLbTreeSearch *bool `protobuf:"varint,284,opt,name=save_lp_basis_in_lb_tree_search,json=saveLpBasisInLbTreeSearch,def=0" json:"save_lp_basis_in_lb_tree_search,omitempty"` - // If non-negative, perform a binary search on the objective variable in order - // to find an [min, max] interval outside of which the solver proved unsat/sat - // under this amount of conflict. This can quickly reduce the objective domain - // on some problems. - BinarySearchNumConflicts *int32 `protobuf:"varint,99,opt,name=binary_search_num_conflicts,json=binarySearchNumConflicts,def=-1" json:"binary_search_num_conflicts,omitempty"` - // This has no effect if optimize_with_core is false. If true, use a different - // core-based algorithm similar to the max-HS algo for max-SAT. This is a - // hybrid MIP/CP approach and it uses a MIP solver in addition to the CP/SAT - // one. This is also related to the PhD work of tobyodavies@ - // "Automatic Logic-Based Benders Decomposition with MiniZinc" - // http://aaai.org/ocs/index.php/AAAI/AAAI17/paper/view/14489 - OptimizeWithMaxHs *bool `protobuf:"varint,85,opt,name=optimize_with_max_hs,json=optimizeWithMaxHs,def=0" json:"optimize_with_max_hs,omitempty"` - // Parameters for an heuristic similar to the one described in the paper: - // "Feasibility Jump: an LP-free Lagrangian MIP heuristic", Bjørnar - // Luteberget, Giorgio Sartor, 2023, Mathematical Programming Computation. - UseFeasibilityJump *bool `protobuf:"varint,265,opt,name=use_feasibility_jump,json=useFeasibilityJump,def=1" json:"use_feasibility_jump,omitempty"` - // Disable every other type of subsolver, setting this turns CP-SAT into a - // pure local-search solver. - UseLsOnly *bool `protobuf:"varint,240,opt,name=use_ls_only,json=useLsOnly,def=0" json:"use_ls_only,omitempty"` - // On each restart, we randomly choose if we use decay (with this parameter) - // or no decay. - FeasibilityJumpDecay *float64 `protobuf:"fixed64,242,opt,name=feasibility_jump_decay,json=feasibilityJumpDecay,def=0.95" json:"feasibility_jump_decay,omitempty"` - // How much do we linearize the problem in the local search code. - FeasibilityJumpLinearizationLevel *int32 `protobuf:"varint,257,opt,name=feasibility_jump_linearization_level,json=feasibilityJumpLinearizationLevel,def=2" json:"feasibility_jump_linearization_level,omitempty"` - // This is a factor that directly influence the work before each restart. - // Increasing it leads to longer restart. - FeasibilityJumpRestartFactor *int32 `protobuf:"varint,258,opt,name=feasibility_jump_restart_factor,json=feasibilityJumpRestartFactor,def=1" json:"feasibility_jump_restart_factor,omitempty"` - // How much dtime for each LS batch. - FeasibilityJumpBatchDtime *float64 `protobuf:"fixed64,292,opt,name=feasibility_jump_batch_dtime,json=feasibilityJumpBatchDtime,def=0.1" json:"feasibility_jump_batch_dtime,omitempty"` - // Probability for a variable to have a non default value upon restarts or - // perturbations. - FeasibilityJumpVarRandomizationProbability *float64 `protobuf:"fixed64,247,opt,name=feasibility_jump_var_randomization_probability,json=feasibilityJumpVarRandomizationProbability,def=0.05" json:"feasibility_jump_var_randomization_probability,omitempty"` - // Max distance between the default value and the pertubated value relative to - // the range of the domain of the variable. - FeasibilityJumpVarPerburbationRangeRatio *float64 `protobuf:"fixed64,248,opt,name=feasibility_jump_var_perburbation_range_ratio,json=feasibilityJumpVarPerburbationRangeRatio,def=0.2" json:"feasibility_jump_var_perburbation_range_ratio,omitempty"` - // When stagnating, feasibility jump will either restart from a default - // solution (with some possible randomization), or randomly pertubate the - // current solution. This parameter selects the first option. - FeasibilityJumpEnableRestarts *bool `protobuf:"varint,250,opt,name=feasibility_jump_enable_restarts,json=feasibilityJumpEnableRestarts,def=1" json:"feasibility_jump_enable_restarts,omitempty"` - // Maximum size of no_overlap or no_overlap_2d constraint for a quadratic - // expansion. This might look a lot, but by expanding such constraint, we get - // a linear time evaluation per single variable moves instead of a slow O(n - // log n) one. - FeasibilityJumpMaxExpandedConstraintSize *int32 `protobuf:"varint,264,opt,name=feasibility_jump_max_expanded_constraint_size,json=feasibilityJumpMaxExpandedConstraintSize,def=500" json:"feasibility_jump_max_expanded_constraint_size,omitempty"` - // This will create incomplete subsolvers (that are not LNS subsolvers) - // that use the feasibility jump code to find improving solution, treating - // the objective improvement as a hard constraint. - NumViolationLs *int32 `protobuf:"varint,244,opt,name=num_violation_ls,json=numViolationLs,def=0" json:"num_violation_ls,omitempty"` - // How long violation_ls should wait before perturbating a solution. - ViolationLsPerturbationPeriod *int32 `protobuf:"varint,249,opt,name=violation_ls_perturbation_period,json=violationLsPerturbationPeriod,def=100" json:"violation_ls_perturbation_period,omitempty"` - // Probability of using compound move search each restart. - // TODO(user): Add reference to paper when published. - ViolationLsCompoundMoveProbability *float64 `protobuf:"fixed64,259,opt,name=violation_ls_compound_move_probability,json=violationLsCompoundMoveProbability,def=0.5" json:"violation_ls_compound_move_probability,omitempty"` - // Enables shared tree search. - // If positive, start this many complete worker threads to explore a shared - // search tree. These workers communicate objective bounds and simple decision - // nogoods relating to the shared prefix of the tree, and will avoid exploring - // the same subtrees as one another. - // Specifying a negative number uses a heuristic to select an appropriate - // number of shared tree workeres based on the total number of workers. - SharedTreeNumWorkers *int32 `protobuf:"varint,235,opt,name=shared_tree_num_workers,json=sharedTreeNumWorkers,def=-1" json:"shared_tree_num_workers,omitempty"` - // Set on shared subtree workers. Users should not set this directly. - UseSharedTreeSearch *bool `protobuf:"varint,236,opt,name=use_shared_tree_search,json=useSharedTreeSearch,def=0" json:"use_shared_tree_search,omitempty"` - // Minimum restarts before a worker will replace a subtree - // that looks "bad" based on the average LBD of learned clauses. - SharedTreeWorkerMinRestartsPerSubtree *int32 `protobuf:"varint,282,opt,name=shared_tree_worker_min_restarts_per_subtree,json=sharedTreeWorkerMinRestartsPerSubtree,def=1" json:"shared_tree_worker_min_restarts_per_subtree,omitempty"` - // If true, workers share more of the information from their local trail. - // Specifically, literals implied by the shared tree decisions. - SharedTreeWorkerEnableTrailSharing *bool `protobuf:"varint,295,opt,name=shared_tree_worker_enable_trail_sharing,json=sharedTreeWorkerEnableTrailSharing,def=1" json:"shared_tree_worker_enable_trail_sharing,omitempty"` - // If true, shared tree workers share their target phase when returning an - // assigned subtree for the next worker to use. - SharedTreeWorkerEnablePhaseSharing *bool `protobuf:"varint,304,opt,name=shared_tree_worker_enable_phase_sharing,json=sharedTreeWorkerEnablePhaseSharing,def=1" json:"shared_tree_worker_enable_phase_sharing,omitempty"` - // How many open leaf nodes should the shared tree maintain per worker. - SharedTreeOpenLeavesPerWorker *float64 `protobuf:"fixed64,281,opt,name=shared_tree_open_leaves_per_worker,json=sharedTreeOpenLeavesPerWorker,def=2" json:"shared_tree_open_leaves_per_worker,omitempty"` - // In order to limit total shared memory and communication overhead, limit the - // total number of nodes that may be generated in the shared tree. If the - // shared tree runs out of unassigned leaves, workers act as portfolio - // workers. Note: this limit includes interior nodes, not just leaves. - SharedTreeMaxNodesPerWorker *int32 `protobuf:"varint,238,opt,name=shared_tree_max_nodes_per_worker,json=sharedTreeMaxNodesPerWorker,def=10000" json:"shared_tree_max_nodes_per_worker,omitempty"` - SharedTreeSplitStrategy *SatParameters_SharedTreeSplitStrategy `protobuf:"varint,239,opt,name=shared_tree_split_strategy,json=sharedTreeSplitStrategy,enum=operations_research.sat.SatParameters_SharedTreeSplitStrategy,def=0" json:"shared_tree_split_strategy,omitempty"` - // How much deeper compared to the ideal max depth of the tree is considered - // "balanced" enough to still accept a split. Without such a tolerance, - // sometimes the tree can only be split by a single worker, and they may not - // generate a split for some time. In contrast, with a tolerance of 1, at - // least half of all workers should be able to split the tree as soon as a - // split becomes required. This only has an effect on - // SPLIT_STRATEGY_BALANCED_TREE and SPLIT_STRATEGY_DISCREPANCY. - SharedTreeBalanceTolerance *int32 `protobuf:"varint,305,opt,name=shared_tree_balance_tolerance,json=sharedTreeBalanceTolerance,def=1" json:"shared_tree_balance_tolerance,omitempty"` - // How much dtime a worker will wait between proposing splits. - // This limits the contention in splitting the shared tree, and also reduces - // the number of too-easy subtrees that are generates. - SharedTreeSplitMinDtime *float64 `protobuf:"fixed64,328,opt,name=shared_tree_split_min_dtime,json=sharedTreeSplitMinDtime,def=0.1" json:"shared_tree_split_min_dtime,omitempty"` - // Whether we enumerate all solutions of a problem without objective. - // - // WARNING: - // - This can be used with num_workers > 1 but then each solutions can be - // found more than once, so it is up to the client to deduplicate them. - // - If keep_all_feasible_solutions_in_presolve is unset, we will set it to - // true as otherwise, many feasible solution can just be removed by the - // presolve. It is still possible to manually set this to false if one only - // wants to enumerate all solutions of the presolved model. - EnumerateAllSolutions *bool `protobuf:"varint,87,opt,name=enumerate_all_solutions,json=enumerateAllSolutions,def=0" json:"enumerate_all_solutions,omitempty"` - // If true, we disable the presolve reductions that remove feasible solutions - // from the search space. Such solution are usually dominated by a "better" - // solution that is kept, but depending on the situation, we might want to - // keep all solutions. - // - // A trivial example is when a variable is unused. If this is true, then the - // presolve will not fix it to an arbitrary value and it will stay in the - // search space. - KeepAllFeasibleSolutionsInPresolve *bool `protobuf:"varint,173,opt,name=keep_all_feasible_solutions_in_presolve,json=keepAllFeasibleSolutionsInPresolve,def=0" json:"keep_all_feasible_solutions_in_presolve,omitempty"` - // If true, add information about the derived variable domains to the - // CpSolverResponse. It is an option because it makes the response slighly - // bigger and there is a bit more work involved during the postsolve to - // construct it, but it should still have a low overhead. See the - // tightened_variables field in CpSolverResponse for more details. - FillTightenedDomainsInResponse *bool `protobuf:"varint,132,opt,name=fill_tightened_domains_in_response,json=fillTightenedDomainsInResponse,def=0" json:"fill_tightened_domains_in_response,omitempty"` - // If true, the final response addition_solutions field will be filled with - // all solutions from our solutions pool. - // - // Note that if both this field and enumerate_all_solutions is true, we will - // copy to the pool all of the solution found. So if solution_pool_size is big - // enough, you can get all solutions this way instead of using the solution - // callback. - // - // Note that this only affect the "final" solution, not the one passed to the - // solution callbacks. - FillAdditionalSolutionsInResponse *bool `protobuf:"varint,194,opt,name=fill_additional_solutions_in_response,json=fillAdditionalSolutionsInResponse,def=0" json:"fill_additional_solutions_in_response,omitempty"` - // If true, the solver will add a default integer branching strategy to the - // already defined search strategy. If not, some variable might still not be - // fixed at the end of the search. For now we assume these variable can just - // be set to their lower bound. - InstantiateAllVariables *bool `protobuf:"varint,106,opt,name=instantiate_all_variables,json=instantiateAllVariables,def=1" json:"instantiate_all_variables,omitempty"` - // If true, then the precedences propagator try to detect for each variable if - // it has a set of "optional incoming arc" for which at least one of them is - // present. This is usually useful to have but can be slow on model with a lot - // of precedence. - AutoDetectGreaterThanAtLeastOneOf *bool `protobuf:"varint,95,opt,name=auto_detect_greater_than_at_least_one_of,json=autoDetectGreaterThanAtLeastOneOf,def=1" json:"auto_detect_greater_than_at_least_one_of,omitempty"` - // For an optimization problem, stop the solver as soon as we have a solution. - StopAfterFirstSolution *bool `protobuf:"varint,98,opt,name=stop_after_first_solution,json=stopAfterFirstSolution,def=0" json:"stop_after_first_solution,omitempty"` - // Mainly used when improving the presolver. When true, stops the solver after - // the presolve is complete (or after loading and root level propagation). - StopAfterPresolve *bool `protobuf:"varint,149,opt,name=stop_after_presolve,json=stopAfterPresolve,def=0" json:"stop_after_presolve,omitempty"` - StopAfterRootPropagation *bool `protobuf:"varint,252,opt,name=stop_after_root_propagation,json=stopAfterRootPropagation,def=0" json:"stop_after_root_propagation,omitempty"` - // Initial parameters for neighborhood generation. - LnsInitialDifficulty *float64 `protobuf:"fixed64,307,opt,name=lns_initial_difficulty,json=lnsInitialDifficulty,def=0.5" json:"lns_initial_difficulty,omitempty"` - LnsInitialDeterministicLimit *float64 `protobuf:"fixed64,308,opt,name=lns_initial_deterministic_limit,json=lnsInitialDeterministicLimit,def=0.1" json:"lns_initial_deterministic_limit,omitempty"` - // Testing parameters used to disable all lns workers. - UseLns *bool `protobuf:"varint,283,opt,name=use_lns,json=useLns,def=1" json:"use_lns,omitempty"` - // Experimental parameters to disable everything but lns. - UseLnsOnly *bool `protobuf:"varint,101,opt,name=use_lns_only,json=useLnsOnly,def=0" json:"use_lns_only,omitempty"` - // Size of the top-n different solutions kept by the solver. - // This parameter must be > 0. Currently, having this larger than one mainly - // impact the "base" solution chosen for a LNS/LS fragment. - SolutionPoolSize *int32 `protobuf:"varint,193,opt,name=solution_pool_size,json=solutionPoolSize,def=3" json:"solution_pool_size,omitempty"` - // If solution_pool_size is <= this, we will use DP to keep a "diverse" set - // of solutions (the one further apart via hamming distance) in the pool. - // Setting this to large value might be slow, especially if your solution are - // large. - SolutionPoolDiversityLimit *int32 `protobuf:"varint,329,opt,name=solution_pool_diversity_limit,json=solutionPoolDiversityLimit,def=10" json:"solution_pool_diversity_limit,omitempty"` - // In order to not get stuck in local optima, when this is non-zero, we try to - // also work on "older" solutions with a worse objective value so we get a - // chance to follow a different LS/LNS trajectory. - AlternativePoolSize *int32 `protobuf:"varint,325,opt,name=alternative_pool_size,json=alternativePoolSize,def=1" json:"alternative_pool_size,omitempty"` - // Turns on relaxation induced neighborhood generator. - UseRinsLns *bool `protobuf:"varint,129,opt,name=use_rins_lns,json=useRinsLns,def=1" json:"use_rins_lns,omitempty"` - // Adds a feasibility pump subsolver along with lns subsolvers. - UseFeasibilityPump *bool `protobuf:"varint,164,opt,name=use_feasibility_pump,json=useFeasibilityPump,def=1" json:"use_feasibility_pump,omitempty"` - // Turns on neighborhood generator based on local branching LP. Based on Huang - // et al., "Local Branching Relaxation Heuristics for Integer Linear - // Programs", 2023. - UseLbRelaxLns *bool `protobuf:"varint,255,opt,name=use_lb_relax_lns,json=useLbRelaxLns,def=1" json:"use_lb_relax_lns,omitempty"` - // Only use lb-relax if we have at least that many workers. - LbRelaxNumWorkersThreshold *int32 `protobuf:"varint,296,opt,name=lb_relax_num_workers_threshold,json=lbRelaxNumWorkersThreshold,def=16" json:"lb_relax_num_workers_threshold,omitempty"` - FpRounding *SatParameters_FPRoundingMethod `protobuf:"varint,165,opt,name=fp_rounding,json=fpRounding,enum=operations_research.sat.SatParameters_FPRoundingMethod,def=2" json:"fp_rounding,omitempty"` - // If true, registers more lns subsolvers with different parameters. - DiversifyLnsParams *bool `protobuf:"varint,137,opt,name=diversify_lns_params,json=diversifyLnsParams,def=0" json:"diversify_lns_params,omitempty"` - // Randomize fixed search. - RandomizeSearch *bool `protobuf:"varint,103,opt,name=randomize_search,json=randomizeSearch,def=0" json:"randomize_search,omitempty"` - // Search randomization will collect the top - // 'search_random_variable_pool_size' valued variables, and pick one randomly. - // The value of the variable is specific to each strategy. - SearchRandomVariablePoolSize *int64 `protobuf:"varint,104,opt,name=search_random_variable_pool_size,json=searchRandomVariablePoolSize,def=0" json:"search_random_variable_pool_size,omitempty"` - // Experimental code: specify if the objective pushes all tasks toward the - // start of the schedule. - PushAllTasksTowardStart *bool `protobuf:"varint,262,opt,name=push_all_tasks_toward_start,json=pushAllTasksTowardStart,def=0" json:"push_all_tasks_toward_start,omitempty"` - // If true, we automatically detect variables whose constraint are always - // enforced by the same literal and we mark them as optional. This allows - // to propagate them as if they were present in some situation. - // - // TODO(user): This is experimental and seems to lead to wrong optimal in - // some situation. It should however gives correct solutions. Fix. - UseOptionalVariables *bool `protobuf:"varint,108,opt,name=use_optional_variables,json=useOptionalVariables,def=0" json:"use_optional_variables,omitempty"` - // The solver usually exploit the LP relaxation of a model. If this option is - // true, then whatever is infered by the LP will be used like an heuristic to - // compute EXACT propagation on the IP. So with this option, there is no - // numerical imprecision issues. - UseExactLpReason *bool `protobuf:"varint,109,opt,name=use_exact_lp_reason,json=useExactLpReason,def=1" json:"use_exact_lp_reason,omitempty"` - // This can be beneficial if there is a lot of no-overlap constraints but a - // relatively low number of different intervals in the problem. Like 1000 - // intervals, but 1M intervals in the no-overlap constraints covering them. - UseCombinedNoOverlap *bool `protobuf:"varint,133,opt,name=use_combined_no_overlap,json=useCombinedNoOverlap,def=0" json:"use_combined_no_overlap,omitempty"` - // All at_most_one constraints with a size <= param will be replaced by a - // quadratic number of binary implications. - AtMostOneMaxExpansionSize *int32 `protobuf:"varint,270,opt,name=at_most_one_max_expansion_size,json=atMostOneMaxExpansionSize,def=3" json:"at_most_one_max_expansion_size,omitempty"` - // Indicates if the CP-SAT layer should catch Control-C (SIGINT) signals - // when calling solve. If set, catching the SIGINT signal will terminate the - // search gracefully, as if a time limit was reached. - CatchSigintSignal *bool `protobuf:"varint,135,opt,name=catch_sigint_signal,json=catchSigintSignal,def=1" json:"catch_sigint_signal,omitempty"` - // Stores and exploits "implied-bounds" in the solver. That is, relations of - // the form literal => (var >= bound). This is currently used to derive - // stronger cuts. - UseImpliedBounds *bool `protobuf:"varint,144,opt,name=use_implied_bounds,json=useImpliedBounds,def=1" json:"use_implied_bounds,omitempty"` - // Whether we try to do a few degenerate iteration at the end of an LP solve - // to minimize the fractionality of the integer variable in the basis. This - // helps on some problems, but not so much on others. It also cost of bit of - // time to do such polish step. - PolishLpSolution *bool `protobuf:"varint,175,opt,name=polish_lp_solution,json=polishLpSolution,def=0" json:"polish_lp_solution,omitempty"` - // The internal LP tolerances used by CP-SAT. These applies to the internal - // and scaled problem. If the domains of your variables are large it might be - // good to use lower tolerances. If your problem is binary with low - // coefficients, it might be good to use higher ones to speed-up the lp - // solves. - LpPrimalTolerance *float64 `protobuf:"fixed64,266,opt,name=lp_primal_tolerance,json=lpPrimalTolerance,def=1e-07" json:"lp_primal_tolerance,omitempty"` - LpDualTolerance *float64 `protobuf:"fixed64,267,opt,name=lp_dual_tolerance,json=lpDualTolerance,def=1e-07" json:"lp_dual_tolerance,omitempty"` - // Temporary flag util the feature is more mature. This convert intervals to - // the newer proto format that support affine start/var/end instead of just - // variables. - ConvertIntervals *bool `protobuf:"varint,177,opt,name=convert_intervals,json=convertIntervals,def=1" json:"convert_intervals,omitempty"` - // Whether we try to automatically detect the symmetries in a model and - // exploit them. Currently, at level 1 we detect them in presolve and try - // to fix Booleans. At level 2, we also do some form of dynamic symmetry - // breaking during search. At level 3, we also detect symmetries for very - // large models, which can be slow. At level 4, we try to break as much - // symmetry as possible in presolve. - SymmetryLevel *int32 `protobuf:"varint,183,opt,name=symmetry_level,json=symmetryLevel,def=2" json:"symmetry_level,omitempty"` - // When we have symmetry, it is possible to "fold" all variables from the same - // orbit into a single variable, while having the same power of LP relaxation. - // This can help significantly on symmetric problem. However there is - // currently a bit of overhead as the rest of the solver need to do some - // translation between the folded LP and the rest of the problem. - UseSymmetryInLp *bool `protobuf:"varint,301,opt,name=use_symmetry_in_lp,json=useSymmetryInLp,def=0" json:"use_symmetry_in_lp,omitempty"` - // Experimental. This will compute the symmetry of the problem once and for - // all. All presolve operations we do should keep the symmetry group intact - // or modify it properly. For now we have really little support for this. We - // will disable a bunch of presolve operations that could be supported. - KeepSymmetryInPresolve *bool `protobuf:"varint,303,opt,name=keep_symmetry_in_presolve,json=keepSymmetryInPresolve,def=0" json:"keep_symmetry_in_presolve,omitempty"` - // Deterministic time limit for symmetry detection. - SymmetryDetectionDeterministicTimeLimit *float64 `protobuf:"fixed64,302,opt,name=symmetry_detection_deterministic_time_limit,json=symmetryDetectionDeterministicTimeLimit,def=1" json:"symmetry_detection_deterministic_time_limit,omitempty"` - // The new linear propagation code treat all constraints at once and use - // an adaptation of Bellman-Ford-Tarjan to propagate constraint in a smarter - // order and potentially detect propagation cycle earlier. - NewLinearPropagation *bool `protobuf:"varint,224,opt,name=new_linear_propagation,json=newLinearPropagation,def=1" json:"new_linear_propagation,omitempty"` - // Linear constraints that are not pseudo-Boolean and that are longer than - // this size will be split into sqrt(size) intermediate sums in order to have - // faster propation in the CP engine. - LinearSplitSize *int32 `protobuf:"varint,256,opt,name=linear_split_size,json=linearSplitSize,def=100" json:"linear_split_size,omitempty"` - // A non-negative level indicating the type of constraints we consider in the - // LP relaxation. At level zero, no LP relaxation is used. At level 1, only - // the linear constraint and full encoding are added. At level 2, we also add - // all the Boolean constraints. - LinearizationLevel *int32 `protobuf:"varint,90,opt,name=linearization_level,json=linearizationLevel,def=1" json:"linearization_level,omitempty"` - // A non-negative level indicating how much we should try to fully encode - // Integer variables as Boolean. - BooleanEncodingLevel *int32 `protobuf:"varint,107,opt,name=boolean_encoding_level,json=booleanEncodingLevel,def=1" json:"boolean_encoding_level,omitempty"` - // When loading a*x + b*y ==/!= c when x and y are both fully encoded. - // The solver may decide to replace the linear equation by a set of clauses. - // This is triggered if the sizes of the domains of x and y are below the - // threshold. - MaxDomainSizeWhenEncodingEqNeqConstraints *int32 `protobuf:"varint,191,opt,name=max_domain_size_when_encoding_eq_neq_constraints,json=maxDomainSizeWhenEncodingEqNeqConstraints,def=16" json:"max_domain_size_when_encoding_eq_neq_constraints,omitempty"` - // The limit on the number of cuts in our cut pool. When this is reached we do - // not generate cuts anymore. - // - // TODO(user): We should probably remove this parameters, and just always - // generate cuts but only keep the best n or something. - MaxNumCuts *int32 `protobuf:"varint,91,opt,name=max_num_cuts,json=maxNumCuts,def=10000" json:"max_num_cuts,omitempty"` - // Control the global cut effort. Zero will turn off all cut. For now we just - // have one level. Note also that most cuts are only used at linearization - // level >= 2. - CutLevel *int32 `protobuf:"varint,196,opt,name=cut_level,json=cutLevel,def=1" json:"cut_level,omitempty"` - // For the cut that can be generated at any level, this control if we only - // try to generate them at the root node. - OnlyAddCutsAtLevelZero *bool `protobuf:"varint,92,opt,name=only_add_cuts_at_level_zero,json=onlyAddCutsAtLevelZero,def=0" json:"only_add_cuts_at_level_zero,omitempty"` - // When the LP objective is fractional, do we add the cut that forces the - // linear objective expression to be greater or equal to this fractional value - // rounded up? We can always do that since our objective is integer, and - // combined with MIR heuristic to reduce the coefficient of such cut, it can - // help. - AddObjectiveCut *bool `protobuf:"varint,197,opt,name=add_objective_cut,json=addObjectiveCut,def=0" json:"add_objective_cut,omitempty"` - // Whether we generate and add Chvatal-Gomory cuts to the LP at root node. - // Note that for now, this is not heavily tuned. - AddCgCuts *bool `protobuf:"varint,117,opt,name=add_cg_cuts,json=addCgCuts,def=1" json:"add_cg_cuts,omitempty"` - // Whether we generate MIR cuts at root node. - // Note that for now, this is not heavily tuned. - AddMirCuts *bool `protobuf:"varint,120,opt,name=add_mir_cuts,json=addMirCuts,def=1" json:"add_mir_cuts,omitempty"` - // Whether we generate Zero-Half cuts at root node. - // Note that for now, this is not heavily tuned. - AddZeroHalfCuts *bool `protobuf:"varint,169,opt,name=add_zero_half_cuts,json=addZeroHalfCuts,def=1" json:"add_zero_half_cuts,omitempty"` - // Whether we generate clique cuts from the binary implication graph. Note - // that as the search goes on, this graph will contains new binary clauses - // learned by the SAT engine. - AddCliqueCuts *bool `protobuf:"varint,172,opt,name=add_clique_cuts,json=addCliqueCuts,def=1" json:"add_clique_cuts,omitempty"` - // Whether we generate RLT cuts. This is still experimental but can help on - // binary problem with a lot of clauses of size 3. - AddRltCuts *bool `protobuf:"varint,279,opt,name=add_rlt_cuts,json=addRltCuts,def=1" json:"add_rlt_cuts,omitempty"` - // Cut generator for all diffs can add too many cuts for large all_diff - // constraints. This parameter restricts the large all_diff constraints to - // have a cut generator. - MaxAllDiffCutSize *int32 `protobuf:"varint,148,opt,name=max_all_diff_cut_size,json=maxAllDiffCutSize,def=64" json:"max_all_diff_cut_size,omitempty"` - // For the lin max constraints, generates the cuts described in "Strong - // mixed-integer programming formulations for trained neural networks" by Ross - // Anderson et. (https://arxiv.org/pdf/1811.01988.pdf) - AddLinMaxCuts *bool `protobuf:"varint,152,opt,name=add_lin_max_cuts,json=addLinMaxCuts,def=1" json:"add_lin_max_cuts,omitempty"` - // In the integer rounding procedure used for MIR and Gomory cut, the maximum - // "scaling" we use (must be positive). The lower this is, the lower the - // integer coefficients of the cut will be. Note that cut generated by lower - // values are not necessarily worse than cut generated by larger value. There - // is no strict dominance relationship. - // - // Setting this to 2 result in the "strong fractional rouding" of Letchford - // and Lodi. - MaxIntegerRoundingScaling *int32 `protobuf:"varint,119,opt,name=max_integer_rounding_scaling,json=maxIntegerRoundingScaling,def=600" json:"max_integer_rounding_scaling,omitempty"` - // If true, we start by an empty LP, and only add constraints not satisfied - // by the current LP solution batch by batch. A constraint that is only added - // like this is known as a "lazy" constraint in the literature, except that we - // currently consider all constraints as lazy here. - AddLpConstraintsLazily *bool `protobuf:"varint,112,opt,name=add_lp_constraints_lazily,json=addLpConstraintsLazily,def=1" json:"add_lp_constraints_lazily,omitempty"` - // Even at the root node, we do not want to spend too much time on the LP if - // it is "difficult". So we solve it in "chunks" of that many iterations. The - // solve will be continued down in the tree or the next time we go back to the - // root node. - RootLpIterations *int32 `protobuf:"varint,227,opt,name=root_lp_iterations,json=rootLpIterations,def=2000" json:"root_lp_iterations,omitempty"` - // While adding constraints, skip the constraints which have orthogonality - // less than 'min_orthogonality_for_lp_constraints' with already added - // constraints during current call. Orthogonality is defined as 1 - - // cosine(vector angle between constraints). A value of zero disable this - // feature. - MinOrthogonalityForLpConstraints *float64 `protobuf:"fixed64,115,opt,name=min_orthogonality_for_lp_constraints,json=minOrthogonalityForLpConstraints,def=0.05" json:"min_orthogonality_for_lp_constraints,omitempty"` - // Max number of time we perform cut generation and resolve the LP at level 0. - MaxCutRoundsAtLevelZero *int32 `protobuf:"varint,154,opt,name=max_cut_rounds_at_level_zero,json=maxCutRoundsAtLevelZero,def=1" json:"max_cut_rounds_at_level_zero,omitempty"` - // If a constraint/cut in LP is not active for that many consecutive OPTIMAL - // solves, remove it from the LP. Note that it might be added again later if - // it become violated by the current LP solution. - MaxConsecutiveInactiveCount *int32 `protobuf:"varint,121,opt,name=max_consecutive_inactive_count,json=maxConsecutiveInactiveCount,def=100" json:"max_consecutive_inactive_count,omitempty"` - // These parameters are similar to sat clause management activity parameters. - // They are effective only if the number of generated cuts exceed the storage - // limit. Default values are based on a few experiments on miplib instances. - CutMaxActiveCountValue *float64 `protobuf:"fixed64,155,opt,name=cut_max_active_count_value,json=cutMaxActiveCountValue,def=1e+10" json:"cut_max_active_count_value,omitempty"` - CutActiveCountDecay *float64 `protobuf:"fixed64,156,opt,name=cut_active_count_decay,json=cutActiveCountDecay,def=0.8" json:"cut_active_count_decay,omitempty"` - // Target number of constraints to remove during cleanup. - CutCleanupTarget *int32 `protobuf:"varint,157,opt,name=cut_cleanup_target,json=cutCleanupTarget,def=1000" json:"cut_cleanup_target,omitempty"` - // Add that many lazy constraints (or cuts) at once in the LP. Note that at - // the beginning of the solve, we do add more than this. - NewConstraintsBatchSize *int32 `protobuf:"varint,122,opt,name=new_constraints_batch_size,json=newConstraintsBatchSize,def=50" json:"new_constraints_batch_size,omitempty"` - // If true and the Lp relaxation of the problem has an integer optimal - // solution, try to exploit it. Note that since the LP relaxation may not - // contain all the constraints, such a solution is not necessarily a solution - // of the full problem. - ExploitIntegerLpSolution *bool `protobuf:"varint,94,opt,name=exploit_integer_lp_solution,json=exploitIntegerLpSolution,def=1" json:"exploit_integer_lp_solution,omitempty"` - // If true and the Lp relaxation of the problem has a solution, try to exploit - // it. This is same as above except in this case the lp solution might not be - // an integer solution. - ExploitAllLpSolution *bool `protobuf:"varint,116,opt,name=exploit_all_lp_solution,json=exploitAllLpSolution,def=1" json:"exploit_all_lp_solution,omitempty"` - // When branching on a variable, follow the last best solution value. - ExploitBestSolution *bool `protobuf:"varint,130,opt,name=exploit_best_solution,json=exploitBestSolution,def=0" json:"exploit_best_solution,omitempty"` - // When branching on a variable, follow the last best relaxation solution - // value. We use the relaxation with the tightest bound on the objective as - // the best relaxation solution. - ExploitRelaxationSolution *bool `protobuf:"varint,161,opt,name=exploit_relaxation_solution,json=exploitRelaxationSolution,def=0" json:"exploit_relaxation_solution,omitempty"` - // When branching an a variable that directly affect the objective, - // branch on the value that lead to the best objective first. - ExploitObjective *bool `protobuf:"varint,131,opt,name=exploit_objective,json=exploitObjective,def=1" json:"exploit_objective,omitempty"` - // Infer products of Boolean or of Boolean time IntegerVariable from the - // linear constrainst in the problem. This can be used in some cuts, altough - // for now we don't really exploit it. - DetectLinearizedProduct *bool `protobuf:"varint,277,opt,name=detect_linearized_product,json=detectLinearizedProduct,def=0" json:"detect_linearized_product,omitempty"` - // This should be better on integer problems. - // But it is still work in progress. - UseNewIntegerConflictResolution *bool `protobuf:"varint,336,opt,name=use_new_integer_conflict_resolution,json=useNewIntegerConflictResolution,def=0" json:"use_new_integer_conflict_resolution,omitempty"` - // If true, and during integer conflict resolution (icr) the 1-UIP is an - // integer literal for which we do not have an associated Boolean. Create one. - Create_1UipBooleanDuringIcr *bool `protobuf:"varint,341,opt,name=create_1uip_boolean_during_icr,json=create1uipBooleanDuringIcr,def=1" json:"create_1uip_boolean_during_icr,omitempty"` - // We need to bound the maximum magnitude of the variables for CP-SAT, and - // that is the bound we use. If the MIP model expect larger variable value in - // the solution, then the converted model will likely not be relevant. - MipMaxBound *float64 `protobuf:"fixed64,124,opt,name=mip_max_bound,json=mipMaxBound,def=1e+07" json:"mip_max_bound,omitempty"` - // All continuous variable of the problem will be multiplied by this factor. - // By default, we don't do any variable scaling and rely on the MIP model to - // specify continuous variable domain with the wanted precision. - MipVarScaling *float64 `protobuf:"fixed64,125,opt,name=mip_var_scaling,json=mipVarScaling,def=1" json:"mip_var_scaling,omitempty"` - // If this is false, then mip_var_scaling is only applied to variables with - // "small" domain. If it is true, we scale all floating point variable - // independenlty of their domain. - MipScaleLargeDomain *bool `protobuf:"varint,225,opt,name=mip_scale_large_domain,json=mipScaleLargeDomain,def=0" json:"mip_scale_large_domain,omitempty"` - // If true, some continuous variable might be automatically scaled. For now, - // this is only the case where we detect that a variable is actually an - // integer multiple of a constant. For instance, variables of the form k * 0.5 - // are quite frequent, and if we detect this, we will scale such variable - // domain by 2 to make it implied integer. - MipAutomaticallyScaleVariables *bool `protobuf:"varint,166,opt,name=mip_automatically_scale_variables,json=mipAutomaticallyScaleVariables,def=1" json:"mip_automatically_scale_variables,omitempty"` - // If one try to solve a MIP model with CP-SAT, because we assume all variable - // to be integer after scaling, we will not necessarily have the correct - // optimal. Note however that all feasible solutions are valid since we will - // just solve a more restricted version of the original problem. - // - // This parameters is here to prevent user to think the solution is optimal - // when it might not be. One will need to manually set this to false to solve - // a MIP model where the optimal might be different. - // - // Note that this is tested after some MIP presolve steps, so even if not - // all original variable are integer, we might end up with a pure IP after - // presolve and after implied integer detection. - OnlySolveIp *bool `protobuf:"varint,222,opt,name=only_solve_ip,json=onlySolveIp,def=0" json:"only_solve_ip,omitempty"` - // When scaling constraint with double coefficients to integer coefficients, - // we will multiply by a power of 2 and round the coefficients. We will choose - // the lowest power such that we have no potential overflow (see - // mip_max_activity_exponent) and the worst case constraint activity error - // does not exceed this threshold. - // - // Note that we also detect constraint with rational coefficients and scale - // them accordingly when it seems better instead of using a power of 2. - // - // We also relax all constraint bounds by this absolute value. For pure - // integer constraint, if this value if lower than one, this will not change - // anything. However it is needed when scaling MIP problems. - // - // If we manage to scale a constraint correctly, the maximum error we can make - // will be twice this value (once for the scaling error and once for the - // relaxed bounds). If we are not able to scale that well, we will display - // that fact but still scale as best as we can. - MipWantedPrecision *float64 `protobuf:"fixed64,126,opt,name=mip_wanted_precision,json=mipWantedPrecision,def=1e-06" json:"mip_wanted_precision,omitempty"` - // To avoid integer overflow, we always force the maximum possible constraint - // activity (and objective value) according to the initial variable domain to - // be smaller than 2 to this given power. Because of this, we cannot always - // reach the "mip_wanted_precision" parameter above. - // - // This can go as high as 62, but some internal algo currently abort early if - // they might run into integer overflow, so it is better to keep it a bit - // lower than this. - MipMaxActivityExponent *int32 `protobuf:"varint,127,opt,name=mip_max_activity_exponent,json=mipMaxActivityExponent,def=53" json:"mip_max_activity_exponent,omitempty"` - // As explained in mip_precision and mip_max_activity_exponent, we cannot - // always reach the wanted precision during scaling. We use this threshold to - // enphasize in the logs when the precision seems bad. - MipCheckPrecision *float64 `protobuf:"fixed64,128,opt,name=mip_check_precision,json=mipCheckPrecision,def=0.0001" json:"mip_check_precision,omitempty"` - // Even if we make big error when scaling the objective, we can always derive - // a correct lower bound on the original objective by using the exact lower - // bound on the scaled integer version of the objective. This should be fast, - // but if you don't care about having a precise lower bound, you can turn it - // off. - MipComputeTrueObjectiveBound *bool `protobuf:"varint,198,opt,name=mip_compute_true_objective_bound,json=mipComputeTrueObjectiveBound,def=1" json:"mip_compute_true_objective_bound,omitempty"` - // Any finite values in the input MIP must be below this threshold, otherwise - // the model will be reported invalid. This is needed to avoid floating point - // overflow when evaluating bounds * coeff for instance. We are a bit more - // defensive, but in practice, users shouldn't use super large values in a - // MIP. - MipMaxValidMagnitude *float64 `protobuf:"fixed64,199,opt,name=mip_max_valid_magnitude,json=mipMaxValidMagnitude,def=1e+20" json:"mip_max_valid_magnitude,omitempty"` - // By default, any variable/constraint bound with a finite value and a - // magnitude greater than the mip_max_valid_magnitude will result with a - // invalid model. This flags change the behavior such that such bounds are - // silently transformed to +∞ or -∞. - // - // It is recommended to keep it at false, and create valid bounds. - MipTreatHighMagnitudeBoundsAsInfinity *bool `protobuf:"varint,278,opt,name=mip_treat_high_magnitude_bounds_as_infinity,json=mipTreatHighMagnitudeBoundsAsInfinity,def=0" json:"mip_treat_high_magnitude_bounds_as_infinity,omitempty"` - // Any value in the input mip with a magnitude lower than this will be set to - // zero. This is to avoid some issue in LP presolving. - MipDropTolerance *float64 `protobuf:"fixed64,232,opt,name=mip_drop_tolerance,json=mipDropTolerance,def=1e-16" json:"mip_drop_tolerance,omitempty"` - // When solving a MIP, we do some basic floating point presolving before - // scaling the problem to integer to be handled by CP-SAT. This control how - // much of that presolve we do. It can help to better scale floating point - // model, but it is not always behaving nicely. - MipPresolveLevel *int32 `protobuf:"varint,261,opt,name=mip_presolve_level,json=mipPresolveLevel,def=2" json:"mip_presolve_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -// Default values for SatParameters fields. -const ( - Default_SatParameters_Name = string("") - Default_SatParameters_PreferredVariableOrder = SatParameters_IN_ORDER - Default_SatParameters_InitialPolarity = SatParameters_POLARITY_FALSE - Default_SatParameters_UsePhaseSaving = bool(true) - Default_SatParameters_PolarityRephaseIncrement = int32(1000) - Default_SatParameters_PolarityExploitLsHints = bool(false) - Default_SatParameters_RandomPolarityRatio = float64(0) - Default_SatParameters_RandomBranchesRatio = float64(0) - Default_SatParameters_UseErwaHeuristic = bool(false) - Default_SatParameters_InitialVariablesActivity = float64(0) - Default_SatParameters_AlsoBumpVariablesInConflictReasons = bool(false) - Default_SatParameters_MinimizationAlgorithm = SatParameters_RECURSIVE - Default_SatParameters_BinaryMinimizationAlgorithm = SatParameters_BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONS - Default_SatParameters_SubsumptionDuringConflictAnalysis = bool(true) - Default_SatParameters_ExtraSubsumptionDuringConflictAnalysis = bool(true) - Default_SatParameters_DecisionSubsumptionDuringConflictAnalysis = bool(true) - Default_SatParameters_EagerlySubsumeLastNConflicts = int32(4) - Default_SatParameters_SubsumeDuringVivification = bool(true) - Default_SatParameters_UseChronologicalBacktracking = bool(false) - Default_SatParameters_MaxBackjumpLevels = int32(50) - Default_SatParameters_ChronologicalBacktrackMinConflicts = int32(1000) - Default_SatParameters_ClauseCleanupPeriod = int32(10000) - Default_SatParameters_ClauseCleanupPeriodIncrement = int32(0) - Default_SatParameters_ClauseCleanupTarget = int32(0) - Default_SatParameters_ClauseCleanupRatio = float64(0.5) - Default_SatParameters_ClauseCleanupLbdBound = int32(5) - Default_SatParameters_ClauseCleanupLbdTier1 = int32(0) - Default_SatParameters_ClauseCleanupLbdTier2 = int32(0) - Default_SatParameters_ClauseCleanupOrdering = SatParameters_CLAUSE_ACTIVITY - Default_SatParameters_PbCleanupIncrement = int32(200) - Default_SatParameters_PbCleanupRatio = float64(0.5) - Default_SatParameters_VariableActivityDecay = float64(0.8) - Default_SatParameters_MaxVariableActivityValue = float64(1e+100) - Default_SatParameters_GlucoseMaxDecay = float64(0.95) - Default_SatParameters_GlucoseDecayIncrement = float64(0.01) - Default_SatParameters_GlucoseDecayIncrementPeriod = int32(5000) - Default_SatParameters_ClauseActivityDecay = float64(0.999) - Default_SatParameters_MaxClauseActivityValue = float64(1e+20) - Default_SatParameters_DefaultRestartAlgorithms = string("LUBY_RESTART,LBD_MOVING_AVERAGE_RESTART,DL_MOVING_AVERAGE_RESTART") - Default_SatParameters_RestartPeriod = int32(50) - Default_SatParameters_RestartRunningWindowSize = int32(50) - Default_SatParameters_RestartDlAverageRatio = float64(1) - Default_SatParameters_RestartLbdAverageRatio = float64(1) - Default_SatParameters_UseBlockingRestart = bool(false) - Default_SatParameters_BlockingRestartWindowSize = int32(5000) - Default_SatParameters_BlockingRestartMultiplier = float64(1.4) - Default_SatParameters_NumConflictsBeforeStrategyChanges = int32(0) - Default_SatParameters_StrategyChangeIncreaseRatio = float64(0) - Default_SatParameters_MaxNumDeterministicBatches = int32(0) - Default_SatParameters_MaxNumberOfConflicts = int64(9223372036854775807) - Default_SatParameters_MaxMemoryInMb = int64(10000) - Default_SatParameters_AbsoluteGapLimit = float64(0.0001) - Default_SatParameters_RelativeGapLimit = float64(0) - Default_SatParameters_RandomSeed = int32(1) - Default_SatParameters_PermuteVariableRandomly = bool(false) - Default_SatParameters_PermutePresolveConstraintOrder = bool(false) - Default_SatParameters_UseAbslRandom = bool(false) - Default_SatParameters_LogSearchProgress = bool(false) - Default_SatParameters_LogSubsolverStatistics = bool(false) - Default_SatParameters_LogPrefix = string("") - Default_SatParameters_LogToStdout = bool(true) - Default_SatParameters_LogToResponse = bool(false) - Default_SatParameters_UsePbResolution = bool(false) - Default_SatParameters_MinimizeReductionDuringPbResolution = bool(false) - Default_SatParameters_CountAssumptionLevelsInLbd = bool(true) - Default_SatParameters_PresolveBveThreshold = int32(500) - Default_SatParameters_FilterSatPostsolveClauses = bool(false) - Default_SatParameters_PresolveBveClauseWeight = int32(3) - Default_SatParameters_ProbingDeterministicTimeLimit = float64(1) - Default_SatParameters_PresolveProbingDeterministicTimeLimit = float64(30) - Default_SatParameters_PresolveBlockedClause = bool(true) - Default_SatParameters_PresolveUseBva = bool(true) - Default_SatParameters_PresolveBvaThreshold = int32(1) - Default_SatParameters_MaxPresolveIterations = int32(3) - Default_SatParameters_CpModelPresolve = bool(true) - Default_SatParameters_CpModelProbingLevel = int32(2) - Default_SatParameters_CpModelUseSatPresolve = bool(true) - Default_SatParameters_LoadAtMostOnesInSatPresolve = bool(false) - Default_SatParameters_RemoveFixedVariablesEarly = bool(true) - Default_SatParameters_DetectTableWithCost = bool(false) - Default_SatParameters_TableCompressionLevel = int32(2) - Default_SatParameters_ExpandAlldiffConstraints = bool(false) - Default_SatParameters_MaxAlldiffDomainSize = int32(256) - Default_SatParameters_ExpandReservoirConstraints = bool(true) - Default_SatParameters_MaxDomainSizeForLinear2Expansion = int32(8) - Default_SatParameters_ExpandReservoirUsingCircuit = bool(false) - Default_SatParameters_EncodeCumulativeAsReservoir = bool(false) - Default_SatParameters_MaxLinMaxSizeForExpansion = int32(0) - Default_SatParameters_DisableConstraintExpansion = bool(false) - Default_SatParameters_EncodeComplexLinearConstraintWithInteger = bool(false) - Default_SatParameters_MergeNoOverlapWorkLimit = float64(1e+12) - Default_SatParameters_MergeAtMostOneWorkLimit = float64(1e+08) - Default_SatParameters_PresolveSubstitutionLevel = int32(1) - Default_SatParameters_PresolveExtractIntegerEnforcement = bool(false) - Default_SatParameters_PresolveInclusionWorkLimit = int64(100000000) - Default_SatParameters_IgnoreNames = bool(true) - Default_SatParameters_InferAllDiffs = bool(true) - Default_SatParameters_FindBigLinearOverlap = bool(true) - Default_SatParameters_FindClausesThatAreExactlyOne = bool(true) - Default_SatParameters_UseSatInprocessing = bool(true) - Default_SatParameters_InprocessingDtimeRatio = float64(0.2) - Default_SatParameters_InprocessingProbingDtime = float64(1) - Default_SatParameters_InprocessingMinimizationDtime = float64(1) - Default_SatParameters_InprocessingMinimizationUseConflictAnalysis = bool(true) - Default_SatParameters_InprocessingMinimizationUseAllOrderings = bool(false) - Default_SatParameters_InprocessingUseCongruenceClosure = bool(true) - Default_SatParameters_InprocessingUseSatSweeping = bool(false) - Default_SatParameters_NumWorkers = int32(0) - Default_SatParameters_NumSearchWorkers = int32(0) - Default_SatParameters_NumFullSubsolvers = int32(0) - Default_SatParameters_InterleaveSearch = bool(false) - Default_SatParameters_InterleaveBatchSize = int32(0) - Default_SatParameters_ShareObjectiveBounds = bool(true) - Default_SatParameters_ShareLevelZeroBounds = bool(true) - Default_SatParameters_ShareLinear2Bounds = bool(false) - Default_SatParameters_ShareBinaryClauses = bool(true) - Default_SatParameters_ShareGlueClauses = bool(true) - Default_SatParameters_MinimizeSharedClauses = bool(true) - Default_SatParameters_ShareGlueClausesDtime = float64(1) - Default_SatParameters_CheckLratProof = bool(false) - Default_SatParameters_CheckMergedLratProof = bool(false) - Default_SatParameters_OutputLratProof = bool(false) - Default_SatParameters_CheckDratProof = bool(false) - Default_SatParameters_OutputDratProof = bool(false) - Default_SatParameters_DebugPostsolveWithFullSolver = bool(false) - Default_SatParameters_DebugMaxNumPresolveOperations = int32(0) - Default_SatParameters_DebugCrashOnBadHint = bool(false) - Default_SatParameters_DebugCrashIfPresolveBreaksHint = bool(false) - Default_SatParameters_DebugCrashIfLratCheckFails = bool(false) - Default_SatParameters_UseOptimizationHints = bool(true) - Default_SatParameters_CoreMinimizationLevel = int32(2) - Default_SatParameters_FindMultipleCores = bool(true) - Default_SatParameters_CoverOptimization = bool(true) - Default_SatParameters_MaxSatAssumptionOrder = SatParameters_DEFAULT_ASSUMPTION_ORDER - Default_SatParameters_MaxSatReverseAssumptionOrder = bool(false) - Default_SatParameters_MaxSatStratification = SatParameters_STRATIFICATION_DESCENT - Default_SatParameters_PropagationLoopDetectionFactor = float64(10) - Default_SatParameters_UsePrecedencesInDisjunctiveConstraint = bool(true) - Default_SatParameters_TransitivePrecedencesWorkLimit = int32(1000000) - Default_SatParameters_MaxSizeToCreatePrecedenceLiteralsInDisjunctive = int32(60) - Default_SatParameters_UseStrongPropagationInDisjunctive = bool(false) - Default_SatParameters_UseDynamicPrecedenceInDisjunctive = bool(false) - Default_SatParameters_UseDynamicPrecedenceInCumulative = bool(false) - Default_SatParameters_UseOverloadCheckerInCumulative = bool(false) - Default_SatParameters_UseConservativeScaleOverloadChecker = bool(false) - Default_SatParameters_UseTimetableEdgeFindingInCumulative = bool(false) - Default_SatParameters_MaxNumIntervalsForTimetableEdgeFinding = int32(100) - Default_SatParameters_UseHardPrecedencesInCumulative = bool(false) - Default_SatParameters_ExploitAllPrecedences = bool(false) - Default_SatParameters_UseDisjunctiveConstraintInCumulative = bool(true) - Default_SatParameters_NoOverlap_2DBooleanRelationsLimit = int32(10) - Default_SatParameters_UseTimetablingInNoOverlap_2D = bool(false) - Default_SatParameters_UseEnergeticReasoningInNoOverlap_2D = bool(false) - Default_SatParameters_UseAreaEnergeticReasoningInNoOverlap_2D = bool(false) - Default_SatParameters_UseTryEdgeReasoningInNoOverlap_2D = bool(false) - Default_SatParameters_MaxPairsPairwiseReasoningInNoOverlap_2D = int32(1250) - Default_SatParameters_MaximumRegionsToSplitInDisconnectedNoOverlap_2D = int32(0) - Default_SatParameters_UseLinear3ForNoOverlap_2DPrecedences = bool(true) - Default_SatParameters_UseDualSchedulingHeuristics = bool(true) - Default_SatParameters_UseAllDifferentForCircuit = bool(false) - Default_SatParameters_RoutingCutSubsetSizeForBinaryRelationBound = int32(0) - Default_SatParameters_RoutingCutSubsetSizeForTightBinaryRelationBound = int32(0) - Default_SatParameters_RoutingCutSubsetSizeForExactBinaryRelationBound = int32(8) - Default_SatParameters_RoutingCutSubsetSizeForShortestPathsBound = int32(8) - Default_SatParameters_RoutingCutDpEffort = float64(1e+07) - Default_SatParameters_RoutingCutMaxInfeasiblePathLength = int32(6) - Default_SatParameters_SearchBranching = SatParameters_AUTOMATIC_SEARCH - Default_SatParameters_HintConflictLimit = int32(10) - Default_SatParameters_RepairHint = bool(false) - Default_SatParameters_FixVariablesToTheirHintedValue = bool(false) - Default_SatParameters_UseProbingSearch = bool(false) - Default_SatParameters_UseExtendedProbing = bool(true) - Default_SatParameters_ProbingNumCombinationsLimit = int32(20000) - Default_SatParameters_ShavingDeterministicTimeInProbingSearch = float64(0.001) - Default_SatParameters_ShavingSearchDeterministicTime = float64(0.1) - Default_SatParameters_ShavingSearchThreshold = int64(64) - Default_SatParameters_UseObjectiveLbSearch = bool(false) - Default_SatParameters_UseObjectiveShavingSearch = bool(false) - Default_SatParameters_VariablesShavingLevel = int32(-1) - Default_SatParameters_PseudoCostReliabilityThreshold = int64(100) - Default_SatParameters_OptimizeWithCore = bool(false) - Default_SatParameters_OptimizeWithLbTreeSearch = bool(false) - Default_SatParameters_SaveLpBasisInLbTreeSearch = bool(false) - Default_SatParameters_BinarySearchNumConflicts = int32(-1) - Default_SatParameters_OptimizeWithMaxHs = bool(false) - Default_SatParameters_UseFeasibilityJump = bool(true) - Default_SatParameters_UseLsOnly = bool(false) - Default_SatParameters_FeasibilityJumpDecay = float64(0.95) - Default_SatParameters_FeasibilityJumpLinearizationLevel = int32(2) - Default_SatParameters_FeasibilityJumpRestartFactor = int32(1) - Default_SatParameters_FeasibilityJumpBatchDtime = float64(0.1) - Default_SatParameters_FeasibilityJumpVarRandomizationProbability = float64(0.05) - Default_SatParameters_FeasibilityJumpVarPerburbationRangeRatio = float64(0.2) - Default_SatParameters_FeasibilityJumpEnableRestarts = bool(true) - Default_SatParameters_FeasibilityJumpMaxExpandedConstraintSize = int32(500) - Default_SatParameters_NumViolationLs = int32(0) - Default_SatParameters_ViolationLsPerturbationPeriod = int32(100) - Default_SatParameters_ViolationLsCompoundMoveProbability = float64(0.5) - Default_SatParameters_SharedTreeNumWorkers = int32(-1) - Default_SatParameters_UseSharedTreeSearch = bool(false) - Default_SatParameters_SharedTreeWorkerMinRestartsPerSubtree = int32(1) - Default_SatParameters_SharedTreeWorkerEnableTrailSharing = bool(true) - Default_SatParameters_SharedTreeWorkerEnablePhaseSharing = bool(true) - Default_SatParameters_SharedTreeOpenLeavesPerWorker = float64(2) - Default_SatParameters_SharedTreeMaxNodesPerWorker = int32(10000) - Default_SatParameters_SharedTreeSplitStrategy = SatParameters_SPLIT_STRATEGY_AUTO - Default_SatParameters_SharedTreeBalanceTolerance = int32(1) - Default_SatParameters_SharedTreeSplitMinDtime = float64(0.1) - Default_SatParameters_EnumerateAllSolutions = bool(false) - Default_SatParameters_KeepAllFeasibleSolutionsInPresolve = bool(false) - Default_SatParameters_FillTightenedDomainsInResponse = bool(false) - Default_SatParameters_FillAdditionalSolutionsInResponse = bool(false) - Default_SatParameters_InstantiateAllVariables = bool(true) - Default_SatParameters_AutoDetectGreaterThanAtLeastOneOf = bool(true) - Default_SatParameters_StopAfterFirstSolution = bool(false) - Default_SatParameters_StopAfterPresolve = bool(false) - Default_SatParameters_StopAfterRootPropagation = bool(false) - Default_SatParameters_LnsInitialDifficulty = float64(0.5) - Default_SatParameters_LnsInitialDeterministicLimit = float64(0.1) - Default_SatParameters_UseLns = bool(true) - Default_SatParameters_UseLnsOnly = bool(false) - Default_SatParameters_SolutionPoolSize = int32(3) - Default_SatParameters_SolutionPoolDiversityLimit = int32(10) - Default_SatParameters_AlternativePoolSize = int32(1) - Default_SatParameters_UseRinsLns = bool(true) - Default_SatParameters_UseFeasibilityPump = bool(true) - Default_SatParameters_UseLbRelaxLns = bool(true) - Default_SatParameters_LbRelaxNumWorkersThreshold = int32(16) - Default_SatParameters_FpRounding = SatParameters_PROPAGATION_ASSISTED - Default_SatParameters_DiversifyLnsParams = bool(false) - Default_SatParameters_RandomizeSearch = bool(false) - Default_SatParameters_SearchRandomVariablePoolSize = int64(0) - Default_SatParameters_PushAllTasksTowardStart = bool(false) - Default_SatParameters_UseOptionalVariables = bool(false) - Default_SatParameters_UseExactLpReason = bool(true) - Default_SatParameters_UseCombinedNoOverlap = bool(false) - Default_SatParameters_AtMostOneMaxExpansionSize = int32(3) - Default_SatParameters_CatchSigintSignal = bool(true) - Default_SatParameters_UseImpliedBounds = bool(true) - Default_SatParameters_PolishLpSolution = bool(false) - Default_SatParameters_LpPrimalTolerance = float64(1e-07) - Default_SatParameters_LpDualTolerance = float64(1e-07) - Default_SatParameters_ConvertIntervals = bool(true) - Default_SatParameters_SymmetryLevel = int32(2) - Default_SatParameters_UseSymmetryInLp = bool(false) - Default_SatParameters_KeepSymmetryInPresolve = bool(false) - Default_SatParameters_SymmetryDetectionDeterministicTimeLimit = float64(1) - Default_SatParameters_NewLinearPropagation = bool(true) - Default_SatParameters_LinearSplitSize = int32(100) - Default_SatParameters_LinearizationLevel = int32(1) - Default_SatParameters_BooleanEncodingLevel = int32(1) - Default_SatParameters_MaxDomainSizeWhenEncodingEqNeqConstraints = int32(16) - Default_SatParameters_MaxNumCuts = int32(10000) - Default_SatParameters_CutLevel = int32(1) - Default_SatParameters_OnlyAddCutsAtLevelZero = bool(false) - Default_SatParameters_AddObjectiveCut = bool(false) - Default_SatParameters_AddCgCuts = bool(true) - Default_SatParameters_AddMirCuts = bool(true) - Default_SatParameters_AddZeroHalfCuts = bool(true) - Default_SatParameters_AddCliqueCuts = bool(true) - Default_SatParameters_AddRltCuts = bool(true) - Default_SatParameters_MaxAllDiffCutSize = int32(64) - Default_SatParameters_AddLinMaxCuts = bool(true) - Default_SatParameters_MaxIntegerRoundingScaling = int32(600) - Default_SatParameters_AddLpConstraintsLazily = bool(true) - Default_SatParameters_RootLpIterations = int32(2000) - Default_SatParameters_MinOrthogonalityForLpConstraints = float64(0.05) - Default_SatParameters_MaxCutRoundsAtLevelZero = int32(1) - Default_SatParameters_MaxConsecutiveInactiveCount = int32(100) - Default_SatParameters_CutMaxActiveCountValue = float64(1e+10) - Default_SatParameters_CutActiveCountDecay = float64(0.8) - Default_SatParameters_CutCleanupTarget = int32(1000) - Default_SatParameters_NewConstraintsBatchSize = int32(50) - Default_SatParameters_ExploitIntegerLpSolution = bool(true) - Default_SatParameters_ExploitAllLpSolution = bool(true) - Default_SatParameters_ExploitBestSolution = bool(false) - Default_SatParameters_ExploitRelaxationSolution = bool(false) - Default_SatParameters_ExploitObjective = bool(true) - Default_SatParameters_DetectLinearizedProduct = bool(false) - Default_SatParameters_UseNewIntegerConflictResolution = bool(false) - Default_SatParameters_Create_1UipBooleanDuringIcr = bool(true) - Default_SatParameters_MipMaxBound = float64(1e+07) - Default_SatParameters_MipVarScaling = float64(1) - Default_SatParameters_MipScaleLargeDomain = bool(false) - Default_SatParameters_MipAutomaticallyScaleVariables = bool(true) - Default_SatParameters_OnlySolveIp = bool(false) - Default_SatParameters_MipWantedPrecision = float64(1e-06) - Default_SatParameters_MipMaxActivityExponent = int32(53) - Default_SatParameters_MipCheckPrecision = float64(0.0001) - Default_SatParameters_MipComputeTrueObjectiveBound = bool(true) - Default_SatParameters_MipMaxValidMagnitude = float64(1e+20) - Default_SatParameters_MipTreatHighMagnitudeBoundsAsInfinity = bool(false) - Default_SatParameters_MipDropTolerance = float64(1e-16) - Default_SatParameters_MipPresolveLevel = int32(2) -) - -// Default values for SatParameters fields. -var ( - Default_SatParameters_MaxTimeInSeconds = float64(math.Inf(+1)) - Default_SatParameters_MaxDeterministicTime = float64(math.Inf(+1)) - Default_SatParameters_MaxDratTimeInSeconds = float64(math.Inf(+1)) -) - -func (x *SatParameters) Reset() { - *x = SatParameters{} - mi := &file_ortools_sat_sat_parameters_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SatParameters) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SatParameters) ProtoMessage() {} - -func (x *SatParameters) ProtoReflect() protoreflect.Message { - mi := &file_ortools_sat_sat_parameters_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SatParameters.ProtoReflect.Descriptor instead. -func (*SatParameters) Descriptor() ([]byte, []int) { - return file_ortools_sat_sat_parameters_proto_rawDescGZIP(), []int{0} -} - -func (x *SatParameters) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return Default_SatParameters_Name -} - -func (x *SatParameters) GetPreferredVariableOrder() SatParameters_VariableOrder { - if x != nil && x.PreferredVariableOrder != nil { - return *x.PreferredVariableOrder - } - return Default_SatParameters_PreferredVariableOrder -} - -func (x *SatParameters) GetInitialPolarity() SatParameters_Polarity { - if x != nil && x.InitialPolarity != nil { - return *x.InitialPolarity - } - return Default_SatParameters_InitialPolarity -} - -func (x *SatParameters) GetUsePhaseSaving() bool { - if x != nil && x.UsePhaseSaving != nil { - return *x.UsePhaseSaving - } - return Default_SatParameters_UsePhaseSaving -} - -func (x *SatParameters) GetPolarityRephaseIncrement() int32 { - if x != nil && x.PolarityRephaseIncrement != nil { - return *x.PolarityRephaseIncrement - } - return Default_SatParameters_PolarityRephaseIncrement -} - -func (x *SatParameters) GetPolarityExploitLsHints() bool { - if x != nil && x.PolarityExploitLsHints != nil { - return *x.PolarityExploitLsHints - } - return Default_SatParameters_PolarityExploitLsHints -} - -func (x *SatParameters) GetRandomPolarityRatio() float64 { - if x != nil && x.RandomPolarityRatio != nil { - return *x.RandomPolarityRatio - } - return Default_SatParameters_RandomPolarityRatio -} - -func (x *SatParameters) GetRandomBranchesRatio() float64 { - if x != nil && x.RandomBranchesRatio != nil { - return *x.RandomBranchesRatio - } - return Default_SatParameters_RandomBranchesRatio -} - -func (x *SatParameters) GetUseErwaHeuristic() bool { - if x != nil && x.UseErwaHeuristic != nil { - return *x.UseErwaHeuristic - } - return Default_SatParameters_UseErwaHeuristic -} - -func (x *SatParameters) GetInitialVariablesActivity() float64 { - if x != nil && x.InitialVariablesActivity != nil { - return *x.InitialVariablesActivity - } - return Default_SatParameters_InitialVariablesActivity -} - -func (x *SatParameters) GetAlsoBumpVariablesInConflictReasons() bool { - if x != nil && x.AlsoBumpVariablesInConflictReasons != nil { - return *x.AlsoBumpVariablesInConflictReasons - } - return Default_SatParameters_AlsoBumpVariablesInConflictReasons -} - -func (x *SatParameters) GetMinimizationAlgorithm() SatParameters_ConflictMinimizationAlgorithm { - if x != nil && x.MinimizationAlgorithm != nil { - return *x.MinimizationAlgorithm - } - return Default_SatParameters_MinimizationAlgorithm -} - -func (x *SatParameters) GetBinaryMinimizationAlgorithm() SatParameters_BinaryMinizationAlgorithm { - if x != nil && x.BinaryMinimizationAlgorithm != nil { - return *x.BinaryMinimizationAlgorithm - } - return Default_SatParameters_BinaryMinimizationAlgorithm -} - -func (x *SatParameters) GetSubsumptionDuringConflictAnalysis() bool { - if x != nil && x.SubsumptionDuringConflictAnalysis != nil { - return *x.SubsumptionDuringConflictAnalysis - } - return Default_SatParameters_SubsumptionDuringConflictAnalysis -} - -func (x *SatParameters) GetExtraSubsumptionDuringConflictAnalysis() bool { - if x != nil && x.ExtraSubsumptionDuringConflictAnalysis != nil { - return *x.ExtraSubsumptionDuringConflictAnalysis - } - return Default_SatParameters_ExtraSubsumptionDuringConflictAnalysis -} - -func (x *SatParameters) GetDecisionSubsumptionDuringConflictAnalysis() bool { - if x != nil && x.DecisionSubsumptionDuringConflictAnalysis != nil { - return *x.DecisionSubsumptionDuringConflictAnalysis - } - return Default_SatParameters_DecisionSubsumptionDuringConflictAnalysis -} - -func (x *SatParameters) GetEagerlySubsumeLastNConflicts() int32 { - if x != nil && x.EagerlySubsumeLastNConflicts != nil { - return *x.EagerlySubsumeLastNConflicts - } - return Default_SatParameters_EagerlySubsumeLastNConflicts -} - -func (x *SatParameters) GetSubsumeDuringVivification() bool { - if x != nil && x.SubsumeDuringVivification != nil { - return *x.SubsumeDuringVivification - } - return Default_SatParameters_SubsumeDuringVivification -} - -func (x *SatParameters) GetUseChronologicalBacktracking() bool { - if x != nil && x.UseChronologicalBacktracking != nil { - return *x.UseChronologicalBacktracking - } - return Default_SatParameters_UseChronologicalBacktracking -} - -func (x *SatParameters) GetMaxBackjumpLevels() int32 { - if x != nil && x.MaxBackjumpLevels != nil { - return *x.MaxBackjumpLevels - } - return Default_SatParameters_MaxBackjumpLevels -} - -func (x *SatParameters) GetChronologicalBacktrackMinConflicts() int32 { - if x != nil && x.ChronologicalBacktrackMinConflicts != nil { - return *x.ChronologicalBacktrackMinConflicts - } - return Default_SatParameters_ChronologicalBacktrackMinConflicts -} - -func (x *SatParameters) GetClauseCleanupPeriod() int32 { - if x != nil && x.ClauseCleanupPeriod != nil { - return *x.ClauseCleanupPeriod - } - return Default_SatParameters_ClauseCleanupPeriod -} - -func (x *SatParameters) GetClauseCleanupPeriodIncrement() int32 { - if x != nil && x.ClauseCleanupPeriodIncrement != nil { - return *x.ClauseCleanupPeriodIncrement - } - return Default_SatParameters_ClauseCleanupPeriodIncrement -} - -func (x *SatParameters) GetClauseCleanupTarget() int32 { - if x != nil && x.ClauseCleanupTarget != nil { - return *x.ClauseCleanupTarget - } - return Default_SatParameters_ClauseCleanupTarget -} - -func (x *SatParameters) GetClauseCleanupRatio() float64 { - if x != nil && x.ClauseCleanupRatio != nil { - return *x.ClauseCleanupRatio - } - return Default_SatParameters_ClauseCleanupRatio -} - -func (x *SatParameters) GetClauseCleanupLbdBound() int32 { - if x != nil && x.ClauseCleanupLbdBound != nil { - return *x.ClauseCleanupLbdBound - } - return Default_SatParameters_ClauseCleanupLbdBound -} - -func (x *SatParameters) GetClauseCleanupLbdTier1() int32 { - if x != nil && x.ClauseCleanupLbdTier1 != nil { - return *x.ClauseCleanupLbdTier1 - } - return Default_SatParameters_ClauseCleanupLbdTier1 -} - -func (x *SatParameters) GetClauseCleanupLbdTier2() int32 { - if x != nil && x.ClauseCleanupLbdTier2 != nil { - return *x.ClauseCleanupLbdTier2 - } - return Default_SatParameters_ClauseCleanupLbdTier2 -} - -func (x *SatParameters) GetClauseCleanupOrdering() SatParameters_ClauseOrdering { - if x != nil && x.ClauseCleanupOrdering != nil { - return *x.ClauseCleanupOrdering - } - return Default_SatParameters_ClauseCleanupOrdering -} - -func (x *SatParameters) GetPbCleanupIncrement() int32 { - if x != nil && x.PbCleanupIncrement != nil { - return *x.PbCleanupIncrement - } - return Default_SatParameters_PbCleanupIncrement -} - -func (x *SatParameters) GetPbCleanupRatio() float64 { - if x != nil && x.PbCleanupRatio != nil { - return *x.PbCleanupRatio - } - return Default_SatParameters_PbCleanupRatio -} - -func (x *SatParameters) GetVariableActivityDecay() float64 { - if x != nil && x.VariableActivityDecay != nil { - return *x.VariableActivityDecay - } - return Default_SatParameters_VariableActivityDecay -} - -func (x *SatParameters) GetMaxVariableActivityValue() float64 { - if x != nil && x.MaxVariableActivityValue != nil { - return *x.MaxVariableActivityValue - } - return Default_SatParameters_MaxVariableActivityValue -} - -func (x *SatParameters) GetGlucoseMaxDecay() float64 { - if x != nil && x.GlucoseMaxDecay != nil { - return *x.GlucoseMaxDecay - } - return Default_SatParameters_GlucoseMaxDecay -} - -func (x *SatParameters) GetGlucoseDecayIncrement() float64 { - if x != nil && x.GlucoseDecayIncrement != nil { - return *x.GlucoseDecayIncrement - } - return Default_SatParameters_GlucoseDecayIncrement -} - -func (x *SatParameters) GetGlucoseDecayIncrementPeriod() int32 { - if x != nil && x.GlucoseDecayIncrementPeriod != nil { - return *x.GlucoseDecayIncrementPeriod - } - return Default_SatParameters_GlucoseDecayIncrementPeriod -} - -func (x *SatParameters) GetClauseActivityDecay() float64 { - if x != nil && x.ClauseActivityDecay != nil { - return *x.ClauseActivityDecay - } - return Default_SatParameters_ClauseActivityDecay -} - -func (x *SatParameters) GetMaxClauseActivityValue() float64 { - if x != nil && x.MaxClauseActivityValue != nil { - return *x.MaxClauseActivityValue - } - return Default_SatParameters_MaxClauseActivityValue -} - -func (x *SatParameters) GetRestartAlgorithms() []SatParameters_RestartAlgorithm { - if x != nil { - return x.RestartAlgorithms - } - return nil -} - -func (x *SatParameters) GetDefaultRestartAlgorithms() string { - if x != nil && x.DefaultRestartAlgorithms != nil { - return *x.DefaultRestartAlgorithms - } - return Default_SatParameters_DefaultRestartAlgorithms -} - -func (x *SatParameters) GetRestartPeriod() int32 { - if x != nil && x.RestartPeriod != nil { - return *x.RestartPeriod - } - return Default_SatParameters_RestartPeriod -} - -func (x *SatParameters) GetRestartRunningWindowSize() int32 { - if x != nil && x.RestartRunningWindowSize != nil { - return *x.RestartRunningWindowSize - } - return Default_SatParameters_RestartRunningWindowSize -} - -func (x *SatParameters) GetRestartDlAverageRatio() float64 { - if x != nil && x.RestartDlAverageRatio != nil { - return *x.RestartDlAverageRatio - } - return Default_SatParameters_RestartDlAverageRatio -} - -func (x *SatParameters) GetRestartLbdAverageRatio() float64 { - if x != nil && x.RestartLbdAverageRatio != nil { - return *x.RestartLbdAverageRatio - } - return Default_SatParameters_RestartLbdAverageRatio -} - -func (x *SatParameters) GetUseBlockingRestart() bool { - if x != nil && x.UseBlockingRestart != nil { - return *x.UseBlockingRestart - } - return Default_SatParameters_UseBlockingRestart -} - -func (x *SatParameters) GetBlockingRestartWindowSize() int32 { - if x != nil && x.BlockingRestartWindowSize != nil { - return *x.BlockingRestartWindowSize - } - return Default_SatParameters_BlockingRestartWindowSize -} - -func (x *SatParameters) GetBlockingRestartMultiplier() float64 { - if x != nil && x.BlockingRestartMultiplier != nil { - return *x.BlockingRestartMultiplier - } - return Default_SatParameters_BlockingRestartMultiplier -} - -func (x *SatParameters) GetNumConflictsBeforeStrategyChanges() int32 { - if x != nil && x.NumConflictsBeforeStrategyChanges != nil { - return *x.NumConflictsBeforeStrategyChanges - } - return Default_SatParameters_NumConflictsBeforeStrategyChanges -} - -func (x *SatParameters) GetStrategyChangeIncreaseRatio() float64 { - if x != nil && x.StrategyChangeIncreaseRatio != nil { - return *x.StrategyChangeIncreaseRatio - } - return Default_SatParameters_StrategyChangeIncreaseRatio -} - -func (x *SatParameters) GetMaxTimeInSeconds() float64 { - if x != nil && x.MaxTimeInSeconds != nil { - return *x.MaxTimeInSeconds - } - return Default_SatParameters_MaxTimeInSeconds -} - -func (x *SatParameters) GetMaxDeterministicTime() float64 { - if x != nil && x.MaxDeterministicTime != nil { - return *x.MaxDeterministicTime - } - return Default_SatParameters_MaxDeterministicTime -} - -func (x *SatParameters) GetMaxNumDeterministicBatches() int32 { - if x != nil && x.MaxNumDeterministicBatches != nil { - return *x.MaxNumDeterministicBatches - } - return Default_SatParameters_MaxNumDeterministicBatches -} - -func (x *SatParameters) GetMaxNumberOfConflicts() int64 { - if x != nil && x.MaxNumberOfConflicts != nil { - return *x.MaxNumberOfConflicts - } - return Default_SatParameters_MaxNumberOfConflicts -} - -func (x *SatParameters) GetMaxMemoryInMb() int64 { - if x != nil && x.MaxMemoryInMb != nil { - return *x.MaxMemoryInMb - } - return Default_SatParameters_MaxMemoryInMb -} - -func (x *SatParameters) GetAbsoluteGapLimit() float64 { - if x != nil && x.AbsoluteGapLimit != nil { - return *x.AbsoluteGapLimit - } - return Default_SatParameters_AbsoluteGapLimit -} - -func (x *SatParameters) GetRelativeGapLimit() float64 { - if x != nil && x.RelativeGapLimit != nil { - return *x.RelativeGapLimit - } - return Default_SatParameters_RelativeGapLimit -} - -func (x *SatParameters) GetRandomSeed() int32 { - if x != nil && x.RandomSeed != nil { - return *x.RandomSeed - } - return Default_SatParameters_RandomSeed -} - -func (x *SatParameters) GetPermuteVariableRandomly() bool { - if x != nil && x.PermuteVariableRandomly != nil { - return *x.PermuteVariableRandomly - } - return Default_SatParameters_PermuteVariableRandomly -} - -func (x *SatParameters) GetPermutePresolveConstraintOrder() bool { - if x != nil && x.PermutePresolveConstraintOrder != nil { - return *x.PermutePresolveConstraintOrder - } - return Default_SatParameters_PermutePresolveConstraintOrder -} - -func (x *SatParameters) GetUseAbslRandom() bool { - if x != nil && x.UseAbslRandom != nil { - return *x.UseAbslRandom - } - return Default_SatParameters_UseAbslRandom -} - -func (x *SatParameters) GetLogSearchProgress() bool { - if x != nil && x.LogSearchProgress != nil { - return *x.LogSearchProgress - } - return Default_SatParameters_LogSearchProgress -} - -func (x *SatParameters) GetLogSubsolverStatistics() bool { - if x != nil && x.LogSubsolverStatistics != nil { - return *x.LogSubsolverStatistics - } - return Default_SatParameters_LogSubsolverStatistics -} - -func (x *SatParameters) GetLogPrefix() string { - if x != nil && x.LogPrefix != nil { - return *x.LogPrefix - } - return Default_SatParameters_LogPrefix -} - -func (x *SatParameters) GetLogToStdout() bool { - if x != nil && x.LogToStdout != nil { - return *x.LogToStdout - } - return Default_SatParameters_LogToStdout -} - -func (x *SatParameters) GetLogToResponse() bool { - if x != nil && x.LogToResponse != nil { - return *x.LogToResponse - } - return Default_SatParameters_LogToResponse -} - -func (x *SatParameters) GetUsePbResolution() bool { - if x != nil && x.UsePbResolution != nil { - return *x.UsePbResolution - } - return Default_SatParameters_UsePbResolution -} - -func (x *SatParameters) GetMinimizeReductionDuringPbResolution() bool { - if x != nil && x.MinimizeReductionDuringPbResolution != nil { - return *x.MinimizeReductionDuringPbResolution - } - return Default_SatParameters_MinimizeReductionDuringPbResolution -} - -func (x *SatParameters) GetCountAssumptionLevelsInLbd() bool { - if x != nil && x.CountAssumptionLevelsInLbd != nil { - return *x.CountAssumptionLevelsInLbd - } - return Default_SatParameters_CountAssumptionLevelsInLbd -} - -func (x *SatParameters) GetPresolveBveThreshold() int32 { - if x != nil && x.PresolveBveThreshold != nil { - return *x.PresolveBveThreshold - } - return Default_SatParameters_PresolveBveThreshold -} - -func (x *SatParameters) GetFilterSatPostsolveClauses() bool { - if x != nil && x.FilterSatPostsolveClauses != nil { - return *x.FilterSatPostsolveClauses - } - return Default_SatParameters_FilterSatPostsolveClauses -} - -func (x *SatParameters) GetPresolveBveClauseWeight() int32 { - if x != nil && x.PresolveBveClauseWeight != nil { - return *x.PresolveBveClauseWeight - } - return Default_SatParameters_PresolveBveClauseWeight -} - -func (x *SatParameters) GetProbingDeterministicTimeLimit() float64 { - if x != nil && x.ProbingDeterministicTimeLimit != nil { - return *x.ProbingDeterministicTimeLimit - } - return Default_SatParameters_ProbingDeterministicTimeLimit -} - -func (x *SatParameters) GetPresolveProbingDeterministicTimeLimit() float64 { - if x != nil && x.PresolveProbingDeterministicTimeLimit != nil { - return *x.PresolveProbingDeterministicTimeLimit - } - return Default_SatParameters_PresolveProbingDeterministicTimeLimit -} - -func (x *SatParameters) GetPresolveBlockedClause() bool { - if x != nil && x.PresolveBlockedClause != nil { - return *x.PresolveBlockedClause - } - return Default_SatParameters_PresolveBlockedClause -} - -func (x *SatParameters) GetPresolveUseBva() bool { - if x != nil && x.PresolveUseBva != nil { - return *x.PresolveUseBva - } - return Default_SatParameters_PresolveUseBva -} - -func (x *SatParameters) GetPresolveBvaThreshold() int32 { - if x != nil && x.PresolveBvaThreshold != nil { - return *x.PresolveBvaThreshold - } - return Default_SatParameters_PresolveBvaThreshold -} - -func (x *SatParameters) GetMaxPresolveIterations() int32 { - if x != nil && x.MaxPresolveIterations != nil { - return *x.MaxPresolveIterations - } - return Default_SatParameters_MaxPresolveIterations -} - -func (x *SatParameters) GetCpModelPresolve() bool { - if x != nil && x.CpModelPresolve != nil { - return *x.CpModelPresolve - } - return Default_SatParameters_CpModelPresolve -} - -func (x *SatParameters) GetCpModelProbingLevel() int32 { - if x != nil && x.CpModelProbingLevel != nil { - return *x.CpModelProbingLevel - } - return Default_SatParameters_CpModelProbingLevel -} - -func (x *SatParameters) GetCpModelUseSatPresolve() bool { - if x != nil && x.CpModelUseSatPresolve != nil { - return *x.CpModelUseSatPresolve - } - return Default_SatParameters_CpModelUseSatPresolve -} - -func (x *SatParameters) GetLoadAtMostOnesInSatPresolve() bool { - if x != nil && x.LoadAtMostOnesInSatPresolve != nil { - return *x.LoadAtMostOnesInSatPresolve - } - return Default_SatParameters_LoadAtMostOnesInSatPresolve -} - -func (x *SatParameters) GetRemoveFixedVariablesEarly() bool { - if x != nil && x.RemoveFixedVariablesEarly != nil { - return *x.RemoveFixedVariablesEarly - } - return Default_SatParameters_RemoveFixedVariablesEarly -} - -func (x *SatParameters) GetDetectTableWithCost() bool { - if x != nil && x.DetectTableWithCost != nil { - return *x.DetectTableWithCost - } - return Default_SatParameters_DetectTableWithCost -} - -func (x *SatParameters) GetTableCompressionLevel() int32 { - if x != nil && x.TableCompressionLevel != nil { - return *x.TableCompressionLevel - } - return Default_SatParameters_TableCompressionLevel -} - -func (x *SatParameters) GetExpandAlldiffConstraints() bool { - if x != nil && x.ExpandAlldiffConstraints != nil { - return *x.ExpandAlldiffConstraints - } - return Default_SatParameters_ExpandAlldiffConstraints -} - -func (x *SatParameters) GetMaxAlldiffDomainSize() int32 { - if x != nil && x.MaxAlldiffDomainSize != nil { - return *x.MaxAlldiffDomainSize - } - return Default_SatParameters_MaxAlldiffDomainSize -} - -func (x *SatParameters) GetExpandReservoirConstraints() bool { - if x != nil && x.ExpandReservoirConstraints != nil { - return *x.ExpandReservoirConstraints - } - return Default_SatParameters_ExpandReservoirConstraints -} - -func (x *SatParameters) GetMaxDomainSizeForLinear2Expansion() int32 { - if x != nil && x.MaxDomainSizeForLinear2Expansion != nil { - return *x.MaxDomainSizeForLinear2Expansion - } - return Default_SatParameters_MaxDomainSizeForLinear2Expansion -} - -func (x *SatParameters) GetExpandReservoirUsingCircuit() bool { - if x != nil && x.ExpandReservoirUsingCircuit != nil { - return *x.ExpandReservoirUsingCircuit - } - return Default_SatParameters_ExpandReservoirUsingCircuit -} - -func (x *SatParameters) GetEncodeCumulativeAsReservoir() bool { - if x != nil && x.EncodeCumulativeAsReservoir != nil { - return *x.EncodeCumulativeAsReservoir - } - return Default_SatParameters_EncodeCumulativeAsReservoir -} - -func (x *SatParameters) GetMaxLinMaxSizeForExpansion() int32 { - if x != nil && x.MaxLinMaxSizeForExpansion != nil { - return *x.MaxLinMaxSizeForExpansion - } - return Default_SatParameters_MaxLinMaxSizeForExpansion -} - -func (x *SatParameters) GetDisableConstraintExpansion() bool { - if x != nil && x.DisableConstraintExpansion != nil { - return *x.DisableConstraintExpansion - } - return Default_SatParameters_DisableConstraintExpansion -} - -func (x *SatParameters) GetEncodeComplexLinearConstraintWithInteger() bool { - if x != nil && x.EncodeComplexLinearConstraintWithInteger != nil { - return *x.EncodeComplexLinearConstraintWithInteger - } - return Default_SatParameters_EncodeComplexLinearConstraintWithInteger -} - -func (x *SatParameters) GetMergeNoOverlapWorkLimit() float64 { - if x != nil && x.MergeNoOverlapWorkLimit != nil { - return *x.MergeNoOverlapWorkLimit - } - return Default_SatParameters_MergeNoOverlapWorkLimit -} - -func (x *SatParameters) GetMergeAtMostOneWorkLimit() float64 { - if x != nil && x.MergeAtMostOneWorkLimit != nil { - return *x.MergeAtMostOneWorkLimit - } - return Default_SatParameters_MergeAtMostOneWorkLimit -} - -func (x *SatParameters) GetPresolveSubstitutionLevel() int32 { - if x != nil && x.PresolveSubstitutionLevel != nil { - return *x.PresolveSubstitutionLevel - } - return Default_SatParameters_PresolveSubstitutionLevel -} - -func (x *SatParameters) GetPresolveExtractIntegerEnforcement() bool { - if x != nil && x.PresolveExtractIntegerEnforcement != nil { - return *x.PresolveExtractIntegerEnforcement - } - return Default_SatParameters_PresolveExtractIntegerEnforcement -} - -func (x *SatParameters) GetPresolveInclusionWorkLimit() int64 { - if x != nil && x.PresolveInclusionWorkLimit != nil { - return *x.PresolveInclusionWorkLimit - } - return Default_SatParameters_PresolveInclusionWorkLimit -} - -func (x *SatParameters) GetIgnoreNames() bool { - if x != nil && x.IgnoreNames != nil { - return *x.IgnoreNames - } - return Default_SatParameters_IgnoreNames -} - -func (x *SatParameters) GetInferAllDiffs() bool { - if x != nil && x.InferAllDiffs != nil { - return *x.InferAllDiffs - } - return Default_SatParameters_InferAllDiffs -} - -func (x *SatParameters) GetFindBigLinearOverlap() bool { - if x != nil && x.FindBigLinearOverlap != nil { - return *x.FindBigLinearOverlap - } - return Default_SatParameters_FindBigLinearOverlap -} - -func (x *SatParameters) GetFindClausesThatAreExactlyOne() bool { - if x != nil && x.FindClausesThatAreExactlyOne != nil { - return *x.FindClausesThatAreExactlyOne - } - return Default_SatParameters_FindClausesThatAreExactlyOne -} - -func (x *SatParameters) GetUseSatInprocessing() bool { - if x != nil && x.UseSatInprocessing != nil { - return *x.UseSatInprocessing - } - return Default_SatParameters_UseSatInprocessing -} - -func (x *SatParameters) GetInprocessingDtimeRatio() float64 { - if x != nil && x.InprocessingDtimeRatio != nil { - return *x.InprocessingDtimeRatio - } - return Default_SatParameters_InprocessingDtimeRatio -} - -func (x *SatParameters) GetInprocessingProbingDtime() float64 { - if x != nil && x.InprocessingProbingDtime != nil { - return *x.InprocessingProbingDtime - } - return Default_SatParameters_InprocessingProbingDtime -} - -func (x *SatParameters) GetInprocessingMinimizationDtime() float64 { - if x != nil && x.InprocessingMinimizationDtime != nil { - return *x.InprocessingMinimizationDtime - } - return Default_SatParameters_InprocessingMinimizationDtime -} - -func (x *SatParameters) GetInprocessingMinimizationUseConflictAnalysis() bool { - if x != nil && x.InprocessingMinimizationUseConflictAnalysis != nil { - return *x.InprocessingMinimizationUseConflictAnalysis - } - return Default_SatParameters_InprocessingMinimizationUseConflictAnalysis -} - -func (x *SatParameters) GetInprocessingMinimizationUseAllOrderings() bool { - if x != nil && x.InprocessingMinimizationUseAllOrderings != nil { - return *x.InprocessingMinimizationUseAllOrderings - } - return Default_SatParameters_InprocessingMinimizationUseAllOrderings -} - -func (x *SatParameters) GetInprocessingUseCongruenceClosure() bool { - if x != nil && x.InprocessingUseCongruenceClosure != nil { - return *x.InprocessingUseCongruenceClosure - } - return Default_SatParameters_InprocessingUseCongruenceClosure -} - -func (x *SatParameters) GetInprocessingUseSatSweeping() bool { - if x != nil && x.InprocessingUseSatSweeping != nil { - return *x.InprocessingUseSatSweeping - } - return Default_SatParameters_InprocessingUseSatSweeping -} - -func (x *SatParameters) GetNumWorkers() int32 { - if x != nil && x.NumWorkers != nil { - return *x.NumWorkers - } - return Default_SatParameters_NumWorkers -} - -func (x *SatParameters) GetNumSearchWorkers() int32 { - if x != nil && x.NumSearchWorkers != nil { - return *x.NumSearchWorkers - } - return Default_SatParameters_NumSearchWorkers -} - -func (x *SatParameters) GetNumFullSubsolvers() int32 { - if x != nil && x.NumFullSubsolvers != nil { - return *x.NumFullSubsolvers - } - return Default_SatParameters_NumFullSubsolvers -} - -func (x *SatParameters) GetSubsolvers() []string { - if x != nil { - return x.Subsolvers - } - return nil -} - -func (x *SatParameters) GetExtraSubsolvers() []string { - if x != nil { - return x.ExtraSubsolvers - } - return nil -} - -func (x *SatParameters) GetIgnoreSubsolvers() []string { - if x != nil { - return x.IgnoreSubsolvers - } - return nil -} - -func (x *SatParameters) GetFilterSubsolvers() []string { - if x != nil { - return x.FilterSubsolvers - } - return nil -} - -func (x *SatParameters) GetSubsolverParams() []*SatParameters { - if x != nil { - return x.SubsolverParams - } - return nil -} - -func (x *SatParameters) GetInterleaveSearch() bool { - if x != nil && x.InterleaveSearch != nil { - return *x.InterleaveSearch - } - return Default_SatParameters_InterleaveSearch -} - -func (x *SatParameters) GetInterleaveBatchSize() int32 { - if x != nil && x.InterleaveBatchSize != nil { - return *x.InterleaveBatchSize - } - return Default_SatParameters_InterleaveBatchSize -} - -func (x *SatParameters) GetShareObjectiveBounds() bool { - if x != nil && x.ShareObjectiveBounds != nil { - return *x.ShareObjectiveBounds - } - return Default_SatParameters_ShareObjectiveBounds -} - -func (x *SatParameters) GetShareLevelZeroBounds() bool { - if x != nil && x.ShareLevelZeroBounds != nil { - return *x.ShareLevelZeroBounds - } - return Default_SatParameters_ShareLevelZeroBounds -} - -func (x *SatParameters) GetShareLinear2Bounds() bool { - if x != nil && x.ShareLinear2Bounds != nil { - return *x.ShareLinear2Bounds - } - return Default_SatParameters_ShareLinear2Bounds -} - -func (x *SatParameters) GetShareBinaryClauses() bool { - if x != nil && x.ShareBinaryClauses != nil { - return *x.ShareBinaryClauses - } - return Default_SatParameters_ShareBinaryClauses -} - -func (x *SatParameters) GetShareGlueClauses() bool { - if x != nil && x.ShareGlueClauses != nil { - return *x.ShareGlueClauses - } - return Default_SatParameters_ShareGlueClauses -} - -func (x *SatParameters) GetMinimizeSharedClauses() bool { - if x != nil && x.MinimizeSharedClauses != nil { - return *x.MinimizeSharedClauses - } - return Default_SatParameters_MinimizeSharedClauses -} - -func (x *SatParameters) GetShareGlueClausesDtime() float64 { - if x != nil && x.ShareGlueClausesDtime != nil { - return *x.ShareGlueClausesDtime - } - return Default_SatParameters_ShareGlueClausesDtime -} - -func (x *SatParameters) GetCheckLratProof() bool { - if x != nil && x.CheckLratProof != nil { - return *x.CheckLratProof - } - return Default_SatParameters_CheckLratProof -} - -func (x *SatParameters) GetCheckMergedLratProof() bool { - if x != nil && x.CheckMergedLratProof != nil { - return *x.CheckMergedLratProof - } - return Default_SatParameters_CheckMergedLratProof -} - -func (x *SatParameters) GetOutputLratProof() bool { - if x != nil && x.OutputLratProof != nil { - return *x.OutputLratProof - } - return Default_SatParameters_OutputLratProof -} - -func (x *SatParameters) GetCheckDratProof() bool { - if x != nil && x.CheckDratProof != nil { - return *x.CheckDratProof - } - return Default_SatParameters_CheckDratProof -} - -func (x *SatParameters) GetOutputDratProof() bool { - if x != nil && x.OutputDratProof != nil { - return *x.OutputDratProof - } - return Default_SatParameters_OutputDratProof -} - -func (x *SatParameters) GetMaxDratTimeInSeconds() float64 { - if x != nil && x.MaxDratTimeInSeconds != nil { - return *x.MaxDratTimeInSeconds - } - return Default_SatParameters_MaxDratTimeInSeconds -} - -func (x *SatParameters) GetDebugPostsolveWithFullSolver() bool { - if x != nil && x.DebugPostsolveWithFullSolver != nil { - return *x.DebugPostsolveWithFullSolver - } - return Default_SatParameters_DebugPostsolveWithFullSolver -} - -func (x *SatParameters) GetDebugMaxNumPresolveOperations() int32 { - if x != nil && x.DebugMaxNumPresolveOperations != nil { - return *x.DebugMaxNumPresolveOperations - } - return Default_SatParameters_DebugMaxNumPresolveOperations -} - -func (x *SatParameters) GetDebugCrashOnBadHint() bool { - if x != nil && x.DebugCrashOnBadHint != nil { - return *x.DebugCrashOnBadHint - } - return Default_SatParameters_DebugCrashOnBadHint -} - -func (x *SatParameters) GetDebugCrashIfPresolveBreaksHint() bool { - if x != nil && x.DebugCrashIfPresolveBreaksHint != nil { - return *x.DebugCrashIfPresolveBreaksHint - } - return Default_SatParameters_DebugCrashIfPresolveBreaksHint -} - -func (x *SatParameters) GetDebugCrashIfLratCheckFails() bool { - if x != nil && x.DebugCrashIfLratCheckFails != nil { - return *x.DebugCrashIfLratCheckFails - } - return Default_SatParameters_DebugCrashIfLratCheckFails -} - -func (x *SatParameters) GetUseOptimizationHints() bool { - if x != nil && x.UseOptimizationHints != nil { - return *x.UseOptimizationHints - } - return Default_SatParameters_UseOptimizationHints -} - -func (x *SatParameters) GetCoreMinimizationLevel() int32 { - if x != nil && x.CoreMinimizationLevel != nil { - return *x.CoreMinimizationLevel - } - return Default_SatParameters_CoreMinimizationLevel -} - -func (x *SatParameters) GetFindMultipleCores() bool { - if x != nil && x.FindMultipleCores != nil { - return *x.FindMultipleCores - } - return Default_SatParameters_FindMultipleCores -} - -func (x *SatParameters) GetCoverOptimization() bool { - if x != nil && x.CoverOptimization != nil { - return *x.CoverOptimization - } - return Default_SatParameters_CoverOptimization -} - -func (x *SatParameters) GetMaxSatAssumptionOrder() SatParameters_MaxSatAssumptionOrder { - if x != nil && x.MaxSatAssumptionOrder != nil { - return *x.MaxSatAssumptionOrder - } - return Default_SatParameters_MaxSatAssumptionOrder -} - -func (x *SatParameters) GetMaxSatReverseAssumptionOrder() bool { - if x != nil && x.MaxSatReverseAssumptionOrder != nil { - return *x.MaxSatReverseAssumptionOrder - } - return Default_SatParameters_MaxSatReverseAssumptionOrder -} - -func (x *SatParameters) GetMaxSatStratification() SatParameters_MaxSatStratificationAlgorithm { - if x != nil && x.MaxSatStratification != nil { - return *x.MaxSatStratification - } - return Default_SatParameters_MaxSatStratification -} - -func (x *SatParameters) GetPropagationLoopDetectionFactor() float64 { - if x != nil && x.PropagationLoopDetectionFactor != nil { - return *x.PropagationLoopDetectionFactor - } - return Default_SatParameters_PropagationLoopDetectionFactor -} - -func (x *SatParameters) GetUsePrecedencesInDisjunctiveConstraint() bool { - if x != nil && x.UsePrecedencesInDisjunctiveConstraint != nil { - return *x.UsePrecedencesInDisjunctiveConstraint - } - return Default_SatParameters_UsePrecedencesInDisjunctiveConstraint -} - -func (x *SatParameters) GetTransitivePrecedencesWorkLimit() int32 { - if x != nil && x.TransitivePrecedencesWorkLimit != nil { - return *x.TransitivePrecedencesWorkLimit - } - return Default_SatParameters_TransitivePrecedencesWorkLimit -} - -func (x *SatParameters) GetMaxSizeToCreatePrecedenceLiteralsInDisjunctive() int32 { - if x != nil && x.MaxSizeToCreatePrecedenceLiteralsInDisjunctive != nil { - return *x.MaxSizeToCreatePrecedenceLiteralsInDisjunctive - } - return Default_SatParameters_MaxSizeToCreatePrecedenceLiteralsInDisjunctive -} - -func (x *SatParameters) GetUseStrongPropagationInDisjunctive() bool { - if x != nil && x.UseStrongPropagationInDisjunctive != nil { - return *x.UseStrongPropagationInDisjunctive - } - return Default_SatParameters_UseStrongPropagationInDisjunctive -} - -func (x *SatParameters) GetUseDynamicPrecedenceInDisjunctive() bool { - if x != nil && x.UseDynamicPrecedenceInDisjunctive != nil { - return *x.UseDynamicPrecedenceInDisjunctive - } - return Default_SatParameters_UseDynamicPrecedenceInDisjunctive -} - -func (x *SatParameters) GetUseDynamicPrecedenceInCumulative() bool { - if x != nil && x.UseDynamicPrecedenceInCumulative != nil { - return *x.UseDynamicPrecedenceInCumulative - } - return Default_SatParameters_UseDynamicPrecedenceInCumulative -} - -func (x *SatParameters) GetUseOverloadCheckerInCumulative() bool { - if x != nil && x.UseOverloadCheckerInCumulative != nil { - return *x.UseOverloadCheckerInCumulative - } - return Default_SatParameters_UseOverloadCheckerInCumulative -} - -func (x *SatParameters) GetUseConservativeScaleOverloadChecker() bool { - if x != nil && x.UseConservativeScaleOverloadChecker != nil { - return *x.UseConservativeScaleOverloadChecker - } - return Default_SatParameters_UseConservativeScaleOverloadChecker -} - -func (x *SatParameters) GetUseTimetableEdgeFindingInCumulative() bool { - if x != nil && x.UseTimetableEdgeFindingInCumulative != nil { - return *x.UseTimetableEdgeFindingInCumulative - } - return Default_SatParameters_UseTimetableEdgeFindingInCumulative -} - -func (x *SatParameters) GetMaxNumIntervalsForTimetableEdgeFinding() int32 { - if x != nil && x.MaxNumIntervalsForTimetableEdgeFinding != nil { - return *x.MaxNumIntervalsForTimetableEdgeFinding - } - return Default_SatParameters_MaxNumIntervalsForTimetableEdgeFinding -} - -func (x *SatParameters) GetUseHardPrecedencesInCumulative() bool { - if x != nil && x.UseHardPrecedencesInCumulative != nil { - return *x.UseHardPrecedencesInCumulative - } - return Default_SatParameters_UseHardPrecedencesInCumulative -} - -func (x *SatParameters) GetExploitAllPrecedences() bool { - if x != nil && x.ExploitAllPrecedences != nil { - return *x.ExploitAllPrecedences - } - return Default_SatParameters_ExploitAllPrecedences -} - -func (x *SatParameters) GetUseDisjunctiveConstraintInCumulative() bool { - if x != nil && x.UseDisjunctiveConstraintInCumulative != nil { - return *x.UseDisjunctiveConstraintInCumulative - } - return Default_SatParameters_UseDisjunctiveConstraintInCumulative -} - -func (x *SatParameters) GetNoOverlap_2DBooleanRelationsLimit() int32 { - if x != nil && x.NoOverlap_2DBooleanRelationsLimit != nil { - return *x.NoOverlap_2DBooleanRelationsLimit - } - return Default_SatParameters_NoOverlap_2DBooleanRelationsLimit -} - -func (x *SatParameters) GetUseTimetablingInNoOverlap_2D() bool { - if x != nil && x.UseTimetablingInNoOverlap_2D != nil { - return *x.UseTimetablingInNoOverlap_2D - } - return Default_SatParameters_UseTimetablingInNoOverlap_2D -} - -func (x *SatParameters) GetUseEnergeticReasoningInNoOverlap_2D() bool { - if x != nil && x.UseEnergeticReasoningInNoOverlap_2D != nil { - return *x.UseEnergeticReasoningInNoOverlap_2D - } - return Default_SatParameters_UseEnergeticReasoningInNoOverlap_2D -} - -func (x *SatParameters) GetUseAreaEnergeticReasoningInNoOverlap_2D() bool { - if x != nil && x.UseAreaEnergeticReasoningInNoOverlap_2D != nil { - return *x.UseAreaEnergeticReasoningInNoOverlap_2D - } - return Default_SatParameters_UseAreaEnergeticReasoningInNoOverlap_2D -} - -func (x *SatParameters) GetUseTryEdgeReasoningInNoOverlap_2D() bool { - if x != nil && x.UseTryEdgeReasoningInNoOverlap_2D != nil { - return *x.UseTryEdgeReasoningInNoOverlap_2D - } - return Default_SatParameters_UseTryEdgeReasoningInNoOverlap_2D -} - -func (x *SatParameters) GetMaxPairsPairwiseReasoningInNoOverlap_2D() int32 { - if x != nil && x.MaxPairsPairwiseReasoningInNoOverlap_2D != nil { - return *x.MaxPairsPairwiseReasoningInNoOverlap_2D - } - return Default_SatParameters_MaxPairsPairwiseReasoningInNoOverlap_2D -} - -func (x *SatParameters) GetMaximumRegionsToSplitInDisconnectedNoOverlap_2D() int32 { - if x != nil && x.MaximumRegionsToSplitInDisconnectedNoOverlap_2D != nil { - return *x.MaximumRegionsToSplitInDisconnectedNoOverlap_2D - } - return Default_SatParameters_MaximumRegionsToSplitInDisconnectedNoOverlap_2D -} - -func (x *SatParameters) GetUseLinear3ForNoOverlap_2DPrecedences() bool { - if x != nil && x.UseLinear3ForNoOverlap_2DPrecedences != nil { - return *x.UseLinear3ForNoOverlap_2DPrecedences - } - return Default_SatParameters_UseLinear3ForNoOverlap_2DPrecedences -} - -func (x *SatParameters) GetUseDualSchedulingHeuristics() bool { - if x != nil && x.UseDualSchedulingHeuristics != nil { - return *x.UseDualSchedulingHeuristics - } - return Default_SatParameters_UseDualSchedulingHeuristics -} - -func (x *SatParameters) GetUseAllDifferentForCircuit() bool { - if x != nil && x.UseAllDifferentForCircuit != nil { - return *x.UseAllDifferentForCircuit - } - return Default_SatParameters_UseAllDifferentForCircuit -} - -func (x *SatParameters) GetRoutingCutSubsetSizeForBinaryRelationBound() int32 { - if x != nil && x.RoutingCutSubsetSizeForBinaryRelationBound != nil { - return *x.RoutingCutSubsetSizeForBinaryRelationBound - } - return Default_SatParameters_RoutingCutSubsetSizeForBinaryRelationBound -} - -func (x *SatParameters) GetRoutingCutSubsetSizeForTightBinaryRelationBound() int32 { - if x != nil && x.RoutingCutSubsetSizeForTightBinaryRelationBound != nil { - return *x.RoutingCutSubsetSizeForTightBinaryRelationBound - } - return Default_SatParameters_RoutingCutSubsetSizeForTightBinaryRelationBound -} - -func (x *SatParameters) GetRoutingCutSubsetSizeForExactBinaryRelationBound() int32 { - if x != nil && x.RoutingCutSubsetSizeForExactBinaryRelationBound != nil { - return *x.RoutingCutSubsetSizeForExactBinaryRelationBound - } - return Default_SatParameters_RoutingCutSubsetSizeForExactBinaryRelationBound -} - -func (x *SatParameters) GetRoutingCutSubsetSizeForShortestPathsBound() int32 { - if x != nil && x.RoutingCutSubsetSizeForShortestPathsBound != nil { - return *x.RoutingCutSubsetSizeForShortestPathsBound - } - return Default_SatParameters_RoutingCutSubsetSizeForShortestPathsBound -} - -func (x *SatParameters) GetRoutingCutDpEffort() float64 { - if x != nil && x.RoutingCutDpEffort != nil { - return *x.RoutingCutDpEffort - } - return Default_SatParameters_RoutingCutDpEffort -} - -func (x *SatParameters) GetRoutingCutMaxInfeasiblePathLength() int32 { - if x != nil && x.RoutingCutMaxInfeasiblePathLength != nil { - return *x.RoutingCutMaxInfeasiblePathLength - } - return Default_SatParameters_RoutingCutMaxInfeasiblePathLength -} - -func (x *SatParameters) GetSearchBranching() SatParameters_SearchBranching { - if x != nil && x.SearchBranching != nil { - return *x.SearchBranching - } - return Default_SatParameters_SearchBranching -} - -func (x *SatParameters) GetHintConflictLimit() int32 { - if x != nil && x.HintConflictLimit != nil { - return *x.HintConflictLimit - } - return Default_SatParameters_HintConflictLimit -} - -func (x *SatParameters) GetRepairHint() bool { - if x != nil && x.RepairHint != nil { - return *x.RepairHint - } - return Default_SatParameters_RepairHint -} - -func (x *SatParameters) GetFixVariablesToTheirHintedValue() bool { - if x != nil && x.FixVariablesToTheirHintedValue != nil { - return *x.FixVariablesToTheirHintedValue - } - return Default_SatParameters_FixVariablesToTheirHintedValue -} - -func (x *SatParameters) GetUseProbingSearch() bool { - if x != nil && x.UseProbingSearch != nil { - return *x.UseProbingSearch - } - return Default_SatParameters_UseProbingSearch -} - -func (x *SatParameters) GetUseExtendedProbing() bool { - if x != nil && x.UseExtendedProbing != nil { - return *x.UseExtendedProbing - } - return Default_SatParameters_UseExtendedProbing -} - -func (x *SatParameters) GetProbingNumCombinationsLimit() int32 { - if x != nil && x.ProbingNumCombinationsLimit != nil { - return *x.ProbingNumCombinationsLimit - } - return Default_SatParameters_ProbingNumCombinationsLimit -} - -func (x *SatParameters) GetShavingDeterministicTimeInProbingSearch() float64 { - if x != nil && x.ShavingDeterministicTimeInProbingSearch != nil { - return *x.ShavingDeterministicTimeInProbingSearch - } - return Default_SatParameters_ShavingDeterministicTimeInProbingSearch -} - -func (x *SatParameters) GetShavingSearchDeterministicTime() float64 { - if x != nil && x.ShavingSearchDeterministicTime != nil { - return *x.ShavingSearchDeterministicTime - } - return Default_SatParameters_ShavingSearchDeterministicTime -} - -func (x *SatParameters) GetShavingSearchThreshold() int64 { - if x != nil && x.ShavingSearchThreshold != nil { - return *x.ShavingSearchThreshold - } - return Default_SatParameters_ShavingSearchThreshold -} - -func (x *SatParameters) GetUseObjectiveLbSearch() bool { - if x != nil && x.UseObjectiveLbSearch != nil { - return *x.UseObjectiveLbSearch - } - return Default_SatParameters_UseObjectiveLbSearch -} - -func (x *SatParameters) GetUseObjectiveShavingSearch() bool { - if x != nil && x.UseObjectiveShavingSearch != nil { - return *x.UseObjectiveShavingSearch - } - return Default_SatParameters_UseObjectiveShavingSearch -} - -func (x *SatParameters) GetVariablesShavingLevel() int32 { - if x != nil && x.VariablesShavingLevel != nil { - return *x.VariablesShavingLevel - } - return Default_SatParameters_VariablesShavingLevel -} - -func (x *SatParameters) GetPseudoCostReliabilityThreshold() int64 { - if x != nil && x.PseudoCostReliabilityThreshold != nil { - return *x.PseudoCostReliabilityThreshold - } - return Default_SatParameters_PseudoCostReliabilityThreshold -} - -func (x *SatParameters) GetOptimizeWithCore() bool { - if x != nil && x.OptimizeWithCore != nil { - return *x.OptimizeWithCore - } - return Default_SatParameters_OptimizeWithCore -} - -func (x *SatParameters) GetOptimizeWithLbTreeSearch() bool { - if x != nil && x.OptimizeWithLbTreeSearch != nil { - return *x.OptimizeWithLbTreeSearch - } - return Default_SatParameters_OptimizeWithLbTreeSearch -} - -func (x *SatParameters) GetSaveLpBasisInLbTreeSearch() bool { - if x != nil && x.SaveLpBasisInLbTreeSearch != nil { - return *x.SaveLpBasisInLbTreeSearch - } - return Default_SatParameters_SaveLpBasisInLbTreeSearch -} - -func (x *SatParameters) GetBinarySearchNumConflicts() int32 { - if x != nil && x.BinarySearchNumConflicts != nil { - return *x.BinarySearchNumConflicts - } - return Default_SatParameters_BinarySearchNumConflicts -} - -func (x *SatParameters) GetOptimizeWithMaxHs() bool { - if x != nil && x.OptimizeWithMaxHs != nil { - return *x.OptimizeWithMaxHs - } - return Default_SatParameters_OptimizeWithMaxHs -} - -func (x *SatParameters) GetUseFeasibilityJump() bool { - if x != nil && x.UseFeasibilityJump != nil { - return *x.UseFeasibilityJump - } - return Default_SatParameters_UseFeasibilityJump -} - -func (x *SatParameters) GetUseLsOnly() bool { - if x != nil && x.UseLsOnly != nil { - return *x.UseLsOnly - } - return Default_SatParameters_UseLsOnly -} - -func (x *SatParameters) GetFeasibilityJumpDecay() float64 { - if x != nil && x.FeasibilityJumpDecay != nil { - return *x.FeasibilityJumpDecay - } - return Default_SatParameters_FeasibilityJumpDecay -} - -func (x *SatParameters) GetFeasibilityJumpLinearizationLevel() int32 { - if x != nil && x.FeasibilityJumpLinearizationLevel != nil { - return *x.FeasibilityJumpLinearizationLevel - } - return Default_SatParameters_FeasibilityJumpLinearizationLevel -} - -func (x *SatParameters) GetFeasibilityJumpRestartFactor() int32 { - if x != nil && x.FeasibilityJumpRestartFactor != nil { - return *x.FeasibilityJumpRestartFactor - } - return Default_SatParameters_FeasibilityJumpRestartFactor -} - -func (x *SatParameters) GetFeasibilityJumpBatchDtime() float64 { - if x != nil && x.FeasibilityJumpBatchDtime != nil { - return *x.FeasibilityJumpBatchDtime - } - return Default_SatParameters_FeasibilityJumpBatchDtime -} - -func (x *SatParameters) GetFeasibilityJumpVarRandomizationProbability() float64 { - if x != nil && x.FeasibilityJumpVarRandomizationProbability != nil { - return *x.FeasibilityJumpVarRandomizationProbability - } - return Default_SatParameters_FeasibilityJumpVarRandomizationProbability -} - -func (x *SatParameters) GetFeasibilityJumpVarPerburbationRangeRatio() float64 { - if x != nil && x.FeasibilityJumpVarPerburbationRangeRatio != nil { - return *x.FeasibilityJumpVarPerburbationRangeRatio - } - return Default_SatParameters_FeasibilityJumpVarPerburbationRangeRatio -} - -func (x *SatParameters) GetFeasibilityJumpEnableRestarts() bool { - if x != nil && x.FeasibilityJumpEnableRestarts != nil { - return *x.FeasibilityJumpEnableRestarts - } - return Default_SatParameters_FeasibilityJumpEnableRestarts -} - -func (x *SatParameters) GetFeasibilityJumpMaxExpandedConstraintSize() int32 { - if x != nil && x.FeasibilityJumpMaxExpandedConstraintSize != nil { - return *x.FeasibilityJumpMaxExpandedConstraintSize - } - return Default_SatParameters_FeasibilityJumpMaxExpandedConstraintSize -} - -func (x *SatParameters) GetNumViolationLs() int32 { - if x != nil && x.NumViolationLs != nil { - return *x.NumViolationLs - } - return Default_SatParameters_NumViolationLs -} - -func (x *SatParameters) GetViolationLsPerturbationPeriod() int32 { - if x != nil && x.ViolationLsPerturbationPeriod != nil { - return *x.ViolationLsPerturbationPeriod - } - return Default_SatParameters_ViolationLsPerturbationPeriod -} - -func (x *SatParameters) GetViolationLsCompoundMoveProbability() float64 { - if x != nil && x.ViolationLsCompoundMoveProbability != nil { - return *x.ViolationLsCompoundMoveProbability - } - return Default_SatParameters_ViolationLsCompoundMoveProbability -} - -func (x *SatParameters) GetSharedTreeNumWorkers() int32 { - if x != nil && x.SharedTreeNumWorkers != nil { - return *x.SharedTreeNumWorkers - } - return Default_SatParameters_SharedTreeNumWorkers -} - -func (x *SatParameters) GetUseSharedTreeSearch() bool { - if x != nil && x.UseSharedTreeSearch != nil { - return *x.UseSharedTreeSearch - } - return Default_SatParameters_UseSharedTreeSearch -} - -func (x *SatParameters) GetSharedTreeWorkerMinRestartsPerSubtree() int32 { - if x != nil && x.SharedTreeWorkerMinRestartsPerSubtree != nil { - return *x.SharedTreeWorkerMinRestartsPerSubtree - } - return Default_SatParameters_SharedTreeWorkerMinRestartsPerSubtree -} - -func (x *SatParameters) GetSharedTreeWorkerEnableTrailSharing() bool { - if x != nil && x.SharedTreeWorkerEnableTrailSharing != nil { - return *x.SharedTreeWorkerEnableTrailSharing - } - return Default_SatParameters_SharedTreeWorkerEnableTrailSharing -} - -func (x *SatParameters) GetSharedTreeWorkerEnablePhaseSharing() bool { - if x != nil && x.SharedTreeWorkerEnablePhaseSharing != nil { - return *x.SharedTreeWorkerEnablePhaseSharing - } - return Default_SatParameters_SharedTreeWorkerEnablePhaseSharing -} - -func (x *SatParameters) GetSharedTreeOpenLeavesPerWorker() float64 { - if x != nil && x.SharedTreeOpenLeavesPerWorker != nil { - return *x.SharedTreeOpenLeavesPerWorker - } - return Default_SatParameters_SharedTreeOpenLeavesPerWorker -} - -func (x *SatParameters) GetSharedTreeMaxNodesPerWorker() int32 { - if x != nil && x.SharedTreeMaxNodesPerWorker != nil { - return *x.SharedTreeMaxNodesPerWorker - } - return Default_SatParameters_SharedTreeMaxNodesPerWorker -} - -func (x *SatParameters) GetSharedTreeSplitStrategy() SatParameters_SharedTreeSplitStrategy { - if x != nil && x.SharedTreeSplitStrategy != nil { - return *x.SharedTreeSplitStrategy - } - return Default_SatParameters_SharedTreeSplitStrategy -} - -func (x *SatParameters) GetSharedTreeBalanceTolerance() int32 { - if x != nil && x.SharedTreeBalanceTolerance != nil { - return *x.SharedTreeBalanceTolerance - } - return Default_SatParameters_SharedTreeBalanceTolerance -} - -func (x *SatParameters) GetSharedTreeSplitMinDtime() float64 { - if x != nil && x.SharedTreeSplitMinDtime != nil { - return *x.SharedTreeSplitMinDtime - } - return Default_SatParameters_SharedTreeSplitMinDtime -} - -func (x *SatParameters) GetEnumerateAllSolutions() bool { - if x != nil && x.EnumerateAllSolutions != nil { - return *x.EnumerateAllSolutions - } - return Default_SatParameters_EnumerateAllSolutions -} - -func (x *SatParameters) GetKeepAllFeasibleSolutionsInPresolve() bool { - if x != nil && x.KeepAllFeasibleSolutionsInPresolve != nil { - return *x.KeepAllFeasibleSolutionsInPresolve - } - return Default_SatParameters_KeepAllFeasibleSolutionsInPresolve -} - -func (x *SatParameters) GetFillTightenedDomainsInResponse() bool { - if x != nil && x.FillTightenedDomainsInResponse != nil { - return *x.FillTightenedDomainsInResponse - } - return Default_SatParameters_FillTightenedDomainsInResponse -} - -func (x *SatParameters) GetFillAdditionalSolutionsInResponse() bool { - if x != nil && x.FillAdditionalSolutionsInResponse != nil { - return *x.FillAdditionalSolutionsInResponse - } - return Default_SatParameters_FillAdditionalSolutionsInResponse -} - -func (x *SatParameters) GetInstantiateAllVariables() bool { - if x != nil && x.InstantiateAllVariables != nil { - return *x.InstantiateAllVariables - } - return Default_SatParameters_InstantiateAllVariables -} - -func (x *SatParameters) GetAutoDetectGreaterThanAtLeastOneOf() bool { - if x != nil && x.AutoDetectGreaterThanAtLeastOneOf != nil { - return *x.AutoDetectGreaterThanAtLeastOneOf - } - return Default_SatParameters_AutoDetectGreaterThanAtLeastOneOf -} - -func (x *SatParameters) GetStopAfterFirstSolution() bool { - if x != nil && x.StopAfterFirstSolution != nil { - return *x.StopAfterFirstSolution - } - return Default_SatParameters_StopAfterFirstSolution -} - -func (x *SatParameters) GetStopAfterPresolve() bool { - if x != nil && x.StopAfterPresolve != nil { - return *x.StopAfterPresolve - } - return Default_SatParameters_StopAfterPresolve -} - -func (x *SatParameters) GetStopAfterRootPropagation() bool { - if x != nil && x.StopAfterRootPropagation != nil { - return *x.StopAfterRootPropagation - } - return Default_SatParameters_StopAfterRootPropagation -} - -func (x *SatParameters) GetLnsInitialDifficulty() float64 { - if x != nil && x.LnsInitialDifficulty != nil { - return *x.LnsInitialDifficulty - } - return Default_SatParameters_LnsInitialDifficulty -} - -func (x *SatParameters) GetLnsInitialDeterministicLimit() float64 { - if x != nil && x.LnsInitialDeterministicLimit != nil { - return *x.LnsInitialDeterministicLimit - } - return Default_SatParameters_LnsInitialDeterministicLimit -} - -func (x *SatParameters) GetUseLns() bool { - if x != nil && x.UseLns != nil { - return *x.UseLns - } - return Default_SatParameters_UseLns -} - -func (x *SatParameters) GetUseLnsOnly() bool { - if x != nil && x.UseLnsOnly != nil { - return *x.UseLnsOnly - } - return Default_SatParameters_UseLnsOnly -} - -func (x *SatParameters) GetSolutionPoolSize() int32 { - if x != nil && x.SolutionPoolSize != nil { - return *x.SolutionPoolSize - } - return Default_SatParameters_SolutionPoolSize -} - -func (x *SatParameters) GetSolutionPoolDiversityLimit() int32 { - if x != nil && x.SolutionPoolDiversityLimit != nil { - return *x.SolutionPoolDiversityLimit - } - return Default_SatParameters_SolutionPoolDiversityLimit -} - -func (x *SatParameters) GetAlternativePoolSize() int32 { - if x != nil && x.AlternativePoolSize != nil { - return *x.AlternativePoolSize - } - return Default_SatParameters_AlternativePoolSize -} - -func (x *SatParameters) GetUseRinsLns() bool { - if x != nil && x.UseRinsLns != nil { - return *x.UseRinsLns - } - return Default_SatParameters_UseRinsLns -} - -func (x *SatParameters) GetUseFeasibilityPump() bool { - if x != nil && x.UseFeasibilityPump != nil { - return *x.UseFeasibilityPump - } - return Default_SatParameters_UseFeasibilityPump -} - -func (x *SatParameters) GetUseLbRelaxLns() bool { - if x != nil && x.UseLbRelaxLns != nil { - return *x.UseLbRelaxLns - } - return Default_SatParameters_UseLbRelaxLns -} - -func (x *SatParameters) GetLbRelaxNumWorkersThreshold() int32 { - if x != nil && x.LbRelaxNumWorkersThreshold != nil { - return *x.LbRelaxNumWorkersThreshold - } - return Default_SatParameters_LbRelaxNumWorkersThreshold -} - -func (x *SatParameters) GetFpRounding() SatParameters_FPRoundingMethod { - if x != nil && x.FpRounding != nil { - return *x.FpRounding - } - return Default_SatParameters_FpRounding -} - -func (x *SatParameters) GetDiversifyLnsParams() bool { - if x != nil && x.DiversifyLnsParams != nil { - return *x.DiversifyLnsParams - } - return Default_SatParameters_DiversifyLnsParams -} - -func (x *SatParameters) GetRandomizeSearch() bool { - if x != nil && x.RandomizeSearch != nil { - return *x.RandomizeSearch - } - return Default_SatParameters_RandomizeSearch -} - -func (x *SatParameters) GetSearchRandomVariablePoolSize() int64 { - if x != nil && x.SearchRandomVariablePoolSize != nil { - return *x.SearchRandomVariablePoolSize - } - return Default_SatParameters_SearchRandomVariablePoolSize -} - -func (x *SatParameters) GetPushAllTasksTowardStart() bool { - if x != nil && x.PushAllTasksTowardStart != nil { - return *x.PushAllTasksTowardStart - } - return Default_SatParameters_PushAllTasksTowardStart -} - -func (x *SatParameters) GetUseOptionalVariables() bool { - if x != nil && x.UseOptionalVariables != nil { - return *x.UseOptionalVariables - } - return Default_SatParameters_UseOptionalVariables -} - -func (x *SatParameters) GetUseExactLpReason() bool { - if x != nil && x.UseExactLpReason != nil { - return *x.UseExactLpReason - } - return Default_SatParameters_UseExactLpReason -} - -func (x *SatParameters) GetUseCombinedNoOverlap() bool { - if x != nil && x.UseCombinedNoOverlap != nil { - return *x.UseCombinedNoOverlap - } - return Default_SatParameters_UseCombinedNoOverlap -} - -func (x *SatParameters) GetAtMostOneMaxExpansionSize() int32 { - if x != nil && x.AtMostOneMaxExpansionSize != nil { - return *x.AtMostOneMaxExpansionSize - } - return Default_SatParameters_AtMostOneMaxExpansionSize -} - -func (x *SatParameters) GetCatchSigintSignal() bool { - if x != nil && x.CatchSigintSignal != nil { - return *x.CatchSigintSignal - } - return Default_SatParameters_CatchSigintSignal -} - -func (x *SatParameters) GetUseImpliedBounds() bool { - if x != nil && x.UseImpliedBounds != nil { - return *x.UseImpliedBounds - } - return Default_SatParameters_UseImpliedBounds -} - -func (x *SatParameters) GetPolishLpSolution() bool { - if x != nil && x.PolishLpSolution != nil { - return *x.PolishLpSolution - } - return Default_SatParameters_PolishLpSolution -} - -func (x *SatParameters) GetLpPrimalTolerance() float64 { - if x != nil && x.LpPrimalTolerance != nil { - return *x.LpPrimalTolerance - } - return Default_SatParameters_LpPrimalTolerance -} - -func (x *SatParameters) GetLpDualTolerance() float64 { - if x != nil && x.LpDualTolerance != nil { - return *x.LpDualTolerance - } - return Default_SatParameters_LpDualTolerance -} - -func (x *SatParameters) GetConvertIntervals() bool { - if x != nil && x.ConvertIntervals != nil { - return *x.ConvertIntervals - } - return Default_SatParameters_ConvertIntervals -} - -func (x *SatParameters) GetSymmetryLevel() int32 { - if x != nil && x.SymmetryLevel != nil { - return *x.SymmetryLevel - } - return Default_SatParameters_SymmetryLevel -} - -func (x *SatParameters) GetUseSymmetryInLp() bool { - if x != nil && x.UseSymmetryInLp != nil { - return *x.UseSymmetryInLp - } - return Default_SatParameters_UseSymmetryInLp -} - -func (x *SatParameters) GetKeepSymmetryInPresolve() bool { - if x != nil && x.KeepSymmetryInPresolve != nil { - return *x.KeepSymmetryInPresolve - } - return Default_SatParameters_KeepSymmetryInPresolve -} - -func (x *SatParameters) GetSymmetryDetectionDeterministicTimeLimit() float64 { - if x != nil && x.SymmetryDetectionDeterministicTimeLimit != nil { - return *x.SymmetryDetectionDeterministicTimeLimit - } - return Default_SatParameters_SymmetryDetectionDeterministicTimeLimit -} - -func (x *SatParameters) GetNewLinearPropagation() bool { - if x != nil && x.NewLinearPropagation != nil { - return *x.NewLinearPropagation - } - return Default_SatParameters_NewLinearPropagation -} - -func (x *SatParameters) GetLinearSplitSize() int32 { - if x != nil && x.LinearSplitSize != nil { - return *x.LinearSplitSize - } - return Default_SatParameters_LinearSplitSize -} - -func (x *SatParameters) GetLinearizationLevel() int32 { - if x != nil && x.LinearizationLevel != nil { - return *x.LinearizationLevel - } - return Default_SatParameters_LinearizationLevel -} - -func (x *SatParameters) GetBooleanEncodingLevel() int32 { - if x != nil && x.BooleanEncodingLevel != nil { - return *x.BooleanEncodingLevel - } - return Default_SatParameters_BooleanEncodingLevel -} - -func (x *SatParameters) GetMaxDomainSizeWhenEncodingEqNeqConstraints() int32 { - if x != nil && x.MaxDomainSizeWhenEncodingEqNeqConstraints != nil { - return *x.MaxDomainSizeWhenEncodingEqNeqConstraints - } - return Default_SatParameters_MaxDomainSizeWhenEncodingEqNeqConstraints -} - -func (x *SatParameters) GetMaxNumCuts() int32 { - if x != nil && x.MaxNumCuts != nil { - return *x.MaxNumCuts - } - return Default_SatParameters_MaxNumCuts -} - -func (x *SatParameters) GetCutLevel() int32 { - if x != nil && x.CutLevel != nil { - return *x.CutLevel - } - return Default_SatParameters_CutLevel -} - -func (x *SatParameters) GetOnlyAddCutsAtLevelZero() bool { - if x != nil && x.OnlyAddCutsAtLevelZero != nil { - return *x.OnlyAddCutsAtLevelZero - } - return Default_SatParameters_OnlyAddCutsAtLevelZero -} - -func (x *SatParameters) GetAddObjectiveCut() bool { - if x != nil && x.AddObjectiveCut != nil { - return *x.AddObjectiveCut - } - return Default_SatParameters_AddObjectiveCut -} - -func (x *SatParameters) GetAddCgCuts() bool { - if x != nil && x.AddCgCuts != nil { - return *x.AddCgCuts - } - return Default_SatParameters_AddCgCuts -} - -func (x *SatParameters) GetAddMirCuts() bool { - if x != nil && x.AddMirCuts != nil { - return *x.AddMirCuts - } - return Default_SatParameters_AddMirCuts -} - -func (x *SatParameters) GetAddZeroHalfCuts() bool { - if x != nil && x.AddZeroHalfCuts != nil { - return *x.AddZeroHalfCuts - } - return Default_SatParameters_AddZeroHalfCuts -} - -func (x *SatParameters) GetAddCliqueCuts() bool { - if x != nil && x.AddCliqueCuts != nil { - return *x.AddCliqueCuts - } - return Default_SatParameters_AddCliqueCuts -} - -func (x *SatParameters) GetAddRltCuts() bool { - if x != nil && x.AddRltCuts != nil { - return *x.AddRltCuts - } - return Default_SatParameters_AddRltCuts -} - -func (x *SatParameters) GetMaxAllDiffCutSize() int32 { - if x != nil && x.MaxAllDiffCutSize != nil { - return *x.MaxAllDiffCutSize - } - return Default_SatParameters_MaxAllDiffCutSize -} - -func (x *SatParameters) GetAddLinMaxCuts() bool { - if x != nil && x.AddLinMaxCuts != nil { - return *x.AddLinMaxCuts - } - return Default_SatParameters_AddLinMaxCuts -} - -func (x *SatParameters) GetMaxIntegerRoundingScaling() int32 { - if x != nil && x.MaxIntegerRoundingScaling != nil { - return *x.MaxIntegerRoundingScaling - } - return Default_SatParameters_MaxIntegerRoundingScaling -} - -func (x *SatParameters) GetAddLpConstraintsLazily() bool { - if x != nil && x.AddLpConstraintsLazily != nil { - return *x.AddLpConstraintsLazily - } - return Default_SatParameters_AddLpConstraintsLazily -} - -func (x *SatParameters) GetRootLpIterations() int32 { - if x != nil && x.RootLpIterations != nil { - return *x.RootLpIterations - } - return Default_SatParameters_RootLpIterations -} - -func (x *SatParameters) GetMinOrthogonalityForLpConstraints() float64 { - if x != nil && x.MinOrthogonalityForLpConstraints != nil { - return *x.MinOrthogonalityForLpConstraints - } - return Default_SatParameters_MinOrthogonalityForLpConstraints -} - -func (x *SatParameters) GetMaxCutRoundsAtLevelZero() int32 { - if x != nil && x.MaxCutRoundsAtLevelZero != nil { - return *x.MaxCutRoundsAtLevelZero - } - return Default_SatParameters_MaxCutRoundsAtLevelZero -} - -func (x *SatParameters) GetMaxConsecutiveInactiveCount() int32 { - if x != nil && x.MaxConsecutiveInactiveCount != nil { - return *x.MaxConsecutiveInactiveCount - } - return Default_SatParameters_MaxConsecutiveInactiveCount -} - -func (x *SatParameters) GetCutMaxActiveCountValue() float64 { - if x != nil && x.CutMaxActiveCountValue != nil { - return *x.CutMaxActiveCountValue - } - return Default_SatParameters_CutMaxActiveCountValue -} - -func (x *SatParameters) GetCutActiveCountDecay() float64 { - if x != nil && x.CutActiveCountDecay != nil { - return *x.CutActiveCountDecay - } - return Default_SatParameters_CutActiveCountDecay -} - -func (x *SatParameters) GetCutCleanupTarget() int32 { - if x != nil && x.CutCleanupTarget != nil { - return *x.CutCleanupTarget - } - return Default_SatParameters_CutCleanupTarget -} - -func (x *SatParameters) GetNewConstraintsBatchSize() int32 { - if x != nil && x.NewConstraintsBatchSize != nil { - return *x.NewConstraintsBatchSize - } - return Default_SatParameters_NewConstraintsBatchSize -} - -func (x *SatParameters) GetExploitIntegerLpSolution() bool { - if x != nil && x.ExploitIntegerLpSolution != nil { - return *x.ExploitIntegerLpSolution - } - return Default_SatParameters_ExploitIntegerLpSolution -} - -func (x *SatParameters) GetExploitAllLpSolution() bool { - if x != nil && x.ExploitAllLpSolution != nil { - return *x.ExploitAllLpSolution - } - return Default_SatParameters_ExploitAllLpSolution -} - -func (x *SatParameters) GetExploitBestSolution() bool { - if x != nil && x.ExploitBestSolution != nil { - return *x.ExploitBestSolution - } - return Default_SatParameters_ExploitBestSolution -} - -func (x *SatParameters) GetExploitRelaxationSolution() bool { - if x != nil && x.ExploitRelaxationSolution != nil { - return *x.ExploitRelaxationSolution - } - return Default_SatParameters_ExploitRelaxationSolution -} - -func (x *SatParameters) GetExploitObjective() bool { - if x != nil && x.ExploitObjective != nil { - return *x.ExploitObjective - } - return Default_SatParameters_ExploitObjective -} - -func (x *SatParameters) GetDetectLinearizedProduct() bool { - if x != nil && x.DetectLinearizedProduct != nil { - return *x.DetectLinearizedProduct - } - return Default_SatParameters_DetectLinearizedProduct -} - -func (x *SatParameters) GetUseNewIntegerConflictResolution() bool { - if x != nil && x.UseNewIntegerConflictResolution != nil { - return *x.UseNewIntegerConflictResolution - } - return Default_SatParameters_UseNewIntegerConflictResolution -} - -func (x *SatParameters) GetCreate_1UipBooleanDuringIcr() bool { - if x != nil && x.Create_1UipBooleanDuringIcr != nil { - return *x.Create_1UipBooleanDuringIcr - } - return Default_SatParameters_Create_1UipBooleanDuringIcr -} - -func (x *SatParameters) GetMipMaxBound() float64 { - if x != nil && x.MipMaxBound != nil { - return *x.MipMaxBound - } - return Default_SatParameters_MipMaxBound -} - -func (x *SatParameters) GetMipVarScaling() float64 { - if x != nil && x.MipVarScaling != nil { - return *x.MipVarScaling - } - return Default_SatParameters_MipVarScaling -} - -func (x *SatParameters) GetMipScaleLargeDomain() bool { - if x != nil && x.MipScaleLargeDomain != nil { - return *x.MipScaleLargeDomain - } - return Default_SatParameters_MipScaleLargeDomain -} - -func (x *SatParameters) GetMipAutomaticallyScaleVariables() bool { - if x != nil && x.MipAutomaticallyScaleVariables != nil { - return *x.MipAutomaticallyScaleVariables - } - return Default_SatParameters_MipAutomaticallyScaleVariables -} - -func (x *SatParameters) GetOnlySolveIp() bool { - if x != nil && x.OnlySolveIp != nil { - return *x.OnlySolveIp - } - return Default_SatParameters_OnlySolveIp -} - -func (x *SatParameters) GetMipWantedPrecision() float64 { - if x != nil && x.MipWantedPrecision != nil { - return *x.MipWantedPrecision - } - return Default_SatParameters_MipWantedPrecision -} - -func (x *SatParameters) GetMipMaxActivityExponent() int32 { - if x != nil && x.MipMaxActivityExponent != nil { - return *x.MipMaxActivityExponent - } - return Default_SatParameters_MipMaxActivityExponent -} - -func (x *SatParameters) GetMipCheckPrecision() float64 { - if x != nil && x.MipCheckPrecision != nil { - return *x.MipCheckPrecision - } - return Default_SatParameters_MipCheckPrecision -} - -func (x *SatParameters) GetMipComputeTrueObjectiveBound() bool { - if x != nil && x.MipComputeTrueObjectiveBound != nil { - return *x.MipComputeTrueObjectiveBound - } - return Default_SatParameters_MipComputeTrueObjectiveBound -} - -func (x *SatParameters) GetMipMaxValidMagnitude() float64 { - if x != nil && x.MipMaxValidMagnitude != nil { - return *x.MipMaxValidMagnitude - } - return Default_SatParameters_MipMaxValidMagnitude -} - -func (x *SatParameters) GetMipTreatHighMagnitudeBoundsAsInfinity() bool { - if x != nil && x.MipTreatHighMagnitudeBoundsAsInfinity != nil { - return *x.MipTreatHighMagnitudeBoundsAsInfinity - } - return Default_SatParameters_MipTreatHighMagnitudeBoundsAsInfinity -} - -func (x *SatParameters) GetMipDropTolerance() float64 { - if x != nil && x.MipDropTolerance != nil { - return *x.MipDropTolerance - } - return Default_SatParameters_MipDropTolerance -} - -func (x *SatParameters) GetMipPresolveLevel() int32 { - if x != nil && x.MipPresolveLevel != nil { - return *x.MipPresolveLevel - } - return Default_SatParameters_MipPresolveLevel -} - -var File_ortools_sat_sat_parameters_proto protoreflect.FileDescriptor - -const file_ortools_sat_sat_parameters_proto_rawDesc = "" + - "\n" + - " ortools/sat/sat_parameters.proto\x12\x17operations_research.sat\"\xbd\xb0\x01\n" + - "\rSatParameters\x12\x15\n" + - "\x04name\x18\xab\x01 \x01(\t:\x00R\x04name\x12x\n" + - "\x18preferred_variable_order\x18\x01 \x01(\x0e24.operations_research.sat.SatParameters.VariableOrder:\bIN_ORDERR\x16preferredVariableOrder\x12j\n" + - "\x10initial_polarity\x18\x02 \x01(\x0e2/.operations_research.sat.SatParameters.Polarity:\x0ePOLARITY_FALSER\x0finitialPolarity\x12.\n" + - "\x10use_phase_saving\x18, \x01(\b:\x04trueR\x0eusePhaseSaving\x12C\n" + - "\x1apolarity_rephase_increment\x18\xa8\x01 \x01(\x05:\x041000R\x18polarityRephaseIncrement\x12A\n" + - "\x19polarity_exploit_ls_hints\x18\xb5\x02 \x01(\b:\x05falseR\x16polarityExploitLsHints\x125\n" + - "\x15random_polarity_ratio\x18- \x01(\x01:\x010R\x13randomPolarityRatio\x125\n" + - "\x15random_branches_ratio\x18 \x01(\x01:\x010R\x13randomBranchesRatio\x123\n" + - "\x12use_erwa_heuristic\x18K \x01(\b:\x05falseR\x10useErwaHeuristic\x12?\n" + - "\x1ainitial_variables_activity\x18L \x01(\x01:\x010R\x18initialVariablesActivity\x12Z\n" + - "'also_bump_variables_in_conflict_reasons\x18M \x01(\b:\x05falseR\"alsoBumpVariablesInConflictReasons\x12\x86\x01\n" + - "\x16minimization_algorithm\x18\x04 \x01(\x0e2D.operations_research.sat.SatParameters.ConflictMinimizationAlgorithm:\tRECURSIVER\x15minimizationAlgorithm\x12\xb0\x01\n" + - "\x1dbinary_minimization_algorithm\x18\" \x01(\x0e2@.operations_research.sat.SatParameters.BinaryMinizationAlgorithm:*BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONSR\x1bbinaryMinimizationAlgorithm\x12U\n" + - "$subsumption_during_conflict_analysis\x188 \x01(\b:\x04trueR!subsumptionDuringConflictAnalysis\x12a\n" + - "*extra_subsumption_during_conflict_analysis\x18\xdf\x02 \x01(\b:\x04trueR&extraSubsumptionDuringConflictAnalysis\x12g\n" + - "-decision_subsumption_during_conflict_analysis\x18\xe1\x02 \x01(\b:\x04trueR)decisionSubsumptionDuringConflictAnalysis\x12J\n" + - " eagerly_subsume_last_n_conflicts\x18\xd7\x02 \x01(\x05:\x014R\x1ceagerlySubsumeLastNConflicts\x12E\n" + - "\x1bsubsume_during_vivification\x18\xe3\x02 \x01(\b:\x04trueR\x19subsumeDuringVivification\x12L\n" + - "\x1euse_chronological_backtracking\x18\xca\x02 \x01(\b:\x05falseR\x1cuseChronologicalBacktracking\x123\n" + - "\x13max_backjump_levels\x18\xcb\x02 \x01(\x05:\x0250R\x11maxBackjumpLevels\x12X\n" + - "%chronological_backtrack_min_conflicts\x18\xcc\x02 \x01(\x05:\x041000R\"chronologicalBacktrackMinConflicts\x129\n" + - "\x15clause_cleanup_period\x18\v \x01(\x05:\x0510000R\x13clauseCleanupPeriod\x12I\n" + - "\x1fclause_cleanup_period_increment\x18\xd1\x02 \x01(\x05:\x010R\x1cclauseCleanupPeriodIncrement\x125\n" + - "\x15clause_cleanup_target\x18\r \x01(\x05:\x010R\x13clauseCleanupTarget\x126\n" + - "\x14clause_cleanup_ratio\x18\xbe\x01 \x01(\x01:\x030.5R\x12clauseCleanupRatio\x12:\n" + - "\x18clause_cleanup_lbd_bound\x18; \x01(\x05:\x015R\x15clauseCleanupLbdBound\x12;\n" + - "\x18clause_cleanup_lbd_tier1\x18\xdd\x02 \x01(\x05:\x010R\x15clauseCleanupLbdTier1\x12;\n" + - "\x18clause_cleanup_lbd_tier2\x18\xde\x02 \x01(\x05:\x010R\x15clauseCleanupLbdTier2\x12~\n" + - "\x17clause_cleanup_ordering\x18< \x01(\x0e25.operations_research.sat.SatParameters.ClauseOrdering:\x0fCLAUSE_ACTIVITYR\x15clauseCleanupOrdering\x125\n" + - "\x14pb_cleanup_increment\x18. \x01(\x05:\x03200R\x12pbCleanupIncrement\x12-\n" + - "\x10pb_cleanup_ratio\x18/ \x01(\x01:\x030.5R\x0epbCleanupRatio\x12;\n" + - "\x17variable_activity_decay\x18\x0f \x01(\x01:\x030.8R\x15variableActivityDecay\x12E\n" + - "\x1bmax_variable_activity_value\x18\x10 \x01(\x01:\x061e+100R\x18maxVariableActivityValue\x120\n" + - "\x11glucose_max_decay\x18\x16 \x01(\x01:\x040.95R\x0fglucoseMaxDecay\x12<\n" + - "\x17glucose_decay_increment\x18\x17 \x01(\x01:\x040.01R\x15glucoseDecayIncrement\x12I\n" + - "\x1eglucose_decay_increment_period\x18\x18 \x01(\x05:\x045000R\x1bglucoseDecayIncrementPeriod\x129\n" + - "\x15clause_activity_decay\x18\x11 \x01(\x01:\x050.999R\x13clauseActivityDecay\x12@\n" + - "\x19max_clause_activity_value\x18\x12 \x01(\x01:\x051e+20R\x16maxClauseActivityValue\x12f\n" + - "\x12restart_algorithms\x18= \x03(\x0e27.operations_research.sat.SatParameters.RestartAlgorithmR\x11restartAlgorithms\x12\x7f\n" + - "\x1adefault_restart_algorithms\x18F \x01(\t:ALUBY_RESTART,LBD_MOVING_AVERAGE_RESTART,DL_MOVING_AVERAGE_RESTARTR\x18defaultRestartAlgorithms\x12)\n" + - "\x0erestart_period\x18\x1e \x01(\x05:\x0250R\rrestartPeriod\x12A\n" + - "\x1brestart_running_window_size\x18> \x01(\x05:\x0250R\x18restartRunningWindowSize\x12:\n" + - "\x18restart_dl_average_ratio\x18? \x01(\x01:\x011R\x15restartDlAverageRatio\x12<\n" + - "\x19restart_lbd_average_ratio\x18G \x01(\x01:\x011R\x16restartLbdAverageRatio\x127\n" + - "\x14use_blocking_restart\x18@ \x01(\b:\x05falseR\x12useBlockingRestart\x12E\n" + - "\x1cblocking_restart_window_size\x18A \x01(\x05:\x045000R\x19blockingRestartWindowSize\x12C\n" + - "\x1bblocking_restart_multiplier\x18B \x01(\x01:\x031.4R\x19blockingRestartMultiplier\x12S\n" + - "%num_conflicts_before_strategy_changes\x18D \x01(\x05:\x010R!numConflictsBeforeStrategyChanges\x12F\n" + - "\x1estrategy_change_increase_ratio\x18E \x01(\x01:\x010R\x1bstrategyChangeIncreaseRatio\x122\n" + - "\x13max_time_in_seconds\x18$ \x01(\x01:\x03infR\x10maxTimeInSeconds\x129\n" + - "\x16max_deterministic_time\x18C \x01(\x01:\x03infR\x14maxDeterministicTime\x12E\n" + - "\x1dmax_num_deterministic_batches\x18\xa3\x02 \x01(\x05:\x010R\x1amaxNumDeterministicBatches\x12J\n" + - "\x17max_number_of_conflicts\x18% \x01(\x03:\x139223372036854775807R\x14maxNumberOfConflicts\x12.\n" + - "\x10max_memory_in_mb\x18( \x01(\x03:\x0510000R\rmaxMemoryInMb\x125\n" + - "\x12absolute_gap_limit\x18\x9f\x01 \x01(\x01:\x060.0001R\x10absoluteGapLimit\x120\n" + - "\x12relative_gap_limit\x18\xa0\x01 \x01(\x01:\x010R\x10relativeGapLimit\x12\"\n" + - "\vrandom_seed\x18\x1f \x01(\x05:\x011R\n" + - "randomSeed\x12B\n" + - "\x19permute_variable_randomly\x18\xb2\x01 \x01(\b:\x05falseR\x17permuteVariableRandomly\x12Q\n" + - "!permute_presolve_constraint_order\x18\xb3\x01 \x01(\b:\x05falseR\x1epermutePresolveConstraintOrder\x12.\n" + - "\x0fuse_absl_random\x18\xb4\x01 \x01(\b:\x05falseR\ruseAbslRandom\x125\n" + - "\x13log_search_progress\x18) \x01(\b:\x05falseR\x11logSearchProgress\x12@\n" + - "\x18log_subsolver_statistics\x18\xbd\x01 \x01(\b:\x05falseR\x16logSubsolverStatistics\x12 \n" + - "\n" + - "log_prefix\x18\xb9\x01 \x01(\t:\x00R\tlogPrefix\x12)\n" + - "\rlog_to_stdout\x18\xba\x01 \x01(\b:\x04trueR\vlogToStdout\x12.\n" + - "\x0flog_to_response\x18\xbb\x01 \x01(\b:\x05falseR\rlogToResponse\x121\n" + - "\x11use_pb_resolution\x18+ \x01(\b:\x05falseR\x0fusePbResolution\x12[\n" + - "'minimize_reduction_during_pb_resolution\x180 \x01(\b:\x05falseR#minimizeReductionDuringPbResolution\x12H\n" + - "\x1ecount_assumption_levels_in_lbd\x181 \x01(\b:\x04trueR\x1acountAssumptionLevelsInLbd\x129\n" + - "\x16presolve_bve_threshold\x186 \x01(\x05:\x03500R\x14presolveBveThreshold\x12G\n" + - "\x1cfilter_sat_postsolve_clauses\x18\xc4\x02 \x01(\b:\x05falseR\x19filterSatPostsolveClauses\x12>\n" + - "\x1apresolve_bve_clause_weight\x187 \x01(\x05:\x013R\x17presolveBveClauseWeight\x12K\n" + - " probing_deterministic_time_limit\x18\xe2\x01 \x01(\x01:\x011R\x1dprobingDeterministicTimeLimit\x12\\\n" + - ")presolve_probing_deterministic_time_limit\x189 \x01(\x01:\x0230R%presolveProbingDeterministicTimeLimit\x12<\n" + - "\x17presolve_blocked_clause\x18X \x01(\b:\x04trueR\x15presolveBlockedClause\x12.\n" + - "\x10presolve_use_bva\x18H \x01(\b:\x04trueR\x0epresolveUseBva\x127\n" + - "\x16presolve_bva_threshold\x18I \x01(\x05:\x011R\x14presolveBvaThreshold\x12:\n" + - "\x17max_presolve_iterations\x18\x8a\x01 \x01(\x05:\x013R\x15maxPresolveIterations\x120\n" + - "\x11cp_model_presolve\x18V \x01(\b:\x04trueR\x0fcpModelPresolve\x126\n" + - "\x16cp_model_probing_level\x18n \x01(\x05:\x012R\x13cpModelProbingLevel\x12>\n" + - "\x19cp_model_use_sat_presolve\x18] \x01(\b:\x04trueR\x15cpModelUseSatPresolve\x12N\n" + - "!load_at_most_ones_in_sat_presolve\x18\xcf\x02 \x01(\b:\x05falseR\x1bloadAtMostOnesInSatPresolve\x12F\n" + - "\x1cremove_fixed_variables_early\x18\xb6\x02 \x01(\b:\x04trueR\x19removeFixedVariablesEarly\x12;\n" + - "\x16detect_table_with_cost\x18\xd8\x01 \x01(\b:\x05falseR\x13detectTableWithCost\x12:\n" + - "\x17table_compression_level\x18\xd9\x01 \x01(\x05:\x012R\x15tableCompressionLevel\x12D\n" + - "\x1aexpand_alldiff_constraints\x18\xaa\x01 \x01(\b:\x05falseR\x18expandAlldiffConstraints\x12;\n" + - "\x17max_alldiff_domain_size\x18\xc0\x02 \x01(\x05:\x03256R\x14maxAlldiffDomainSize\x12G\n" + - "\x1cexpand_reservoir_constraints\x18\xb6\x01 \x01(\b:\x04trueR\x1aexpandReservoirConstraints\x12S\n" + - "%max_domain_size_for_linear2_expansion\x18\xd4\x02 \x01(\x05:\x018R maxDomainSizeForLinear2Expansion\x12K\n" + - "\x1eexpand_reservoir_using_circuit\x18\xa0\x02 \x01(\b:\x05falseR\x1bexpandReservoirUsingCircuit\x12K\n" + - "\x1eencode_cumulative_as_reservoir\x18\x9f\x02 \x01(\b:\x05falseR\x1bencodeCumulativeAsReservoir\x12E\n" + - "\x1emax_lin_max_size_for_expansion\x18\x98\x02 \x01(\x05:\x010R\x19maxLinMaxSizeForExpansion\x12H\n" + - "\x1cdisable_constraint_expansion\x18\xb5\x01 \x01(\b:\x05falseR\x1adisableConstraintExpansion\x12g\n" + - "-encode_complex_linear_constraint_with_integer\x18\xdf\x01 \x01(\b:\x05falseR(encodeComplexLinearConstraintWithInteger\x12L\n" + - "\x1bmerge_no_overlap_work_limit\x18\x91\x01 \x01(\x01:\r1000000000000R\x17mergeNoOverlapWorkLimit\x12I\n" + - "\x1cmerge_at_most_one_work_limit\x18\x92\x01 \x01(\x01:\t100000000R\x17mergeAtMostOneWorkLimit\x12B\n" + - "\x1bpresolve_substitution_level\x18\x93\x01 \x01(\x05:\x011R\x19presolveSubstitutionLevel\x12W\n" + - "$presolve_extract_integer_enforcement\x18\xae\x01 \x01(\b:\x05falseR!presolveExtractIntegerEnforcement\x12M\n" + - "\x1dpresolve_inclusion_work_limit\x18\xc9\x01 \x01(\x03:\t100000000R\x1apresolveInclusionWorkLimit\x12(\n" + - "\fignore_names\x18\xca\x01 \x01(\b:\x04trueR\vignoreNames\x12-\n" + - "\x0finfer_all_diffs\x18\xe9\x01 \x01(\b:\x04trueR\rinferAllDiffs\x12<\n" + - "\x17find_big_linear_overlap\x18\xea\x01 \x01(\b:\x04trueR\x14findBigLinearOverlap\x12N\n" + - "!find_clauses_that_are_exactly_one\x18\xcd\x02 \x01(\b:\x04trueR\x1cfindClausesThatAreExactlyOne\x127\n" + - "\x14use_sat_inprocessing\x18\xa3\x01 \x01(\b:\x04trueR\x12useSatInprocessing\x12>\n" + - "\x18inprocessing_dtime_ratio\x18\x91\x02 \x01(\x01:\x030.2R\x16inprocessingDtimeRatio\x12@\n" + - "\x1ainprocessing_probing_dtime\x18\x92\x02 \x01(\x01:\x011R\x18inprocessingProbingDtime\x12J\n" + - "\x1finprocessing_minimization_dtime\x18\x93\x02 \x01(\x01:\x011R\x1dinprocessingMinimizationDtime\x12k\n" + - "/inprocessing_minimization_use_conflict_analysis\x18\xa9\x02 \x01(\b:\x04trueR+inprocessingMinimizationUseConflictAnalysis\x12d\n" + - "+inprocessing_minimization_use_all_orderings\x18\xaa\x02 \x01(\b:\x05falseR'inprocessingMinimizationUseAllOrderings\x12T\n" + - "#inprocessing_use_congruence_closure\x18\xd6\x02 \x01(\b:\x04trueR inprocessingUseCongruenceClosure\x12I\n" + - "\x1dinprocessing_use_sat_sweeping\x18\xe2\x02 \x01(\b:\x05falseR\x1ainprocessingUseSatSweeping\x12#\n" + - "\vnum_workers\x18\xce\x01 \x01(\x05:\x010R\n" + - "numWorkers\x12/\n" + - "\x12num_search_workers\x18d \x01(\x05:\x010R\x10numSearchWorkers\x122\n" + - "\x13num_full_subsolvers\x18\xa6\x02 \x01(\x05:\x010R\x11numFullSubsolvers\x12\x1f\n" + - "\n" + - "subsolvers\x18\xcf\x01 \x03(\tR\n" + - "subsolvers\x12*\n" + - "\x10extra_subsolvers\x18\xdb\x01 \x03(\tR\x0fextraSubsolvers\x12,\n" + - "\x11ignore_subsolvers\x18\xd1\x01 \x03(\tR\x10ignoreSubsolvers\x12,\n" + - "\x11filter_subsolvers\x18\xa5\x02 \x03(\tR\x10filterSubsolvers\x12R\n" + - "\x10subsolver_params\x18\xd2\x01 \x03(\v2&.operations_research.sat.SatParametersR\x0fsubsolverParams\x123\n" + - "\x11interleave_search\x18\x88\x01 \x01(\b:\x05falseR\x10interleaveSearch\x126\n" + - "\x15interleave_batch_size\x18\x86\x01 \x01(\x05:\x010R\x13interleaveBatchSize\x12:\n" + - "\x16share_objective_bounds\x18q \x01(\b:\x04trueR\x14shareObjectiveBounds\x12;\n" + - "\x17share_level_zero_bounds\x18r \x01(\b:\x04trueR\x14shareLevelZeroBounds\x128\n" + - "\x14share_linear2_bounds\x18\xc6\x02 \x01(\b:\x05falseR\x12shareLinear2Bounds\x127\n" + - "\x14share_binary_clauses\x18\xcb\x01 \x01(\b:\x04trueR\x12shareBinaryClauses\x123\n" + - "\x12share_glue_clauses\x18\x9d\x02 \x01(\b:\x04trueR\x10shareGlueClauses\x12=\n" + - "\x17minimize_shared_clauses\x18\xac\x02 \x01(\b:\x04trueR\x15minimizeSharedClauses\x12;\n" + - "\x18share_glue_clauses_dtime\x18\xc2\x02 \x01(\x01:\x011R\x15shareGlueClausesDtime\x120\n" + - "\x10check_lrat_proof\x18\xd8\x02 \x01(\b:\x05falseR\x0echeckLratProof\x12=\n" + - "\x17check_merged_lrat_proof\x18\xe0\x02 \x01(\b:\x05falseR\x14checkMergedLratProof\x122\n" + - "\x11output_lrat_proof\x18\xd9\x02 \x01(\b:\x05falseR\x0foutputLratProof\x120\n" + - "\x10check_drat_proof\x18\xda\x02 \x01(\b:\x05falseR\x0echeckDratProof\x122\n" + - "\x11output_drat_proof\x18\xdb\x02 \x01(\b:\x05falseR\x0foutputDratProof\x12<\n" + - "\x18max_drat_time_in_seconds\x18\xdc\x02 \x01(\x01:\x03infR\x14maxDratTimeInSeconds\x12N\n" + - " debug_postsolve_with_full_solver\x18\xa2\x01 \x01(\b:\x05falseR\x1cdebugPostsolveWithFullSolver\x12L\n" + - "!debug_max_num_presolve_operations\x18\x97\x01 \x01(\x05:\x010R\x1ddebugMaxNumPresolveOperations\x12<\n" + - "\x17debug_crash_on_bad_hint\x18\xc3\x01 \x01(\b:\x05falseR\x13debugCrashOnBadHint\x12S\n" + - "#debug_crash_if_presolve_breaks_hint\x18\xb2\x02 \x01(\b:\x05falseR\x1edebugCrashIfPresolveBreaksHint\x12K\n" + - "\x1fdebug_crash_if_lrat_check_fails\x18\xd3\x02 \x01(\b:\x05falseR\x1adebugCrashIfLratCheckFails\x12:\n" + - "\x16use_optimization_hints\x18# \x01(\b:\x04trueR\x14useOptimizationHints\x129\n" + - "\x17core_minimization_level\x182 \x01(\x05:\x012R\x15coreMinimizationLevel\x124\n" + - "\x13find_multiple_cores\x18T \x01(\b:\x04trueR\x11findMultipleCores\x123\n" + - "\x12cover_optimization\x18Y \x01(\b:\x04trueR\x11coverOptimization\x12\x8f\x01\n" + - "\x18max_sat_assumption_order\x183 \x01(\x0e2<.operations_research.sat.SatParameters.MaxSatAssumptionOrder:\x18DEFAULT_ASSUMPTION_ORDERR\x15maxSatAssumptionOrder\x12M\n" + - " max_sat_reverse_assumption_order\x184 \x01(\b:\x05falseR\x1cmaxSatReverseAssumptionOrder\x12\x92\x01\n" + - "\x16max_sat_stratification\x185 \x01(\x0e2D.operations_research.sat.SatParameters.MaxSatStratificationAlgorithm:\x16STRATIFICATION_DESCENTR\x14maxSatStratification\x12N\n" + - "!propagation_loop_detection_factor\x18\xdd\x01 \x01(\x01:\x0210R\x1epropagationLoopDetectionFactor\x12^\n" + - ")use_precedences_in_disjunctive_constraint\x18J \x01(\b:\x04trueR%usePrecedencesInDisjunctiveConstraint\x12S\n" + - "!transitive_precedences_work_limit\x18\xc7\x02 \x01(\x05:\a1000000R\x1etransitivePrecedencesWorkLimit\x12r\n" + - "5max_size_to_create_precedence_literals_in_disjunctive\x18\xe5\x01 \x01(\x05:\x0260R.maxSizeToCreatePrecedenceLiteralsInDisjunctive\x12X\n" + - "%use_strong_propagation_in_disjunctive\x18\xe6\x01 \x01(\b:\x05falseR!useStrongPropagationInDisjunctive\x12X\n" + - "%use_dynamic_precedence_in_disjunctive\x18\x87\x02 \x01(\b:\x05falseR!useDynamicPrecedenceInDisjunctive\x12V\n" + - "$use_dynamic_precedence_in_cumulative\x18\x8c\x02 \x01(\b:\x05falseR useDynamicPrecedenceInCumulative\x12Q\n" + - "\"use_overload_checker_in_cumulative\x18N \x01(\b:\x05falseR\x1euseOverloadCheckerInCumulative\x12\\\n" + - "'use_conservative_scale_overload_checker\x18\x9e\x02 \x01(\b:\x05falseR#useConservativeScaleOverloadChecker\x12\\\n" + - "(use_timetable_edge_finding_in_cumulative\x18O \x01(\b:\x05falseR#useTimetableEdgeFindingInCumulative\x12b\n" + - ",max_num_intervals_for_timetable_edge_finding\x18\x84\x02 \x01(\x05:\x03100R&maxNumIntervalsForTimetableEdgeFinding\x12R\n" + - "\"use_hard_precedences_in_cumulative\x18\xd7\x01 \x01(\b:\x05falseR\x1euseHardPrecedencesInCumulative\x12>\n" + - "\x17exploit_all_precedences\x18\xdc\x01 \x01(\b:\x05falseR\x15exploitAllPrecedences\x12\\\n" + - "(use_disjunctive_constraint_in_cumulative\x18P \x01(\b:\x04trueR$useDisjunctiveConstraintInCumulative\x12T\n" + - "%no_overlap_2d_boolean_relations_limit\x18\xc1\x02 \x01(\x05:\x0210R noOverlap2dBooleanRelationsLimit\x12M\n" + - " use_timetabling_in_no_overlap_2d\x18\xc8\x01 \x01(\b:\x05falseR\x1buseTimetablingInNoOverlap2d\x12\\\n" + - "(use_energetic_reasoning_in_no_overlap_2d\x18\xd5\x01 \x01(\b:\x05falseR\"useEnergeticReasoningInNoOverlap2d\x12e\n" + - "-use_area_energetic_reasoning_in_no_overlap_2d\x18\x8f\x02 \x01(\b:\x05falseR&useAreaEnergeticReasoningInNoOverlap2d\x12Y\n" + - "'use_try_edge_reasoning_in_no_overlap_2d\x18\xab\x02 \x01(\b:\x05falseR useTryEdgeReasoningInNoOverlap2d\x12d\n" + - "-max_pairs_pairwise_reasoning_in_no_overlap_2d\x18\x94\x02 \x01(\x05:\x041250R&maxPairsPairwiseReasoningInNoOverlap2d\x12r\n" + - "6maximum_regions_to_split_in_disconnected_no_overlap_2d\x18\xbb\x02 \x01(\x05:\x010R.maximumRegionsToSplitInDisconnectedNoOverlap2d\x12]\n" + - ")use_linear3_for_no_overlap_2d_precedences\x18\xc3\x02 \x01(\b:\x04trueR#useLinear3ForNoOverlap2dPrecedences\x12J\n" + - "\x1euse_dual_scheduling_heuristics\x18\xd6\x01 \x01(\b:\x04trueR\x1buseDualSchedulingHeuristics\x12H\n" + - "\x1duse_all_different_for_circuit\x18\xb7\x02 \x01(\b:\x05falseR\x19useAllDifferentForCircuit\x12i\n" + - "1routing_cut_subset_size_for_binary_relation_bound\x18\xb8\x02 \x01(\x05:\x010R*routingCutSubsetSizeForBinaryRelationBound\x12t\n" + - "7routing_cut_subset_size_for_tight_binary_relation_bound\x18\xb9\x02 \x01(\x05:\x010R/routingCutSubsetSizeForTightBinaryRelationBound\x12t\n" + - "7routing_cut_subset_size_for_exact_binary_relation_bound\x18\xbc\x02 \x01(\x05:\x018R/routingCutSubsetSizeForExactBinaryRelationBound\x12g\n" + - "0routing_cut_subset_size_for_shortest_paths_bound\x18\xbe\x02 \x01(\x05:\x018R)routingCutSubsetSizeForShortestPathsBound\x12<\n" + - "\x15routing_cut_dp_effort\x18\xba\x02 \x01(\x01:\b10000000R\x12routingCutDpEffort\x12U\n" + - "&routing_cut_max_infeasible_path_length\x18\xbd\x02 \x01(\x05:\x016R!routingCutMaxInfeasiblePathLength\x12s\n" + - "\x10search_branching\x18R \x01(\x0e26.operations_research.sat.SatParameters.SearchBranching:\x10AUTOMATIC_SEARCHR\x0fsearchBranching\x123\n" + - "\x13hint_conflict_limit\x18\x99\x01 \x01(\x05:\x0210R\x11hintConflictLimit\x12'\n" + - "\vrepair_hint\x18\xa7\x01 \x01(\b:\x05falseR\n" + - "repairHint\x12S\n" + - "#fix_variables_to_their_hinted_value\x18\xc0\x01 \x01(\b:\x05falseR\x1efixVariablesToTheirHintedValue\x124\n" + - "\x12use_probing_search\x18\xb0\x01 \x01(\b:\x05falseR\x10useProbingSearch\x127\n" + - "\x14use_extended_probing\x18\x8d\x02 \x01(\b:\x04trueR\x12useExtendedProbing\x12K\n" + - "\x1eprobing_num_combinations_limit\x18\x90\x02 \x01(\x05:\x0520000R\x1bprobingNumCombinationsLimit\x12e\n" + - ",shaving_deterministic_time_in_probing_search\x18\xcc\x01 \x01(\x01:\x050.001R'shavingDeterministicTimeInProbingSearch\x12O\n" + - "!shaving_search_deterministic_time\x18\xcd\x01 \x01(\x01:\x030.1R\x1eshavingSearchDeterministicTime\x12=\n" + - "\x18shaving_search_threshold\x18\xa2\x02 \x01(\x03:\x0264R\x16shavingSearchThreshold\x12=\n" + - "\x17use_objective_lb_search\x18\xe4\x01 \x01(\b:\x05falseR\x14useObjectiveLbSearch\x12G\n" + - "\x1cuse_objective_shaving_search\x18\xfd\x01 \x01(\b:\x05falseR\x19useObjectiveShavingSearch\x12;\n" + - "\x17variables_shaving_level\x18\xa1\x02 \x01(\x05:\x02-1R\x15variablesShavingLevel\x12N\n" + - "!pseudo_cost_reliability_threshold\x18{ \x01(\x03:\x03100R\x1epseudoCostReliabilityThreshold\x123\n" + - "\x12optimize_with_core\x18S \x01(\b:\x05falseR\x10optimizeWithCore\x12F\n" + - "\x1coptimize_with_lb_tree_search\x18\xbc\x01 \x01(\b:\x05falseR\x18optimizeWithLbTreeSearch\x12J\n" + - "\x1fsave_lp_basis_in_lb_tree_search\x18\x9c\x02 \x01(\b:\x05falseR\x19saveLpBasisInLbTreeSearch\x12A\n" + - "\x1bbinary_search_num_conflicts\x18c \x01(\x05:\x02-1R\x18binarySearchNumConflicts\x126\n" + - "\x14optimize_with_max_hs\x18U \x01(\b:\x05falseR\x11optimizeWithMaxHs\x127\n" + - "\x14use_feasibility_jump\x18\x89\x02 \x01(\b:\x04trueR\x12useFeasibilityJump\x12&\n" + - "\vuse_ls_only\x18\xf0\x01 \x01(\b:\x05falseR\tuseLsOnly\x12;\n" + - "\x16feasibility_jump_decay\x18\xf2\x01 \x01(\x01:\x040.95R\x14feasibilityJumpDecay\x12S\n" + - "$feasibility_jump_linearization_level\x18\x81\x02 \x01(\x05:\x012R!feasibilityJumpLinearizationLevel\x12I\n" + - "\x1ffeasibility_jump_restart_factor\x18\x82\x02 \x01(\x05:\x011R\x1cfeasibilityJumpRestartFactor\x12E\n" + - "\x1cfeasibility_jump_batch_dtime\x18\xa4\x02 \x01(\x01:\x030.1R\x19feasibilityJumpBatchDtime\x12i\n" + - ".feasibility_jump_var_randomization_probability\x18\xf7\x01 \x01(\x01:\x040.05R*feasibilityJumpVarRandomizationProbability\x12e\n" + - "-feasibility_jump_var_perburbation_range_ratio\x18\xf8\x01 \x01(\x01:\x030.2R(feasibilityJumpVarPerburbationRangeRatio\x12N\n" + - " feasibility_jump_enable_restarts\x18\xfa\x01 \x01(\b:\x04trueR\x1dfeasibilityJumpEnableRestarts\x12e\n" + - "-feasibility_jump_max_expanded_constraint_size\x18\x88\x02 \x01(\x05:\x03500R(feasibilityJumpMaxExpandedConstraintSize\x12,\n" + - "\x10num_violation_ls\x18\xf4\x01 \x01(\x05:\x010R\x0enumViolationLs\x12M\n" + - " violation_ls_perturbation_period\x18\xf9\x01 \x01(\x05:\x03100R\x1dviolationLsPerturbationPeriod\x12X\n" + - "&violation_ls_compound_move_probability\x18\x83\x02 \x01(\x01:\x030.5R\"violationLsCompoundMoveProbability\x12:\n" + - "\x17shared_tree_num_workers\x18\xeb\x01 \x01(\x05:\x02-1R\x14sharedTreeNumWorkers\x12;\n" + - "\x16use_shared_tree_search\x18\xec\x01 \x01(\b:\x05falseR\x13useSharedTreeSearch\x12^\n" + - "+shared_tree_worker_min_restarts_per_subtree\x18\x9a\x02 \x01(\x05:\x011R%sharedTreeWorkerMinRestartsPerSubtree\x12Z\n" + - "'shared_tree_worker_enable_trail_sharing\x18\xa7\x02 \x01(\b:\x04trueR\"sharedTreeWorkerEnableTrailSharing\x12Z\n" + - "'shared_tree_worker_enable_phase_sharing\x18\xb0\x02 \x01(\b:\x04trueR\"sharedTreeWorkerEnablePhaseSharing\x12M\n" + - "\"shared_tree_open_leaves_per_worker\x18\x99\x02 \x01(\x01:\x012R\x1dsharedTreeOpenLeavesPerWorker\x12M\n" + - " shared_tree_max_nodes_per_worker\x18\xee\x01 \x01(\x05:\x0510000R\x1bsharedTreeMaxNodesPerWorker\x12\x91\x01\n" + - "\x1ashared_tree_split_strategy\x18\xef\x01 \x01(\x0e2>.operations_research.sat.SatParameters.SharedTreeSplitStrategy:\x13SPLIT_STRATEGY_AUTOR\x17sharedTreeSplitStrategy\x12E\n" + - "\x1dshared_tree_balance_tolerance\x18\xb1\x02 \x01(\x05:\x011R\x1asharedTreeBalanceTolerance\x12B\n" + - "\x1bshared_tree_split_min_dtime\x18\xc8\x02 \x01(\x01:\x030.1R\x17sharedTreeSplitMinDtime\x12=\n" + - "\x17enumerate_all_solutions\x18W \x01(\b:\x05falseR\x15enumerateAllSolutions\x12[\n" + - "'keep_all_feasible_solutions_in_presolve\x18\xad\x01 \x01(\b:\x05falseR\"keepAllFeasibleSolutionsInPresolve\x12R\n" + - "\"fill_tightened_domains_in_response\x18\x84\x01 \x01(\b:\x05falseR\x1efillTightenedDomainsInResponse\x12X\n" + - "%fill_additional_solutions_in_response\x18\xc2\x01 \x01(\b:\x05falseR!fillAdditionalSolutionsInResponse\x12@\n" + - "\x19instantiate_all_variables\x18j \x01(\b:\x04trueR\x17instantiateAllVariables\x12Y\n" + - "(auto_detect_greater_than_at_least_one_of\x18_ \x01(\b:\x04trueR!autoDetectGreaterThanAtLeastOneOf\x12@\n" + - "\x19stop_after_first_solution\x18b \x01(\b:\x05falseR\x16stopAfterFirstSolution\x126\n" + - "\x13stop_after_presolve\x18\x95\x01 \x01(\b:\x05falseR\x11stopAfterPresolve\x12E\n" + - "\x1bstop_after_root_propagation\x18\xfc\x01 \x01(\b:\x05falseR\x18stopAfterRootPropagation\x12:\n" + - "\x16lns_initial_difficulty\x18\xb3\x02 \x01(\x01:\x030.5R\x14lnsInitialDifficulty\x12K\n" + - "\x1flns_initial_deterministic_limit\x18\xb4\x02 \x01(\x01:\x030.1R\x1clnsInitialDeterministicLimit\x12\x1e\n" + - "\ause_lns\x18\x9b\x02 \x01(\b:\x04trueR\x06useLns\x12'\n" + - "\fuse_lns_only\x18e \x01(\b:\x05falseR\n" + - "useLnsOnly\x120\n" + - "\x12solution_pool_size\x18\xc1\x01 \x01(\x05:\x013R\x10solutionPoolSize\x12F\n" + - "\x1dsolution_pool_diversity_limit\x18\xc9\x02 \x01(\x05:\x0210R\x1asolutionPoolDiversityLimit\x126\n" + - "\x15alternative_pool_size\x18\xc5\x02 \x01(\x05:\x011R\x13alternativePoolSize\x12'\n" + - "\fuse_rins_lns\x18\x81\x01 \x01(\b:\x04trueR\n" + - "useRinsLns\x127\n" + - "\x14use_feasibility_pump\x18\xa4\x01 \x01(\b:\x04trueR\x12useFeasibilityPump\x12.\n" + - "\x10use_lb_relax_lns\x18\xff\x01 \x01(\b:\x04trueR\ruseLbRelaxLns\x12G\n" + - "\x1elb_relax_num_workers_threshold\x18\xa8\x02 \x01(\x05:\x0216R\x1albRelaxNumWorkersThreshold\x12o\n" + - "\vfp_rounding\x18\xa5\x01 \x01(\x0e27.operations_research.sat.SatParameters.FPRoundingMethod:\x14PROPAGATION_ASSISTEDR\n" + - "fpRounding\x128\n" + - "\x14diversify_lns_params\x18\x89\x01 \x01(\b:\x05falseR\x12diversifyLnsParams\x120\n" + - "\x10randomize_search\x18g \x01(\b:\x05falseR\x0frandomizeSearch\x12I\n" + - " search_random_variable_pool_size\x18h \x01(\x03:\x010R\x1csearchRandomVariablePoolSize\x12D\n" + - "\x1bpush_all_tasks_toward_start\x18\x86\x02 \x01(\b:\x05falseR\x17pushAllTasksTowardStart\x12;\n" + - "\x16use_optional_variables\x18l \x01(\b:\x05falseR\x14useOptionalVariables\x123\n" + - "\x13use_exact_lp_reason\x18m \x01(\b:\x04trueR\x10useExactLpReason\x12=\n" + - "\x17use_combined_no_overlap\x18\x85\x01 \x01(\b:\x05falseR\x14useCombinedNoOverlap\x12E\n" + - "\x1eat_most_one_max_expansion_size\x18\x8e\x02 \x01(\x05:\x013R\x19atMostOneMaxExpansionSize\x125\n" + - "\x13catch_sigint_signal\x18\x87\x01 \x01(\b:\x04trueR\x11catchSigintSignal\x123\n" + - "\x12use_implied_bounds\x18\x90\x01 \x01(\b:\x04trueR\x10useImpliedBounds\x124\n" + - "\x12polish_lp_solution\x18\xaf\x01 \x01(\b:\x05falseR\x10polishLpSolution\x126\n" + - "\x13lp_primal_tolerance\x18\x8a\x02 \x01(\x01:\x051e-07R\x11lpPrimalTolerance\x122\n" + - "\x11lp_dual_tolerance\x18\x8b\x02 \x01(\x01:\x051e-07R\x0flpDualTolerance\x122\n" + - "\x11convert_intervals\x18\xb1\x01 \x01(\b:\x04trueR\x10convertIntervals\x12)\n" + - "\x0esymmetry_level\x18\xb7\x01 \x01(\x05:\x012R\rsymmetryLevel\x123\n" + - "\x12use_symmetry_in_lp\x18\xad\x02 \x01(\b:\x05falseR\x0fuseSymmetryInLp\x12A\n" + - "\x19keep_symmetry_in_presolve\x18\xaf\x02 \x01(\b:\x05falseR\x16keepSymmetryInPresolve\x12`\n" + - "+symmetry_detection_deterministic_time_limit\x18\xae\x02 \x01(\x01:\x011R'symmetryDetectionDeterministicTimeLimit\x12;\n" + - "\x16new_linear_propagation\x18\xe0\x01 \x01(\b:\x04trueR\x14newLinearPropagation\x120\n" + - "\x11linear_split_size\x18\x80\x02 \x01(\x05:\x03100R\x0flinearSplitSize\x122\n" + - "\x13linearization_level\x18Z \x01(\x05:\x011R\x12linearizationLevel\x127\n" + - "\x16boolean_encoding_level\x18k \x01(\x05:\x011R\x14booleanEncodingLevel\x12h\n" + - "0max_domain_size_when_encoding_eq_neq_constraints\x18\xbf\x01 \x01(\x05:\x0216R)maxDomainSizeWhenEncodingEqNeqConstraints\x12'\n" + - "\fmax_num_cuts\x18[ \x01(\x05:\x0510000R\n" + - "maxNumCuts\x12\x1f\n" + - "\tcut_level\x18\xc4\x01 \x01(\x05:\x011R\bcutLevel\x12B\n" + - "\x1bonly_add_cuts_at_level_zero\x18\\ \x01(\b:\x05falseR\x16onlyAddCutsAtLevelZero\x122\n" + - "\x11add_objective_cut\x18\xc5\x01 \x01(\b:\x05falseR\x0faddObjectiveCut\x12$\n" + - "\vadd_cg_cuts\x18u \x01(\b:\x04trueR\taddCgCuts\x12&\n" + - "\fadd_mir_cuts\x18x \x01(\b:\x04trueR\n" + - "addMirCuts\x122\n" + - "\x12add_zero_half_cuts\x18\xa9\x01 \x01(\b:\x04trueR\x0faddZeroHalfCuts\x12-\n" + - "\x0fadd_clique_cuts\x18\xac\x01 \x01(\b:\x04trueR\raddCliqueCuts\x12'\n" + - "\fadd_rlt_cuts\x18\x97\x02 \x01(\b:\x04trueR\n" + - "addRltCuts\x125\n" + - "\x15max_all_diff_cut_size\x18\x94\x01 \x01(\x05:\x0264R\x11maxAllDiffCutSize\x12.\n" + - "\x10add_lin_max_cuts\x18\x98\x01 \x01(\b:\x04trueR\raddLinMaxCuts\x12D\n" + - "\x1cmax_integer_rounding_scaling\x18w \x01(\x05:\x03600R\x19maxIntegerRoundingScaling\x12?\n" + - "\x19add_lp_constraints_lazily\x18p \x01(\b:\x04trueR\x16addLpConstraintsLazily\x123\n" + - "\x12root_lp_iterations\x18\xe3\x01 \x01(\x05:\x042000R\x10rootLpIterations\x12T\n" + - "$min_orthogonality_for_lp_constraints\x18s \x01(\x01:\x040.05R minOrthogonalityForLpConstraints\x12A\n" + - "\x1cmax_cut_rounds_at_level_zero\x18\x9a\x01 \x01(\x05:\x011R\x17maxCutRoundsAtLevelZero\x12H\n" + - "\x1emax_consecutive_inactive_count\x18y \x01(\x05:\x03100R\x1bmaxConsecutiveInactiveCount\x12H\n" + - "\x1acut_max_active_count_value\x18\x9b\x01 \x01(\x01:\v10000000000R\x16cutMaxActiveCountValue\x129\n" + - "\x16cut_active_count_decay\x18\x9c\x01 \x01(\x01:\x030.8R\x13cutActiveCountDecay\x123\n" + - "\x12cut_cleanup_target\x18\x9d\x01 \x01(\x05:\x041000R\x10cutCleanupTarget\x12?\n" + - "\x1anew_constraints_batch_size\x18z \x01(\x05:\x0250R\x17newConstraintsBatchSize\x12C\n" + - "\x1bexploit_integer_lp_solution\x18^ \x01(\b:\x04trueR\x18exploitIntegerLpSolution\x12;\n" + - "\x17exploit_all_lp_solution\x18t \x01(\b:\x04trueR\x14exploitAllLpSolution\x12:\n" + - "\x15exploit_best_solution\x18\x82\x01 \x01(\b:\x05falseR\x13exploitBestSolution\x12F\n" + - "\x1bexploit_relaxation_solution\x18\xa1\x01 \x01(\b:\x05falseR\x19exploitRelaxationSolution\x122\n" + - "\x11exploit_objective\x18\x83\x01 \x01(\b:\x04trueR\x10exploitObjective\x12B\n" + - "\x19detect_linearized_product\x18\x95\x02 \x01(\b:\x05falseR\x17detectLinearizedProduct\x12T\n" + - "#use_new_integer_conflict_resolution\x18\xd0\x02 \x01(\b:\x05falseR\x1fuseNewIntegerConflictResolution\x12I\n" + - "\x1ecreate_1uip_boolean_during_icr\x18\xd5\x02 \x01(\b:\x04trueR\x1acreate1uipBooleanDuringIcr\x12,\n" + - "\rmip_max_bound\x18| \x01(\x01:\b10000000R\vmipMaxBound\x12)\n" + - "\x0fmip_var_scaling\x18} \x01(\x01:\x011R\rmipVarScaling\x12;\n" + - "\x16mip_scale_large_domain\x18\xe1\x01 \x01(\b:\x05falseR\x13mipScaleLargeDomain\x12P\n" + - "!mip_automatically_scale_variables\x18\xa6\x01 \x01(\b:\x04trueR\x1emipAutomaticallyScaleVariables\x12*\n" + - "\ronly_solve_ip\x18\xde\x01 \x01(\b:\x05falseR\vonlySolveIp\x127\n" + - "\x14mip_wanted_precision\x18~ \x01(\x01:\x051e-06R\x12mipWantedPrecision\x12=\n" + - "\x19mip_max_activity_exponent\x18\x7f \x01(\x05:\x0253R\x16mipMaxActivityExponent\x127\n" + - "\x13mip_check_precision\x18\x80\x01 \x01(\x01:\x060.0001R\x11mipCheckPrecision\x12M\n" + - " mip_compute_true_objective_bound\x18\xc6\x01 \x01(\b:\x04trueR\x1cmipComputeTrueObjectiveBound\x12=\n" + - "\x17mip_max_valid_magnitude\x18\xc7\x01 \x01(\x01:\x051e+20R\x14mipMaxValidMagnitude\x12b\n" + - "+mip_treat_high_magnitude_bounds_as_infinity\x18\x96\x02 \x01(\b:\x05falseR%mipTreatHighMagnitudeBoundsAsInfinity\x124\n" + - "\x12mip_drop_tolerance\x18\xe8\x01 \x01(\x01:\x051e-16R\x10mipDropTolerance\x120\n" + - "\x12mip_presolve_level\x18\x85\x02 \x01(\x05:\x012R\x10mipPresolveLevel\"H\n" + - "\rVariableOrder\x12\f\n" + - "\bIN_ORDER\x10\x00\x12\x14\n" + - "\x10IN_REVERSE_ORDER\x10\x01\x12\x13\n" + - "\x0fIN_RANDOM_ORDER\x10\x02\"F\n" + - "\bPolarity\x12\x11\n" + - "\rPOLARITY_TRUE\x10\x00\x12\x12\n" + - "\x0ePOLARITY_FALSE\x10\x01\x12\x13\n" + - "\x0fPOLARITY_RANDOM\x10\x02\"J\n" + - "\x1dConflictMinimizationAlgorithm\x12\b\n" + - "\x04NONE\x10\x00\x12\n" + - "\n" + - "\x06SIMPLE\x10\x01\x12\r\n" + - "\tRECURSIVE\x10\x02\"\x04\b\x03\x10\x03\"\x9b\x01\n" + - "\x19BinaryMinizationAlgorithm\x12\x1a\n" + - "\x16NO_BINARY_MINIMIZATION\x10\x00\x12 \n" + - "\x1cBINARY_MINIMIZATION_FROM_UIP\x10\x01\x12.\n" + - "*BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONS\x10\x05\"\x04\b\x02\x10\x02\"\x04\b\x03\x10\x03\"\x04\b\x04\x10\x04\"5\n" + - "\x0eClauseOrdering\x12\x13\n" + - "\x0fCLAUSE_ACTIVITY\x10\x00\x12\x0e\n" + - "\n" + - "CLAUSE_LBD\x10\x01\"\x86\x01\n" + - "\x10RestartAlgorithm\x12\x0e\n" + - "\n" + - "NO_RESTART\x10\x00\x12\x10\n" + - "\fLUBY_RESTART\x10\x01\x12\x1d\n" + - "\x19DL_MOVING_AVERAGE_RESTART\x10\x02\x12\x1e\n" + - "\x1aLBD_MOVING_AVERAGE_RESTART\x10\x03\x12\x11\n" + - "\rFIXED_RESTART\x10\x04\"t\n" + - "\x15MaxSatAssumptionOrder\x12\x1c\n" + - "\x18DEFAULT_ASSUMPTION_ORDER\x10\x00\x12\x1d\n" + - "\x19ORDER_ASSUMPTION_BY_DEPTH\x10\x01\x12\x1e\n" + - "\x1aORDER_ASSUMPTION_BY_WEIGHT\x10\x02\"o\n" + - "\x1dMaxSatStratificationAlgorithm\x12\x17\n" + - "\x13STRATIFICATION_NONE\x10\x00\x12\x1a\n" + - "\x16STRATIFICATION_DESCENT\x10\x01\x12\x19\n" + - "\x15STRATIFICATION_ASCENT\x10\x02\"\xe1\x01\n" + - "\x0fSearchBranching\x12\x14\n" + - "\x10AUTOMATIC_SEARCH\x10\x00\x12\x10\n" + - "\fFIXED_SEARCH\x10\x01\x12\x14\n" + - "\x10PORTFOLIO_SEARCH\x10\x02\x12\r\n" + - "\tLP_SEARCH\x10\x03\x12\x16\n" + - "\x12PSEUDO_COST_SEARCH\x10\x04\x12'\n" + - "#PORTFOLIO_WITH_QUICK_RESTART_SEARCH\x10\x05\x12\x0f\n" + - "\vHINT_SEARCH\x10\x06\x12\x18\n" + - "\x14PARTIAL_FIXED_SEARCH\x10\a\x12\x15\n" + - "\x11RANDOMIZED_SEARCH\x10\b\"\xb8\x01\n" + - "\x17SharedTreeSplitStrategy\x12\x17\n" + - "\x13SPLIT_STRATEGY_AUTO\x10\x00\x12\x1e\n" + - "\x1aSPLIT_STRATEGY_DISCREPANCY\x10\x01\x12\x1f\n" + - "\x1bSPLIT_STRATEGY_OBJECTIVE_LB\x10\x02\x12 \n" + - "\x1cSPLIT_STRATEGY_BALANCED_TREE\x10\x03\x12!\n" + - "\x1dSPLIT_STRATEGY_FIRST_PROPOSAL\x10\x04\"h\n" + - "\x10FPRoundingMethod\x12\x13\n" + - "\x0fNEAREST_INTEGER\x10\x00\x12\x0e\n" + - "\n" + - "LOCK_BASED\x10\x01\x12\x15\n" + - "\x11ACTIVE_LOCK_BASED\x10\x03\x12\x18\n" + - "\x14PROPAGATION_ASSISTED\x10\x02Bk\n" + - "\x16com.google.ortools.satP\x01Z:github.com/google/or-tools/ortools/sat/proto/satparameters\xaa\x02\x12Google.OrTools.Sat" - -var ( - file_ortools_sat_sat_parameters_proto_rawDescOnce sync.Once - file_ortools_sat_sat_parameters_proto_rawDescData []byte -) - -func file_ortools_sat_sat_parameters_proto_rawDescGZIP() []byte { - file_ortools_sat_sat_parameters_proto_rawDescOnce.Do(func() { - file_ortools_sat_sat_parameters_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ortools_sat_sat_parameters_proto_rawDesc), len(file_ortools_sat_sat_parameters_proto_rawDesc))) - }) - return file_ortools_sat_sat_parameters_proto_rawDescData -} - -var file_ortools_sat_sat_parameters_proto_enumTypes = make([]protoimpl.EnumInfo, 11) -var file_ortools_sat_sat_parameters_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_ortools_sat_sat_parameters_proto_goTypes = []any{ - (SatParameters_VariableOrder)(0), // 0: operations_research.sat.SatParameters.VariableOrder - (SatParameters_Polarity)(0), // 1: operations_research.sat.SatParameters.Polarity - (SatParameters_ConflictMinimizationAlgorithm)(0), // 2: operations_research.sat.SatParameters.ConflictMinimizationAlgorithm - (SatParameters_BinaryMinizationAlgorithm)(0), // 3: operations_research.sat.SatParameters.BinaryMinizationAlgorithm - (SatParameters_ClauseOrdering)(0), // 4: operations_research.sat.SatParameters.ClauseOrdering - (SatParameters_RestartAlgorithm)(0), // 5: operations_research.sat.SatParameters.RestartAlgorithm - (SatParameters_MaxSatAssumptionOrder)(0), // 6: operations_research.sat.SatParameters.MaxSatAssumptionOrder - (SatParameters_MaxSatStratificationAlgorithm)(0), // 7: operations_research.sat.SatParameters.MaxSatStratificationAlgorithm - (SatParameters_SearchBranching)(0), // 8: operations_research.sat.SatParameters.SearchBranching - (SatParameters_SharedTreeSplitStrategy)(0), // 9: operations_research.sat.SatParameters.SharedTreeSplitStrategy - (SatParameters_FPRoundingMethod)(0), // 10: operations_research.sat.SatParameters.FPRoundingMethod - (*SatParameters)(nil), // 11: operations_research.sat.SatParameters -} -var file_ortools_sat_sat_parameters_proto_depIdxs = []int32{ - 0, // 0: operations_research.sat.SatParameters.preferred_variable_order:type_name -> operations_research.sat.SatParameters.VariableOrder - 1, // 1: operations_research.sat.SatParameters.initial_polarity:type_name -> operations_research.sat.SatParameters.Polarity - 2, // 2: operations_research.sat.SatParameters.minimization_algorithm:type_name -> operations_research.sat.SatParameters.ConflictMinimizationAlgorithm - 3, // 3: operations_research.sat.SatParameters.binary_minimization_algorithm:type_name -> operations_research.sat.SatParameters.BinaryMinizationAlgorithm - 4, // 4: operations_research.sat.SatParameters.clause_cleanup_ordering:type_name -> operations_research.sat.SatParameters.ClauseOrdering - 5, // 5: operations_research.sat.SatParameters.restart_algorithms:type_name -> operations_research.sat.SatParameters.RestartAlgorithm - 11, // 6: operations_research.sat.SatParameters.subsolver_params:type_name -> operations_research.sat.SatParameters - 6, // 7: operations_research.sat.SatParameters.max_sat_assumption_order:type_name -> operations_research.sat.SatParameters.MaxSatAssumptionOrder - 7, // 8: operations_research.sat.SatParameters.max_sat_stratification:type_name -> operations_research.sat.SatParameters.MaxSatStratificationAlgorithm - 8, // 9: operations_research.sat.SatParameters.search_branching:type_name -> operations_research.sat.SatParameters.SearchBranching - 9, // 10: operations_research.sat.SatParameters.shared_tree_split_strategy:type_name -> operations_research.sat.SatParameters.SharedTreeSplitStrategy - 10, // 11: operations_research.sat.SatParameters.fp_rounding:type_name -> operations_research.sat.SatParameters.FPRoundingMethod - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_ortools_sat_sat_parameters_proto_init() } -func file_ortools_sat_sat_parameters_proto_init() { - if File_ortools_sat_sat_parameters_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_ortools_sat_sat_parameters_proto_rawDesc), len(file_ortools_sat_sat_parameters_proto_rawDesc)), - NumEnums: 11, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ortools_sat_sat_parameters_proto_goTypes, - DependencyIndexes: file_ortools_sat_sat_parameters_proto_depIdxs, - EnumInfos: file_ortools_sat_sat_parameters_proto_enumTypes, - MessageInfos: file_ortools_sat_sat_parameters_proto_msgTypes, - }.Build() - File_ortools_sat_sat_parameters_proto = out.File - file_ortools_sat_sat_parameters_proto_goTypes = nil - file_ortools_sat_sat_parameters_proto_depIdxs = nil -} diff --git a/proto/LICENSE b/proto/LICENSE new file mode 100644 index 0000000..2d68bb2 --- /dev/null +++ b/proto/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2026 Jan Kott + +All rights reserved. + +This repository and its contents are proprietary and confidential. No part of this codebase may be used, copied, modified, or distributed without explicit written permission from the copyright holder. diff --git a/proto/buf.md b/proto/buf.md new file mode 100644 index 0000000..12528b9 --- /dev/null +++ b/proto/buf.md @@ -0,0 +1,20 @@ +# FanScore Optimizer + +`fanscore.optimizer.v1.OptimizerService` solves caller-defined OR-Tools CP-SAT models. + +## Usage + +- `Solve` requires a `model`; an empty but present model is valid. +- Optional `parameters` are restricted to the fields documented on `SolveRequest.parameters`. +- Consume solutions only when `result.status` is `OPTIMAL` or `FEASIBLE`. +- Set an RPC deadline. The server caps solve time, workers, concurrency, and message size. + +## Client SDKs + +Install generated SDKs for your language from [the BSR module](https://buf.build/fanscore-ch/optimizer). +See Buf's [SDK documentation](https://buf.build/docs/bsr/generated-sdks/) for installation. +Pin the resolved SDK version in your application. + +This module includes unchanged OR-Tools v9.15 schemas and their Apache-2.0 notices +in `ortools/LICENSE`. See [the service repository](https://github.com/fanscore-ch/optimizer) +for server setup and development. diff --git a/proto/optimizer/v1/optimizer.proto b/proto/fanscore/optimizer/v1/optimizer.proto similarity index 75% rename from proto/optimizer/v1/optimizer.proto rename to proto/fanscore/optimizer/v1/optimizer.proto index 492c0f5..68e69e9 100644 --- a/proto/optimizer/v1/optimizer.proto +++ b/proto/fanscore/optimizer/v1/optimizer.proto @@ -1,17 +1,18 @@ +// Defines the request, response, and gRPC service for executing OR-Tools CP-SAT models. syntax = "proto3"; -package optimizer.v1; +package fanscore.optimizer.v1; import "ortools/sat/cp_model.proto"; import "ortools/sat/sat_parameters.proto"; -option go_package = "github.com/fanscore-ch/optimizer/gen/go/optimizer/v1;optimizerv1"; - +// Executes caller-defined OR-Tools CP-SAT models within server resource limits. service OptimizerService { // Solves a caller-defined model. No application data is loaded or persisted. rpc Solve(SolveRequest) returns (SolveResponse); } +// A CP-SAT model and optional solver parameters for a single solve. message SolveRequest { // Required. Variable indexes in the response refer to this model's variables. operations_research.sat.CpModelProto model = 1; @@ -24,6 +25,7 @@ message SolveRequest { operations_research.sat.SatParameters parameters = 2; } +// The solver's status, solution, and execution statistics. message SolveResponse { // Includes OPTIMAL, FEASIBLE, INFEASIBLE, MODEL_INVALID, or UNKNOWN. // A solution may only be consumed for OPTIMAL or FEASIBLE. diff --git a/pyproject.toml b/pyproject.toml index 778e77b..2ef665e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,11 +18,10 @@ requires = ["hatchling>=1.27,<2"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] -packages = ["src/optimizer"] +packages = ["src/optimizer", "src/fanscore"] [dependency-groups] dev = [ - "grpcio-tools>=1.81.1,<1.82", "pytest>=9.1,<10", "ruff>=0.16,<0.17", ] @@ -33,7 +32,7 @@ addopts = "-ra" [tool.ruff] target-version = "py314" -extend-exclude = ["src/optimizer/v1/*_pb2.py", "src/optimizer/v1/*_pb2.pyi", "src/optimizer/v1/*_pb2_grpc.py"] +extend-exclude = ["src/fanscore"] [tool.ruff.lint] select = ["E", "F", "I", "UP", "B"] diff --git a/scripts/generate.py b/scripts/generate.py deleted file mode 100644 index cedb657..0000000 --- a/scripts/generate.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Regenerate Python and Go bindings from the checked-in protobuf contracts.""" - -import argparse -import os -import pathlib -import subprocess -import sys -import tempfile - -from grpc_tools import protoc - -ROOT = pathlib.Path(__file__).resolve().parents[1] - - -def generate(output: pathlib.Path, go: bool) -> int: - arguments = ["protoc", f"-I{ROOT / 'proto'}"] - if go: - tools = ROOT / ".tools" - tools.mkdir(parents=True, exist_ok=True) - for plugin, module in ( - ("protoc-gen-go", "google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.12"), - ( - "protoc-gen-go-grpc", - "google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.6.2", - ), - ): - subprocess.run( - ["go", "install", module], - cwd=ROOT, - env=os.environ | {"GOBIN": str(tools)}, - check=True, - ) - arguments.append(f"--plugin={plugin}={tools / plugin}") - arguments += [f"--go_out={output}", "--go_opt=paths=source_relative"] - for name in ("cp_model", "sat_parameters"): - arguments.append( - f"--go_opt=Mortools/sat/{name}.proto=" - "github.com/fanscore-ch/optimizer/gen/go/ortools/sat;sat" - ) - arguments += [ - f"--go-grpc_out={output}", - "--go-grpc_opt=paths=source_relative", - "ortools/sat/cp_model.proto", - "ortools/sat/sat_parameters.proto", - ] - else: - arguments += [ - f"--python_out={output}", - f"--pyi_out={output}", - f"--grpc_python_out={output}", - ] - arguments.append("optimizer/v1/optimizer.proto") - return protoc.main(arguments) - - -def main() -> int: - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("--check", action="store_true") - parser.add_argument( - "--go", action="store_true", help="Generate Go instead of Python" - ) - args = parser.parse_args() - destination = ROOT / ("gen/go" if args.go else "src") - destination.mkdir(parents=True, exist_ok=True) - if not args.check: - return generate(destination, args.go) - with tempfile.TemporaryDirectory() as directory: - output = pathlib.Path(directory) - if code := generate(output, args.go): - return code - expected = { - path.relative_to(output) for path in output.rglob("*") if path.is_file() - } - for relative in sorted(expected): - checked_in = destination / relative - if ( - not checked_in.is_file() - or (output / relative).read_bytes() != checked_in.read_bytes() - ): - print(f"stale generated file: {checked_in}", file=sys.stderr) - return 1 - patterns = ( - ("*.pb.go",) - if args.go - else ( - "*_pb2.py", - "*_pb2.pyi", - "*_pb2_grpc.py", - ) - ) - existing = { - path.relative_to(destination) - for pattern in patterns - for path in destination.rglob(pattern) - if path.is_file() - } - obsolete = existing - expected - for relative in sorted(obsolete): - print(f"obsolete generated file: {destination / relative}", file=sys.stderr) - if obsolete: - return 1 - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/scripts/test_go.py b/scripts/test_go.py deleted file mode 100644 index 7a3f4b5..0000000 --- a/scripts/test_go.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Run Go client tests against a temporary Python gRPC server.""" - -import os -import pathlib -import subprocess -from concurrent.futures import ThreadPoolExecutor - -from optimizer.config import Config -from optimizer.server import create_server - -ROOT = pathlib.Path(__file__).resolve().parents[1] - - -def main() -> None: - config = Config() - with ThreadPoolExecutor(max_workers=config.max_concurrent_solves + 2) as executor: - server, _ = create_server(config, executor) - port = server.add_insecure_port("127.0.0.1:0") - if port == 0: - raise RuntimeError("could not bind integration test server") - server.start() - try: - subprocess.run( - ["go", "test", "-count=1", "./..."], - cwd=ROOT / "gen/go", - env=os.environ | {"OPTIMIZER_TEST_ADDRESS": f"127.0.0.1:{port}"}, - check=True, - ) - finally: - server.stop(0).wait() - - -if __name__ == "__main__": - main() diff --git a/src/fanscore/optimizer/v1/optimizer_pb2.py b/src/fanscore/optimizer/v1/optimizer_pb2.py new file mode 100644 index 0000000..546e9c2 --- /dev/null +++ b/src/fanscore/optimizer/v1/optimizer_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: fanscore/optimizer/v1/optimizer.proto +# Protobuf Python Version: 6.33.5 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 33, + 5, + '', + 'fanscore/optimizer/v1/optimizer.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ortools.sat import cp_model_pb2 as ortools_dot_sat_dot_cp__model__pb2 +from ortools.sat import sat_parameters_pb2 as ortools_dot_sat_dot_sat__parameters__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%fanscore/optimizer/v1/optimizer.proto\x12\x15\x66\x61nscore.optimizer.v1\x1a\x1aortools/sat/cp_model.proto\x1a ortools/sat/sat_parameters.proto\"\x93\x01\n\x0cSolveRequest\x12;\n\x05model\x18\x01 \x01(\x0b\x32%.operations_research.sat.CpModelProtoR\x05model\x12\x46\n\nparameters\x18\x02 \x01(\x0b\x32&.operations_research.sat.SatParametersR\nparameters\"R\n\rSolveResponse\x12\x41\n\x06result\x18\x01 \x01(\x0b\x32).operations_research.sat.CpSolverResponseR\x06result2f\n\x10OptimizerService\x12R\n\x05Solve\x12#.fanscore.optimizer.v1.SolveRequest\x1a$.fanscore.optimizer.v1.SolveResponseb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fanscore.optimizer.v1.optimizer_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_SOLVEREQUEST']._serialized_start=127 + _globals['_SOLVEREQUEST']._serialized_end=274 + _globals['_SOLVERESPONSE']._serialized_start=276 + _globals['_SOLVERESPONSE']._serialized_end=358 + _globals['_OPTIMIZERSERVICE']._serialized_start=360 + _globals['_OPTIMIZERSERVICE']._serialized_end=462 +# @@protoc_insertion_point(module_scope) diff --git a/src/fanscore/optimizer/v1/optimizer_pb2_grpc.py b/src/fanscore/optimizer/v1/optimizer_pb2_grpc.py new file mode 100644 index 0000000..949e1dc --- /dev/null +++ b/src/fanscore/optimizer/v1/optimizer_pb2_grpc.py @@ -0,0 +1,81 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from fanscore.optimizer.v1 import optimizer_pb2 as fanscore_dot_optimizer_dot_v1_dot_optimizer__pb2 + + +class OptimizerServiceStub: + """Executes caller-defined OR-Tools CP-SAT models within server resource limits. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Solve = channel.unary_unary( + '/fanscore.optimizer.v1.OptimizerService/Solve', + request_serializer=fanscore_dot_optimizer_dot_v1_dot_optimizer__pb2.SolveRequest.SerializeToString, + response_deserializer=fanscore_dot_optimizer_dot_v1_dot_optimizer__pb2.SolveResponse.FromString, + _registered_method=True) + + +class OptimizerServiceServicer: + """Executes caller-defined OR-Tools CP-SAT models within server resource limits. + """ + + def Solve(self, request, context): + """Solves a caller-defined model. No application data is loaded or persisted. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_OptimizerServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Solve': grpc.unary_unary_rpc_method_handler( + servicer.Solve, + request_deserializer=fanscore_dot_optimizer_dot_v1_dot_optimizer__pb2.SolveRequest.FromString, + response_serializer=fanscore_dot_optimizer_dot_v1_dot_optimizer__pb2.SolveResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'fanscore.optimizer.v1.OptimizerService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('fanscore.optimizer.v1.OptimizerService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class OptimizerService: + """Executes caller-defined OR-Tools CP-SAT models within server resource limits. + """ + + @staticmethod + def Solve(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/fanscore.optimizer.v1.OptimizerService/Solve', + fanscore_dot_optimizer_dot_v1_dot_optimizer__pb2.SolveRequest.SerializeToString, + fanscore_dot_optimizer_dot_v1_dot_optimizer__pb2.SolveResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/optimizer/__init__.py b/src/optimizer/__init__.py index e69de29..8963116 100644 --- a/src/optimizer/__init__.py +++ b/src/optimizer/__init__.py @@ -0,0 +1,3 @@ +from fanscore.optimizer.v1 import optimizer_pb2 + +SERVICE_NAME = optimizer_pb2.DESCRIPTOR.services_by_name["OptimizerService"].full_name diff --git a/src/optimizer/handler.py b/src/optimizer/grpc_service.py similarity index 96% rename from src/optimizer/handler.py rename to src/optimizer/grpc_service.py index 99c3e27..1a9a10d 100644 --- a/src/optimizer/handler.py +++ b/src/optimizer/grpc_service.py @@ -5,9 +5,9 @@ import grpc from ortools.sat import cp_model_pb2 +from fanscore.optimizer.v1 import optimizer_pb2, optimizer_pb2_grpc from optimizer.config import Config from optimizer.solver import Solver, prepare_parameters -from optimizer.v1 import optimizer_pb2, optimizer_pb2_grpc logger = logging.getLogger(__name__) @@ -22,7 +22,7 @@ def Solve( ) -> optimizer_pb2.SolveResponse: started = time.monotonic() if not request.HasField("model"): - context.abort(grpc.StatusCode.INVALID_ARGUMENT, "model is required") + context.abort(grpc.StatusCode.INVALID_ARGUMENT, "model: value is required") if not self._slots.acquire(blocking=False): context.abort( grpc.StatusCode.RESOURCE_EXHAUSTED, "solver capacity exhausted" diff --git a/src/optimizer/health.py b/src/optimizer/health.py index 289b649..e991abd 100644 --- a/src/optimizer/health.py +++ b/src/optimizer/health.py @@ -3,8 +3,8 @@ import grpc from grpc_health.v1 import health_pb2, health_pb2_grpc +from optimizer import SERVICE_NAME from optimizer.config import health_address_from_env -from optimizer.v1 import SERVICE_NAME def check_health(address: str) -> bool: diff --git a/src/optimizer/server.py b/src/optimizer/server.py index 9108b01..199c8bf 100644 --- a/src/optimizer/server.py +++ b/src/optimizer/server.py @@ -3,9 +3,10 @@ import grpc from grpc_health.v1 import health, health_pb2, health_pb2_grpc +from fanscore.optimizer.v1 import optimizer_pb2_grpc +from optimizer import SERVICE_NAME from optimizer.config import Config -from optimizer.handler import OptimizerServicer -from optimizer.v1 import SERVICE_NAME, optimizer_pb2_grpc +from optimizer.grpc_service import OptimizerServicer def create_server( diff --git a/src/optimizer/v1/__init__.py b/src/optimizer/v1/__init__.py deleted file mode 100644 index 7e252b5..0000000 --- a/src/optimizer/v1/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from optimizer.v1 import optimizer_pb2 - -SERVICE_NAME = optimizer_pb2.DESCRIPTOR.services_by_name["OptimizerService"].full_name diff --git a/src/optimizer/v1/optimizer_pb2.py b/src/optimizer/v1/optimizer_pb2.py deleted file mode 100644 index 12d9894..0000000 --- a/src/optimizer/v1/optimizer_pb2.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: optimizer/v1/optimizer.proto -# Protobuf Python Version: 6.33.5 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 33, - 5, - '', - 'optimizer/v1/optimizer.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ortools.sat import cp_model_pb2 as ortools_dot_sat_dot_cp__model__pb2 -from ortools.sat import sat_parameters_pb2 as ortools_dot_sat_dot_sat__parameters__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1coptimizer/v1/optimizer.proto\x12\x0coptimizer.v1\x1a\x1aortools/sat/cp_model.proto\x1a ortools/sat/sat_parameters.proto\"\x80\x01\n\x0cSolveRequest\x12\x34\n\x05model\x18\x01 \x01(\x0b\x32%.operations_research.sat.CpModelProto\x12:\n\nparameters\x18\x02 \x01(\x0b\x32&.operations_research.sat.SatParameters\"J\n\rSolveResponse\x12\x39\n\x06result\x18\x01 \x01(\x0b\x32).operations_research.sat.CpSolverResponse2T\n\x10OptimizerService\x12@\n\x05Solve\x12\x1a.optimizer.v1.SolveRequest\x1a\x1b.optimizer.v1.SolveResponseBBZ@github.com/fanscore-ch/optimizer/gen/go/optimizer/v1;optimizerv1b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'optimizer.v1.optimizer_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'Z@github.com/fanscore-ch/optimizer/gen/go/optimizer/v1;optimizerv1' - _globals['_SOLVEREQUEST']._serialized_start=109 - _globals['_SOLVEREQUEST']._serialized_end=237 - _globals['_SOLVERESPONSE']._serialized_start=239 - _globals['_SOLVERESPONSE']._serialized_end=313 - _globals['_OPTIMIZERSERVICE']._serialized_start=315 - _globals['_OPTIMIZERSERVICE']._serialized_end=399 -# @@protoc_insertion_point(module_scope) diff --git a/src/optimizer/v1/optimizer_pb2.pyi b/src/optimizer/v1/optimizer_pb2.pyi deleted file mode 100644 index 0e43e75..0000000 --- a/src/optimizer/v1/optimizer_pb2.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from ortools.sat import cp_model_pb2 as _cp_model_pb2 -from ortools.sat import sat_parameters_pb2 as _sat_parameters_pb2 -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SolveRequest(_message.Message): - __slots__ = ("model", "parameters") - MODEL_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - model: _cp_model_pb2.CpModelProto - parameters: _sat_parameters_pb2.SatParameters - def __init__(self, model: _Optional[_Union[_cp_model_pb2.CpModelProto, _Mapping]] = ..., parameters: _Optional[_Union[_sat_parameters_pb2.SatParameters, _Mapping]] = ...) -> None: ... - -class SolveResponse(_message.Message): - __slots__ = ("result",) - RESULT_FIELD_NUMBER: _ClassVar[int] - result: _cp_model_pb2.CpSolverResponse - def __init__(self, result: _Optional[_Union[_cp_model_pb2.CpSolverResponse, _Mapping]] = ...) -> None: ... diff --git a/src/optimizer/v1/optimizer_pb2_grpc.py b/src/optimizer/v1/optimizer_pb2_grpc.py deleted file mode 100644 index a9c9424..0000000 --- a/src/optimizer/v1/optimizer_pb2_grpc.py +++ /dev/null @@ -1,98 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - -from optimizer.v1 import optimizer_pb2 as optimizer_dot_v1_dot_optimizer__pb2 - -GRPC_GENERATED_VERSION = '1.81.1' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + ' but the generated code in optimizer/v1/optimizer_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) - - -class OptimizerServiceStub: - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Solve = channel.unary_unary( - '/optimizer.v1.OptimizerService/Solve', - request_serializer=optimizer_dot_v1_dot_optimizer__pb2.SolveRequest.SerializeToString, - response_deserializer=optimizer_dot_v1_dot_optimizer__pb2.SolveResponse.FromString, - _registered_method=True) - - -class OptimizerServiceServicer: - """Missing associated documentation comment in .proto file.""" - - def Solve(self, request, context): - """Solves a caller-defined model. No application data is loaded or persisted. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_OptimizerServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Solve': grpc.unary_unary_rpc_method_handler( - servicer.Solve, - request_deserializer=optimizer_dot_v1_dot_optimizer__pb2.SolveRequest.FromString, - response_serializer=optimizer_dot_v1_dot_optimizer__pb2.SolveResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'optimizer.v1.OptimizerService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('optimizer.v1.OptimizerService', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class OptimizerService: - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def Solve(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/optimizer.v1.OptimizerService/Solve', - optimizer_dot_v1_dot_optimizer__pb2.SolveRequest.SerializeToString, - optimizer_dot_v1_dot_optimizer__pb2.SolveResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) diff --git a/tests/conftest.py b/tests/conftest.py index ab37bca..c55b5d4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,9 +5,9 @@ import pytest from ortools.sat import cp_model_pb2 +from fanscore.optimizer.v1 import optimizer_pb2_grpc from optimizer.config import Config from optimizer.server import create_server -from optimizer.v1 import optimizer_pb2_grpc @pytest.fixture diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000..02cc586 --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,19 @@ +import pytest + +from optimizer.config import Config + + +@pytest.mark.parametrize( + "options", + [ + {"max_solve_seconds": float("inf")}, + {"max_solve_seconds": 0}, + {"max_workers": 0}, + {"max_concurrent_solves": 0}, + {"max_message_bytes": -1}, + {"shutdown_grace_seconds": -1}, + ], +) +def test_invalid_configuration_is_rejected(options): + with pytest.raises(ValueError): + Config(**options) diff --git a/tests/test_main.py b/tests/test_main.py index 12c79bf..598c6a7 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -10,7 +10,7 @@ from optimizer.health import check_health -def test_cli_reads_environment_and_shuts_down_cleanly(tmp_path): +def test_cli_uses_listen_address_and_exits_on_sigterm(tmp_path): with socket.socket() as listener: listener.bind(("127.0.0.1", 0)) address = f"127.0.0.1:{listener.getsockname()[1]}" diff --git a/tests/test_parameters.py b/tests/test_parameters.py index 0f43449..159423f 100644 --- a/tests/test_parameters.py +++ b/tests/test_parameters.py @@ -1,4 +1,3 @@ -import pytest from ortools.sat import sat_parameters_pb2 from optimizer.config import Config @@ -27,19 +26,3 @@ def test_lower_client_limits_are_respected(): ) assert params.max_time_in_seconds == 0.5 assert params.num_workers == 1 - - -@pytest.mark.parametrize( - "options", - [ - {"max_solve_seconds": float("inf")}, - {"max_solve_seconds": 0}, - {"max_workers": 0}, - {"max_concurrent_solves": 0}, - {"max_message_bytes": -1}, - {"shutdown_grace_seconds": -1}, - ], -) -def test_invalid_configuration_is_rejected(options): - with pytest.raises(ValueError): - Config(**options) diff --git a/tests/test_proto.py b/tests/test_proto.py index ac153f3..e3e3b39 100644 --- a/tests/test_proto.py +++ b/tests/test_proto.py @@ -1,5 +1,4 @@ import subprocess -import sys from pathlib import Path from google.protobuf import descriptor_pb2 @@ -22,17 +21,16 @@ def normalize_descriptor(message): def test_vendored_protos_match_runtime(tmp_path): root = Path(__file__).resolve().parents[1] output = tmp_path / "descriptor.pb" - # Isolate protoc from OR-Tools' native protobuf library to avoid Linux crashes. subprocess.run( [ - sys.executable, - "-m", - "grpc_tools.protoc", - f"-I{root / 'proto'}", - f"--descriptor_set_out={output}", - "ortools/sat/cp_model.proto", - "ortools/sat/sat_parameters.proto", + "buf", + "build", + "--as-file-descriptor-set", + "--exclude-source-info", + "--output", + str(output), ], + cwd=root, check=True, ) descriptors = descriptor_pb2.FileDescriptorSet.FromString(output.read_bytes()) diff --git a/tests/test_service.py b/tests/test_service.py index b1e833d..ea2550d 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -5,10 +5,10 @@ import pytest from ortools.sat import cp_model_pb2, sat_parameters_pb2 -from optimizer import handler +from fanscore.optimizer.v1 import optimizer_pb2 +from optimizer import grpc_service from optimizer.health import check_health from optimizer.solver import Solver -from optimizer.v1 import optimizer_pb2 def test_solves_knapsack_over_grpc(running_server, knapsack): @@ -55,6 +55,7 @@ def test_requires_model(running_server): with running_server() as (stub, _), pytest.raises(grpc.RpcError) as error: stub.Solve(optimizer_pb2.SolveRequest(), timeout=2) assert error.value.code() == grpc.StatusCode.INVALID_ARGUMENT + assert error.value.details() == "model: value is required" @pytest.mark.parametrize( @@ -97,7 +98,7 @@ def solve(self, remaining_seconds): assert release.wait(3) return super().solve(remaining_seconds) - monkeypatch.setattr(handler, "Solver", PausedSolver) + monkeypatch.setattr(grpc_service, "Solver", PausedSolver) with running_server(max_concurrent_solves=1) as (stub, address): first = stub.Solve.future(optimizer_pb2.SolveRequest(model=knapsack), timeout=5) try: @@ -133,7 +134,7 @@ def cancel(self): cancelled.set() super().cancel() - monkeypatch.setattr(handler, "Solver", ObservedSolver) + monkeypatch.setattr(grpc_service, "Solver", ObservedSolver) with running_server(max_concurrent_solves=1, max_solve_seconds=20) as (stub, _): timeout = 1 if termination == "deadline" else 10 future = stub.Solve.future( @@ -168,17 +169,29 @@ def cancel(self): assert result.status == cp_model_pb2.OPTIMAL -def test_server_time_limit_returns_solver_status(running_server, hard_model): +def test_server_time_limit_bounds_native_search( + running_server, hard_model, monkeypatch +): + limits = [] + + class ObservedSolver(Solver): + def solve(self, remaining_seconds): + limits.append(remaining_seconds) + return super().solve(remaining_seconds) + + monkeypatch.setattr(grpc_service, "Solver", ObservedSolver) with running_server(max_solve_seconds=0.2) as (stub, _): result = stub.Solve( optimizer_pb2.SolveRequest(model=hard_model), timeout=3 ).result + assert len(limits) == 1 + assert 0 < limits[0] <= 0.2 assert result.status in ( cp_model_pb2.UNKNOWN, cp_model_pb2.FEASIBLE, cp_model_pb2.OPTIMAL, ) - assert result.wall_time < 2 + assert result.wall_time < 0.7 def test_message_size_is_bounded(running_server): diff --git a/uv.lock b/uv.lock index e2edf25..eb1a335 100644 --- a/uv.lock +++ b/uv.lock @@ -37,7 +37,6 @@ dependencies = [ [package.dev-dependencies] dev = [ - { name = "grpcio-tools" }, { name = "pytest" }, { name = "ruff" }, ] @@ -51,7 +50,6 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ - { name = "grpcio-tools", specifier = ">=1.81.1,<1.82" }, { name = "pytest", specifier = ">=9.1,<10" }, { name = "ruff", specifier = ">=0.16,<0.17" }, ] @@ -90,29 +88,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6e/87/174bbfb5613794862c45b5cdf567fcfb478ad5a3a7b594e11d998656b2f9/grpcio_health_checking-1.81.1-py3-none-any.whl", hash = "sha256:cbc6a4171825ec64389de2f062d296ba129a5c27eefd0dd55fa837909184bdf9", size = 19120, upload-time = "2026-06-11T12:58:38.008Z" }, ] -[[package]] -name = "grpcio-tools" -version = "1.81.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "grpcio" }, - { name = "protobuf" }, - { name = "setuptools" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/83/b3/1c5951352d6777fd7f99a0ccee04617fdfd8a5dbf2918a1f58c8b2b280b8/grpcio_tools-1.81.1.tar.gz", hash = "sha256:a22a3870180927fdd84e2b27d079ef5b7f5f8c6110181b6736afc17a463481f1", size = 6236155, upload-time = "2026-06-11T12:51:21.235Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0d/08/e581ad42ae517a61172285047e4d710e2ac75f2f1915f7c91f284254e6d5/grpcio_tools-1.81.1-cp314-cp314-linux_armv7l.whl", hash = "sha256:7d168ea26390717d0462c0d0408331dc98a60fc7f7e6118afac9b73f5a66d87c", size = 2585944, upload-time = "2026-06-11T12:50:54.528Z" }, - { url = "https://files.pythonhosted.org/packages/78/c8/200d90ebad685af7eea5ff7e0360c504dd01ec053fe0f1f9c4abe3ea2d5a/grpcio_tools-1.81.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:43c528655b226375013036692d8db4cd59060c1f41dd62c77f4d17b69f6ce828", size = 5813492, upload-time = "2026-06-11T12:50:57.291Z" }, - { url = "https://files.pythonhosted.org/packages/2d/c0/60da2a1af37aa8eb47308cec24d9f7709a8976fdec3a53fd35b56b358326/grpcio_tools-1.81.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a9c6fcc68c9d5a208967bfe4fd3224d3c3be9a950c3e827e8f4b17e15c2dc555", size = 2634991, upload-time = "2026-06-11T12:50:59.767Z" }, - { url = "https://files.pythonhosted.org/packages/0c/7f/dede28b579ae9bf9079ba1aa913e8088d1dc0cdbe21c85caa22f0790cad2/grpcio_tools-1.81.1-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:a987c85dcbe1b32066d7acd46266d1a428aecbd629331bf5b853e74c835bf876", size = 2957913, upload-time = "2026-06-11T12:51:02.31Z" }, - { url = "https://files.pythonhosted.org/packages/4c/38/4de2118adb58ec7ffba65ec623b5836db769665c192517cbf187db3f6145/grpcio_tools-1.81.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a882382507bb5ec6d7edc9648053dfd3bc8f9285cde56a6fa9b9a83b4bd07f1c", size = 2697709, upload-time = "2026-06-11T12:51:05.016Z" }, - { url = "https://files.pythonhosted.org/packages/6b/e1/762ced51059e4f694fd337ecae491581d42a4e61dcb0415d8c5c60e6ddcb/grpcio_tools-1.81.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7746e508d4239a02f7e93638be5bc0ebb0120ddb796f7506aaae9d47a4599d97", size = 3151884, upload-time = "2026-06-11T12:51:07.593Z" }, - { url = "https://files.pythonhosted.org/packages/19/d8/9823090dc801e7229944874e7429c3b98e741ac778d8dc373f60240e1c43/grpcio_tools-1.81.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:fc3d2a41a7a4467fa03b391394fffada9291fe8feebc8679b526f6bc36942b25", size = 3710404, upload-time = "2026-06-11T12:51:10.172Z" }, - { url = "https://files.pythonhosted.org/packages/64/4e/4eae98d02148cb6f9f452f09942afba407afa6851e6c1fddc5ae9ec0b4ed/grpcio_tools-1.81.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:21bb3ba90e6d8df1ff663d4ee39a4e5b25a64e8ed4902476ca9ded0954d3917a", size = 3370525, upload-time = "2026-06-11T12:51:12.678Z" }, - { url = "https://files.pythonhosted.org/packages/e0/3e/2206e597a128da6a03a6106d2eaf2c3e72c7d80843d4be933e3a3d10d02a/grpcio_tools-1.81.1-cp314-cp314-win32.whl", hash = "sha256:3dca56016d90a710c4d9861bae793dc089c1430a90c79ce672e948ddb65fa539", size = 1030582, upload-time = "2026-06-11T12:51:14.906Z" }, - { url = "https://files.pythonhosted.org/packages/cf/f2/bbeef86c687225b7bbc7c0acdfbd25c8bcaa3f5b1c941db053e5c3d9e859/grpcio_tools-1.81.1-cp314-cp314-win_amd64.whl", hash = "sha256:cb08172b7b629e75cb33866928d319a3196540a725eaab628ba721007140f1af", size = 1207490, upload-time = "2026-06-11T12:51:17.598Z" }, -] - [[package]] name = "immutabledict" version = "4.3.1" @@ -306,15 +281,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fc/05/c16957eb287c3fc062e032619a25868d93d408a844b725bcf514f7a378ff/ruff-0.16.10-py3-none-win_arm64.whl", hash = "sha256:25a65fe998c4e6861ec079ada5826a2fc605e6cbccbe9dcd7fac1f54e791621b", size = 10366440, upload-time = "2026-10-01T18:03:19.04Z" }, ] -[[package]] -name = "setuptools" -version = "84.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6d/44/f5da03a8ef95d369145c5bb53050e7877c9f3d312e128605fd9504829143/setuptools-84.0.0.tar.gz", hash = "sha256:f4695c21257f0d9b537ec2692c941d02ee143b7cc1276941349a546573b2ef73", size = 1168449, upload-time = "2026-08-08T18:27:58.365Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/95/9c/c510029fc6ef33a6275cd2c5d3cecd6613dfd6aa401d57c54f1c18852ccf/setuptools-84.0.0-py3-none-any.whl", hash = "sha256:51a52592b3b99e102b609654876bd65f19f999935166d1352678931132b0c670", size = 818216, upload-time = "2026-08-08T18:27:56.719Z" }, -] - [[package]] name = "six" version = "1.17.0"