1+ #include < string>
2+ #include < vector>
3+
14#include < ortools/constraint_solver/routing.h>
25#include < ortools/constraint_solver/routing_parameters.h>
3-
4- #include " ext.h "
6+ # include < rice/rice.hpp >
7+ #include < rice/stl.hpp >
58
69using operations_research::Assignment;
710using operations_research::ConstraintSolverParameters;
@@ -24,37 +27,31 @@ using Rice::Object;
2427using Rice::String;
2528using Rice::Symbol;
2629
27- namespace Rice ::detail
28- {
30+ namespace Rice ::detail {
2931 template <>
30- struct Type <RoutingNodeIndex>
31- {
32+ struct Type <RoutingNodeIndex> {
3233 static bool verify () { return true ; }
3334 };
3435
3536 template <>
36- class From_Ruby <RoutingNodeIndex>
37- {
37+ class From_Ruby <RoutingNodeIndex> {
3838 public:
3939 Convertible is_convertible (VALUE value) { return Convertible::Cast; }
4040
41- RoutingNodeIndex convert (VALUE x)
42- {
41+ RoutingNodeIndex convert (VALUE x) {
4342 const RoutingNodeIndex index{From_Ruby<int >().convert (x)};
4443 return index;
4544 }
4645 };
4746
4847 template <>
49- class To_Ruby <RoutingNodeIndex>
50- {
48+ class To_Ruby <RoutingNodeIndex> {
5149 public:
52- VALUE convert (RoutingNodeIndex const & x)
53- {
50+ VALUE convert (RoutingNodeIndex const & x) {
5451 return To_Ruby<int >().convert (x.value ());
5552 }
5653 };
57- }
54+ } // namespace Rice::detail
5855
5956void init_routing (Rice::Module& m) {
6057 auto rb_cRoutingSearchParameters = Rice::define_class_under<RoutingSearchParameters>(m, " RoutingSearchParameters" );
@@ -332,7 +329,7 @@ void init_routing(Rice::Module& m) {
332329 .define_method (" add_resource_group" , &RoutingModel::AddResourceGroup)
333330 .define_method (" dimension_resource_group_indices" , &RoutingModel::GetDimensionResourceGroupIndices)
334331 .define_method (" dimension_resource_group_index" , &RoutingModel::GetDimensionResourceGroupIndex)
335- .define_method (" add_disjunction" , &RoutingModel::AddDisjunction, Rice::Arg (" _indices" ), Rice::Arg (" _penalty" ), Rice::Arg (" _max_cardinality" ) = ( int64_t ) 1 , Rice::Arg (" _penalty_cost_behavior" ) = RoutingModel::PenaltyCostBehavior::PENALIZE_ONCE)
332+ .define_method (" add_disjunction" , &RoutingModel::AddDisjunction, Rice::Arg (" _indices" ), Rice::Arg (" _penalty" ), Rice::Arg (" _max_cardinality" ) = static_cast < int64_t >( 1 ) , Rice::Arg (" _penalty_cost_behavior" ) = RoutingModel::PenaltyCostBehavior::PENALIZE_ONCE)
336333 .define_method (" disjunction_indices" , &RoutingModel::GetDisjunctionIndices)
337334 .define_method (" disjunction_penalty" , &RoutingModel::GetDisjunctionPenalty)
338335 .define_method (" disjunction_max_cardinality" , &RoutingModel::GetDisjunctionMaxCardinality)
0 commit comments