ankane / or-tools-ruby

Operations research tools for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specify start and end points for vehicle routing

mschaf opened this issue · comments

Hello ankane

First of all: I love your ruby bindings, saves me allready a lot time and pain, thanks for that.

I would like to specify start and endpoints for a vehicle routing problem instead of a depot where everthing starts and ends.
The google docs give an example how to do this: https://developers.google.com/optimization/routing/routing_tasks#setting-start-and-end-locations-for-routes

 # Create the routing index manager.
manager = pywrapcp.RoutingIndexManager(len(data['distance_matrix']), data['num_vehicles'], data['starts'], data['ends'])

I tried something similar in ruby

manager = ORTools::RoutingIndexManager.new(@distance_matrix.count, car_count, @start_points, [@end_point] * car_count)

but it gives me a initialize': no implicit conversion of Array into Integer (TypeError) on that line.

Is that possible with your library?

Hey @mschaf, should be possible on master. Let me know if you find any other missing functionality.

Big thanks for the fast response and implementation, works like a charm. 👍