This example app demonstrates the following features:
- Make changes on an optimization and return the new solution.
Besides the orders, all the other fields can be changed using the method UpdateOptimization(); check how to change orders in the Add Orders To Optimization, Delete Order From Optimization and Update Order From Optimization examples.
The optimization can also be reoptimized so a new solution will be returned for the new optimization. If the optimization is not reoptimized, the changed will not be applied over the optimization's routes.
When you run the example app, the new solution will be returned.
- Create a
ProgressListenerand avrp::Service. - Retrieve the optimization you want to update (see Get Optimization example) in a
vrp::Optimization. - Change the desired fields of the
vrp::Optimization. - Create a
vrp::RouteList, and avrp::Requestthat will be use for traking the status of the operation. - Call the
updateOptimization()method from thevrp::Serviceusing the list from 4.), thevrp::Optimizationfrom 2.), the optimization will be reoptimized. - Check if the associated request has reached the finished status. Once completed, you can retrieve the optimization results by calling the
getSolution()method, which returns avrp::RouteListcontaining the reoptimized routes.