|
24 | 24 | %include "ortools/util/python/pair.i"
|
25 | 25 | %include "ortools/util/python/vector.i"
|
26 | 26 |
|
27 |
| -%import "ortools/constraint_solver/python/constraint_solver.i" |
| 27 | +// While the module name will be overridden by the one specified on the cmd line, |
| 28 | +// without this, derived classes (e.g. TypeRequirementChecker) will import base |
| 29 | +// class from the module specified in the following %import. |
| 30 | +%module pywraprouting |
| 31 | +%import(module="ortools.constraint_solver.pywrapcp") "ortools/constraint_solver/python/constraint_solver.i" |
28 | 32 | %include "ortools/routing/python/types.i"
|
29 | 33 | %include "ortools/routing/python/index_manager.i"
|
30 | 34 |
|
@@ -63,6 +67,8 @@ DEFINE_INDEX_TYPE_TYPEDEF(
|
63 | 67 | operations_research::RoutingResourceClassIndex,
|
64 | 68 | operations_research::RoutingModel::ResourceClassIndex);
|
65 | 69 |
|
| 70 | +// ============= Type conversions ============== |
| 71 | + |
66 | 72 | // See ./constraint_solver_helpers.i.
|
67 | 73 | PY_CONVERT_HELPER_INTEXPR_AND_INTVAR();
|
68 | 74 | PY_CONVERT_HELPER_PTR(IntervalVar);
|
@@ -99,9 +105,12 @@ PY_PROTO_TYPEMAP(ortools.routing.parameters_pb2,
|
99 | 105 | %include "ortools/routing/parameters.h"
|
100 | 106 | %unignoreall
|
101 | 107 |
|
| 108 | +%unignore operations_research; |
| 109 | + |
| 110 | +namespace operations_research { |
| 111 | + |
102 | 112 | // %including a .pb.h is frowned upon (for good general reasons), so we
|
103 | 113 | // have to duplicate the OptionalBoolean enum here to give it to python users.
|
104 |
| -namespace operations_research { |
105 | 114 | enum OptionalBoolean {
|
106 | 115 | BOOL_UNSPECIFIED = 0,
|
107 | 116 | BOOL_FALSE = 2,
|
|
0 commit comments