Class: ORTools::RoutingModel
- Inherits:
-
Object
- Object
- ORTools::RoutingModel
- Defined in:
- lib/or_tools/routing_model.rb
Instance Method Summary collapse
- #add_disjunction(indices, penalty, max_cardinality = 1, penalty_cost_behavior = :penalize_once) ⇒ Object
- #solve(solution_limit: nil, time_limit: nil, lns_time_limit: nil, first_solution_strategy: nil, local_search_metaheuristic: nil, log_search: nil) ⇒ Object
Instance Method Details
#add_disjunction(indices, penalty, max_cardinality = 1, penalty_cost_behavior = :penalize_once) ⇒ Object
21 22 23 |
# File 'lib/or_tools/routing_model.rb', line 21 def add_disjunction(indices, penalty, max_cardinality = 1, penalty_cost_behavior = :penalize_once) _add_disjunction(indices, penalty, max_cardinality, penalty_cost_behavior) end |
#solve(solution_limit: nil, time_limit: nil, lns_time_limit: nil, first_solution_strategy: nil, local_search_metaheuristic: nil, log_search: nil) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/or_tools/routing_model.rb', line 3 def solve( solution_limit: nil, time_limit: nil, lns_time_limit: nil, first_solution_strategy: nil, local_search_metaheuristic: nil, log_search: nil ) search_parameters = ORTools.default_routing_search_parameters search_parameters.solution_limit = solution_limit if solution_limit search_parameters.time_limit = time_limit if time_limit search_parameters.lns_time_limit = lns_time_limit if lns_time_limit search_parameters.first_solution_strategy = first_solution_strategy if first_solution_strategy search_parameters. = if search_parameters.log_search = log_search unless log_search.nil? solve_with_parameters(search_parameters) end |