This example app demonstrates the following features:
- The orders are inserted at the specified positions between the route's orders.
The route can be reoptimized, which means that after the addition, the route orders will be rearranged in the best order of visit, so you won't see the orders being added at the specified positions. The orders will be also added in the list of orders of the route's optimization.
When you run the example app, in addition to the existing orders, the route will also have the added orders.
- Create a
vrp::RouteOrderfor each order that will be added. Set the specified position at which it will be added using the methodsetIndexInRoute()and set other desired fields. - Insert all the
vrp::RouteOrdercreated at 1.) in avrp::RouteOrderList. - Create a
ProgressListener,vrp::Serviceand avrp::Requestthat will be used for traking the request status. - Retrieve the route like in the example
GetRoute()in avrp::Route. 5 Call theroute.addOrders()method fromvrp::Route, using the list from 2.), a boolean to specify if the route should be reoptimized, a boolean to specify if the orders should be added at the optimal position (in this examples it has to befalse) and theProgressListener. - Check if the associated request has reached the finished status. Once completed, you can retrieve the updated route by calling the
getRoute()method, which returns avrp::Routecontaining the updated route.