1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
6// http://www.apache.org/licenses/LICENSE-2.0
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
14// Protocol buffer used to store search statistics.
18option java_package = "com.google.ortools.constraintsolver";
19option java_multiple_files = true;
20option csharp_namespace = "Google.OrTools.ConstraintSolver";
22package operations_research;
24// Statistics on local search.
25message LocalSearchStatistics {
26 // First solution statistics collected during search.
27 message FirstSolutionStatistics {
28 // Name of the strategy used.
30 // Time spent in the decision builder.
31 double duration_seconds = 2;
33 // Statistics for each first solution called during the search.
34 repeated FirstSolutionStatistics first_solution_statistics = 6;
35 // Statistics on local search operators called during the search.
36 message LocalSearchOperatorStatistics {
37 // Name of the operator.
38 string local_search_operator = 1;
39 // Number of neighbors generated by the operator.
40 int64 num_neighbors = 2;
41 // Number of neighbors which were filtered.
42 int64 num_filtered_neighbors = 3;
43 // Number of neighbors eventually accepted.
44 int64 num_accepted_neighbors = 4;
45 // Time spent in the operator.
46 double duration_seconds = 5;
48 // Statistics for each operator called during the search.
49 repeated LocalSearchOperatorStatistics local_search_operator_statistics = 1;
50 // Total number of (filtered/accepted) neighbors created during the search.
51 int64 total_num_neighbors = 3;
52 int64 total_num_filtered_neighbors = 4;
53 int64 total_num_accepted_neighbors = 5;
54 // Statistics on local search filters called during the search.
55 message LocalSearchFilterStatistics {
56 // Name of the filter.
57 string local_search_filter = 1;
58 // Number of times the filter was called.
60 // Number of times the filter rejected a neighbor.
61 int64 num_rejects = 3;
62 // Time spent in the filter.
63 double duration_seconds = 4;
64 // Number of rejects per second.
65 double num_rejects_per_second = 5;
66 // Context within which the filter was called.
69 // Statistics for each filter called during the search.
70 repeated LocalSearchFilterStatistics local_search_filter_statistics = 2;
73// Statistics on the search in the constraint solver.
74message ConstraintSolverStatistics {
75 // Number of branches explored.
76 int64 num_branches = 1;
77 // Number of failures/backtracks.
78 int64 num_failures = 2;
79 // Number of solutions found.
80 int64 num_solutions = 3;
81 // Memory usage of the solver.
83 // Total time spent in the solver.
84 double duration_seconds = 5;
88message SearchStatistics {
89 // Local search statistics.
90 LocalSearchStatistics local_search_statistics = 1;
91 // Constraint solver statistics.
92 ConstraintSolverStatistics constraint_solver_statistics = 2;