This example app demonstrates the following features:
- Add an optimization with custom matrices and display the solution on the map.
Create an optimization where the time and distance matrice values are set by the user.
When you run the example app, an optimization will be saved, the solution will be returned and showed on map.
- Create a
vrp::OrderListand add the orders to it. Each order needs to have a customer set; you can either add a new customer and then set it to the order, or you can use a previously created customer (see Get Customer example). - Create a
vrp::ConfigurationParametersand set the distance unit, the matrices build type toMBT_Set, and the matrices to it. - Create a
vrp::Optimizationand set the objects created at 1.) and 2.) to it. - Create a
ProgressListener,vrp::Service, and avrp::Requestthat will be used to track the request status. - Call the
addOptimization()method fromvrp::Serviceusing the request from 4.), thevrp::Optimizationfrom 3.), and the progress listener. - After adding the optimization, monitor the request until it reaches a finished state. Once completed, retrieve the optimization results by calling the
getSolution()method, which returns avrp::RouteListcontaining the generated routes.
- Create a
MapServiceListener,OpenGLContextandMapView. - Create a
LandmarkList,CoordinatesListandPolygonGeographicArea. - Instruct the
MapViewto highlight theLandmarkListfrom 2.) to print the orders, departures and destinations. - Instruct the
MapViewto center on thePolygonGeographicArea. - Create a
MarkerCollectionof typePolylineand add the route's shape to it. - Set the newly created
MarkerCollectionin the markers collections of the map view preferences. - Allow the application to run until the map view is fully loaded.

