Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

route4me

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

route4me

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Route4Me Ruby SDK

Access Route4Me's logistics-as-a-service API using our Ruby SDK

Installation

gem install --source https://github.com/route4me/route4me-ruby-sdk route4me
# or
gem install route4me

Usage example

Single Driver Route Optimization

require 'route4me'
require './addresses'

Route4me.api_key = '11111111111111111111111111111111'
problem = Route4me::OptimizationProblem.optimize(
  :addresses => addresses.first(10),
  :parameters => {
    :algorithm_type          => Route4me::AlgorithmType::TSP,
    :distance_unit           => Route4me::DistanceUnit::MILES,
    :device_type             => Route4me::DeviceType::WEB,
    :optimize                => Route4me::OptimizationType::DISTANCE,
    :travel_mode             => Route4me::TravelMode::DRIVING,
    :vehicle_capacity        => 1,
    :vehicle_max_distance_mi => 10000
  }
)

puts problem

Multiple Depot Multiple driver route optimization

require 'route4me'
require './addresses'

Route4me.api_key = '11111111111111111111111111111111'
problem = Route4me::OptimizationProblem.optimize(
  :addresses => addresses,
  :parameters => {
    :algorithm_type          => Route4me::AlgorithmType::CVRP_TW_MD,
    :distance_unit           => Route4me::DistanceUnit::MILES,
    :device_type             => Route4me::DeviceType::WEB,
    :optimize                => Route4me::OptimizationType::DISTANCE,
    :travel_mode             => Route4me::TravelMode::DRIVING,
    :route_max_duration      => 86400,
    :vehicle_capacity        => 50,
    :vehicle_max_distance_mi => 10000,
    :parts                   => 50
  }
)

puts problem

More examples

Please see examples folder for more examples, which are to demonstrate examples of Route & GPS calls and some optimization problems (single driver, round trip, multiple driver, time window, re-optimization).

Tests

rspec spec

FAQs

Package last updated on 04 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc