https://github.com/wesleimp/vroom-elixir
Implementation of VROOM (Vehicle Routing Open-Source Optimization Machine) HTTP client.
https://github.com/wesleimp/vroom-elixir
elixir osrm vroom
Last synced: 2 months ago
JSON representation
Implementation of VROOM (Vehicle Routing Open-Source Optimization Machine) HTTP client.
- Host: GitHub
- URL: https://github.com/wesleimp/vroom-elixir
- Owner: wesleimp
- License: mit
- Created: 2021-04-13T21:49:53.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-15T18:48:31.000Z (almost 4 years ago)
- Last Synced: 2025-03-24T18:47:32.912Z (3 months ago)
- Topics: elixir, osrm, vroom
- Language: Elixir
- Homepage: https://hexdocs.pm/vroom/readme.html
- Size: 43 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vroom-elixir
Implementation of VROOM (Vehicle Routing Open-Source Optimization Machine) HTTP client for Elixir.
## Usage
### Install
```elixir
defp deps() do
[
{:vroom, "~> 0.1.0"}
]
end
```### Configuration
```elixir
# config/config.exsconfig :vroom,
url: "VROOM URL",
timeout: 15000# config/prod.exs
config :vroom,
url: "VROOM URL PROD"
```### Example
```elixir
defmodule Router do
def solve_route do
shipment = %VROOM.Shipment{
amount: [1],
pickup: %VROOM.Shipment.Step{
id: 1,
description: "Pickup #1",
location: [
-49.273080825805664,
-25.437422762495064
]
},
delivery: %VROOM.Shipment.Step{
id: 2,
description: "Delivery #1",
location: [
-49.264068603515625,
-25.436686416884992
]
}
}vehicle = %VROOM.Vehicle{
capacity: [3],
description: "John Doe",
id: 1,
profile: "car",
start: [
-49.273080825805664,
-25.437422762495064
]
}%{"code" => 0, "routes" => routes} = VROOM.solve([vehicle], [shipment], [], %{g: true})
routes
end
end
```For more info, check out the [docs](https://hexdocs.pm/vroom)