Google OR-Tools
v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
cp_model_fz_solver.h
Go to the documentation of this file.
1
// Copyright 2010-2025 Google LLC
2
// Licensed under the Apache License, Version 2.0 (the "License");
3
// you may not use this file except in compliance with the License.
4
// You may obtain a copy of the License at
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
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.
13
14
#ifndef ORTOOLS_FLATZINC_CP_MODEL_FZ_SOLVER_H_
15
#define ORTOOLS_FLATZINC_CP_MODEL_FZ_SOLVER_H_
16
17
#include <string>
18
19
#include "
ortools/flatzinc/model.h
"
20
#include "
ortools/sat/cp_model.pb.h
"
21
#include "
ortools/sat/model.h
"
22
#include "
ortools/sat/sat_parameters.pb.h
"
23
#include "
ortools/util/logging.h
"
24
25
namespace
operations_research
{
26
namespace
fz
{
27
28
struct
FlatzincSatParameters
{
29
bool
search_all_solutions
=
false
;
30
bool
display_all_solutions
=
false
;
31
bool
use_free_search
=
false
;
32
bool
log_search_progress
=
false
;
33
bool
display_statistics
=
false
;
34
int
random_seed
= 0;
35
int
number_of_threads
= 0;
36
double
max_time_in_seconds
= 0.0;
37
bool
ortools_mode
=
false
;
38
bool
check_all_solutions
=
false
;
39
};
40
41
}
// namespace fz
42
43
namespace
sat
{
44
45
// Scan the model to replace all int2float to int_eq, and all floating point
46
// variables used in these int2float constraint to be integral.
47
//
48
// Scan the model to find a floating point objective (defined by a single
49
// floating point variable and a single float_lin_eq constraint defining it),
50
// and replace them by a single objective with integer variables and floating
51
// point weights.
52
void
ProcessFloatingPointOVariablesAndObjective
(
fz::Model
* fz_model);
53
54
// Solves the given flatzinc model using the CP-SAT solver.
55
CpSolverResponse
SolveFzWithCpModelProto
(
const
fz::Model
& model,
56
const
fz::FlatzincSatParameters
& p,
57
const
SatParameters& sat_params,
58
Model
* sat_model,
59
SolverLogger
* solution_logger);
60
61
}
// namespace sat
62
}
// namespace operations_research
63
64
#endif
// ORTOOLS_FLATZINC_CP_MODEL_FZ_SOLVER_H_
Model
Definition
model.h:345
operations_research::SolverLogger
Definition
logging.h:43
operations_research::fz::Model
Definition
model.h:345
cp_model.pb.h
model.h
operations_research::fz
Definition
checker.cc:34
operations_research::sat
Definition
routing_sat.cc:45
operations_research::sat::SolveFzWithCpModelProto
CpSolverResponse SolveFzWithCpModelProto(const fz::Model &fz_model, const fz::FlatzincSatParameters &p, const SatParameters &sat_params, Model *sat_model, SolverLogger *solution_logger)
Definition
cp_model_fz_solver.cc:3716
operations_research::sat::ProcessFloatingPointOVariablesAndObjective
void ProcessFloatingPointOVariablesAndObjective(fz::Model *fz_model)
Definition
cp_model_fz_solver.cc:3657
operations_research
OR-Tools root namespace.
Definition
binary_indexed_tree.h:21
model.h
sat_parameters.pb.h
operations_research::fz::FlatzincSatParameters
Definition
cp_model_fz_solver.h:28
operations_research::fz::FlatzincSatParameters::search_all_solutions
bool search_all_solutions
Definition
cp_model_fz_solver.h:29
operations_research::fz::FlatzincSatParameters::display_statistics
bool display_statistics
Definition
cp_model_fz_solver.h:33
operations_research::fz::FlatzincSatParameters::max_time_in_seconds
double max_time_in_seconds
Definition
cp_model_fz_solver.h:36
operations_research::fz::FlatzincSatParameters::log_search_progress
bool log_search_progress
Definition
cp_model_fz_solver.h:32
operations_research::fz::FlatzincSatParameters::ortools_mode
bool ortools_mode
Definition
cp_model_fz_solver.h:37
operations_research::fz::FlatzincSatParameters::use_free_search
bool use_free_search
Definition
cp_model_fz_solver.h:31
operations_research::fz::FlatzincSatParameters::number_of_threads
int number_of_threads
Definition
cp_model_fz_solver.h:35
operations_research::fz::FlatzincSatParameters::check_all_solutions
bool check_all_solutions
Definition
cp_model_fz_solver.h:38
operations_research::fz::FlatzincSatParameters::display_all_solutions
bool display_all_solutions
Definition
cp_model_fz_solver.h:30
operations_research::fz::FlatzincSatParameters::random_seed
int random_seed
Definition
cp_model_fz_solver.h:34
logging.h
ortools
flatzinc
cp_model_fz_solver.h
Generated by
1.15.0