Comments (3)
Great to hear this project is useful for you!
Hm I don't really know how to help you here - if you need features implemented in this project feel free to open detailed tickets - maybe someone from the community will step up. I'm also happy to give you some guidance into the right direction but I'm not able to run features out for you.
What features are you looking for specifically?
from node-or-tools.
Hi @daniel-j-h , we have those features implemented in our own vrp.cc, in pure C++. Let me give you an example. Below an extract of our vpr.cc.
feature: enforcing a max distance per route:
implementation: (jsonObj is the json object with the algorithm input - we use the nlohmann/json library
(...)
using operations_research::ServiceTimePlusTransition;
using operations_research::RoutingModel;
(...)
RoutingModel routing(2*numShipments + numServices + numTotalDifferentDepots,
numVehicles, vDepots);
(...)
// Adding a maximun distance constraint
const int64 kMaxDistance = 999999999;
std::vector<int64> vMaxDistance (numVehicles);
const int64 kTimePerDemandUnitFake = 0;//Using a fake value
for (int i=0; i<numVehicles; i++){
if(jsonObj["vehicles"][i].count("max_distance")==0){
vMaxDistance[i]=kMaxDistance;
} else {
vMaxDistance[i]=jsonObj["vehicles"][i]["max_distance"];
}
}
ServiceTimePlusTransition distance(
kTimePerDemandUnitFake, NewPermanentCallback(&demand, &DeterministicDemand::ServiceTime),
NewPermanentCallback(&locations, &LocationContainer::DistanceBetweenNodes));
routing.AddDimensionWithVehicleCapacity(
NewPermanentCallback(&distance, &ServiceTimePlusTransition::Compute),
kMaxDistance, vMaxDistance, /*fix_start_cumul_to_zero=*/true, kDistance);
const operations_research::RoutingDimension& distance_dimension =
routing.GetDimensionOrDie(kDistance);
std::cout << "Done Max Dist\n";
(...)
Question: How would we translate this bit of code in order to add it to your existing vrp.cc in node-or-tools? Many thanks.
from node-or-tools.
Interaction with the solver happens in the vrp worker here. You need to parse the parameter from the JavaScript side in vrp_params.h, store it, and pass it on to the worker in vrp.cc.
from node-or-tools.
Related Issues (20)
- npm ERR! .... HOT 1
- What is durations? And how to declare demands? HOT 1
- `ACTION binding_gyp_action_before_build_target_install_deps mason_packages` is called twice on Node 10 HOT 2
- RouteLocks is for establish starting points in order, or to assign points to route to visit optimized?
- Time windows array must include depot?
- Problem when providing pair of pickup and delivery indices
- Problem when considering vehicles with different vehicle speed and capacity in Google OR tools python
- How to minimize number of vehicles and enforce routes to maximize usage
- Inconsistent results when giving additional vehicle even if not required
- Not giving the best (shortest and fastest) route
- Size too large for deployment. Possibilities to reduce size? HOT 1
- [email protected] and [email protected] HOT 6
- How to package google official ortools into static link library
- can't use the package in mac
- how to declare demands ? HOT 1
- Ouput examples on a local webserver
- Windows build
- Usage/Installation on node-alpine
- BUG: amazonaws links not accessible
- Pre build binaries missing for v1.1.0 (OSX + node 14.20.1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-or-tools.