All Projects → Mapotempo → optimizer-api

Mapotempo / optimizer-api

Licence: AGPL-3.0 license
Unified API for multiple optimizer engines

Programming Languages

ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to optimizer-api

vrpy
A python framework for solving the VRP and its variants with column generation.
Stars: ✭ 94 (+261.54%)
Mutual labels:  optimization, vrp
Scikit Opt
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)
Stars: ✭ 2,791 (+10634.62%)
Mutual labels:  optimization, tsp
optimization
Routing optimization module module for Itinero.
Stars: ✭ 47 (+80.77%)
Mutual labels:  optimization, tsp
Multiple-Vehicle-Routing
Simple MVR simulation
Stars: ✭ 27 (+3.85%)
Mutual labels:  vrp, tsp
cplex-example
Solving a TSP with the CPLEX C++ API.
Stars: ✭ 40 (+53.85%)
Mutual labels:  optimization, tsp
spinw
SpinW Matlab library for spin wave calculation
Stars: ✭ 25 (-3.85%)
Mutual labels:  optimization
SumOfSquares.jl
Sum of Squares Programming for Julia
Stars: ✭ 96 (+269.23%)
Mutual labels:  optimization
osprey
🦅Hyperparameter optimization for machine learning pipelines 🦅
Stars: ✭ 71 (+173.08%)
Mutual labels:  optimization
structural-imbalance
Demo for analyzing the structural imbalance on a signed social network.
Stars: ✭ 22 (-15.38%)
Mutual labels:  optimization
studio
GAMS Studio
Stars: ✭ 25 (-3.85%)
Mutual labels:  optimization
dopt
A numerical optimisation and deep learning framework for D.
Stars: ✭ 28 (+7.69%)
Mutual labels:  optimization
fastnumbers
Super-fast and clean conversions to numbers.
Stars: ✭ 85 (+226.92%)
Mutual labels:  optimization
mader
Trajectory Planner in Multi-Agent and Dynamic Environments
Stars: ✭ 252 (+869.23%)
Mutual labels:  optimization
ultraopt
Distributed Asynchronous Hyperparameter Optimization better than HyperOpt. 比HyperOpt更强的分布式异步超参优化库。
Stars: ✭ 93 (+257.69%)
Mutual labels:  optimization
Joint-User-Association-and-In-band-Backhaul-Scheduling-and-in-5G-mmWave-Networks
Matlab Simulation for T. K. Vu, M. Bennis, S. Samarakoon, M. Debbah and M. Latva-aho, "Joint In-Band Backhauling and Interference Mitigation in 5G Heterogeneous Networks," European Wireless 2016; 22th European Wireless Conference, Oulu, Finland, 2016, pp. 1-6. URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7499273&isnumber=7499250
Stars: ✭ 36 (+38.46%)
Mutual labels:  optimization
zoofs
zoofs is a python library for performing feature selection using a variety of nature-inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics-based to Evolutionary. It's easy to use , flexible and powerful tool to reduce your feature size.
Stars: ✭ 142 (+446.15%)
Mutual labels:  optimization
PyDE
Differential evolution global optimization in Python.
Stars: ✭ 28 (+7.69%)
Mutual labels:  optimization
noisyopt
Python library for optimizing noisy functions.
Stars: ✭ 73 (+180.77%)
Mutual labels:  optimization
snl-quest
An open source, Python-based software application suite for energy storage simulation and analysis developed by Sandia National Laboratories.
Stars: ✭ 82 (+215.38%)
Mutual labels:  optimization
DotNet.SystemCollections.Analyzers
A set of code analyzers & code fix providers to help developers use the proper .NET Collection & API in their algorithms
Stars: ✭ 72 (+176.92%)
Mutual labels:  optimization

Mapotempo Optimizer API Build Status

Run an optimizer REST API depending of many contraints for a Vehicle Routing Problem (VRP).

Prerequisite

For ruby, bundler and gems, rbenv or rvm are recommanded.

On Ubuntu

sudo apt install libssl-dev libyaml-dev
  • Depending on the Ubuntu version, libssl 1.0 may not be available. Then the following may fix the issue.
sudo add-apt-repository 'deb http://security.ubuntu.com/ubuntu bionic-security main'
sudo apt update
sudo apt install libssl1.0-dev
  • Ruby 2.5.5 (if not using rbenv/rvm)
sudo apt install ruby-full
  • redis-server
sudo apt install redis-server
  • Start redis service
sudo systemctl enable redis-server.service
  • libgeos-dev
sudo apt install libgeos-dev libgeos-3.7.1
  • libicu-dev
sudo apt install libicu-dev

On Mac OS

brew install redis
brew install geos

Installation

gem install bundler
bundle install

This project requires some solver and interface projects in order to be fully functional!

Note : when updating OR-Tools you should to recompile optimizer-ortools.

By default, Optimizer-API and the related projects are supposed to be in parallel folders as follows:

Project folders

We recommand to use a symbolic link to point the OR-Tools asset.

  ln -s or-tools_Debian-10-64bit_v7.8.7959 or-tools

Configuration

Adjust config/environments files.

Running

bundle exec rackup [-p 1791]

And in production mode:

APP_ENV=production bundle exec rackup [-p 1791]

Start Redis and then start the worker

APP_ENV=production COUNT=5 QUEUE=* bundle exec rake resque:workers

Usage

The API is defined in Swagger format at http://localhost:1791/0.1/swagger_doc and can be tested with Swagger-UI http://swagger.mapotempo.com/?url=http://optimizer.mapotempo.com/0.1/swagger_doc

curl -X POST --header "Content-Type:application/json" --data '{"vrp":{"vehicles":[]}}' http://localhost:1791/0.1/vrp/submit.json?api_key=demo

Moreover, the concepts used are described in the docs folder.

Test

Run tests:

APP_ENV=test bundle exec rake test

If you want to get information about how long each test lasts:

TIME=true HTML=true APP_ENV=test bundle exec rake test

This generates a report with test times. You can find the report in optimizer-api/test/html_reports folder.

If you want to run a specific test file (let's say real_cases_periodic_test.rb file only):

APP_ENV=test bundle exec rake test TEST=test/real_cases_periodic_test.rb

If you want to run only one specific test (let's say test_instance_clustered test only) you can use focus or call:

APP_ENV=test bundle exec rake test TESTOPTS="--name=test_instance_clustered"

Tests are splitted into several sets and you can replay only one or more set(s):

APP_ENV=test bundle exec rake test:api
APP_ENV=test bundle exec rake test:api test:models

You can list all available tasks with:

bundle exec rake -T

You can add your own tests on specific Vehicle Routing Problem (for instance data from real cases). Let's see how to create a new test called "new_test". You will find template for test in test/real_cases_test.rb

Before creating test, you need to capture scenario, in order to have a static image of your problem, insensitive to the routers edits.

Add your test JSON file into test/fixtures/. Now to create your test, just copy test template in test/wrappers/real_cases_test.rb, or any equivalent file. Once launched, the dump file of the problem will be created and put aswell in test/fixtures as following:

  • new_test.dump file corresponding to complete vrp with calculated matrices if not provided

If you create a test by using .dump, your test will fail as soon as vrp model is changed. Just run following task to update fixtures:

TEST_DUMP_VRP=true APP_ENV=test bundle exec rake test TEST=test/real_cases_test.rb

Note: you can update a test and run the modified scenario with new vrp .json:

bundle exec rackup [-p 1791]
COUNT=5 QUEUE=* bundle exec rake resque:workers
curl -X POST --header "Content-Type:application/json" --data @test/fixtures/my_test.json http://localhost:1791/0.1/vrp/submit.json?api_key=key

If you don't want to run some long real cases tests you can deactive them:

SKIP_REAL_CASES=true APP_ENV=test bundle exec rake test

Github Actions

To test on Github Actions with a optimizer-ortools different than the latest version, specify in your Actions configuration the following environment variable : OPTIMIZER_ORTOOLS_VERSION with you github owner nick.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].