This example app demonstrates the following features:
- Add an optimization with custom configuration parameters, orders with different fields set, multiple vehicles with different constraints set; display the solution on the map.
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 desired parameters. - Create one
vrp::VehicleConstraintsfor each vehicle and set them to avrp::VehicleConstraintsList. - Create a
vrp::Optimization, set the desired fields and the objects created at 1.), 2.) and 3.) to it. - Create a
ProgressListener,vrp::Service, and avrp::Requestthat will be used for traking the request status. - Call the
addOptimization()method fromvrp::Serviceusing the list from 5.), thevrp::Optimizationfrom 4.) and the progress listener. - After adding an optimization, check whether 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 generated routes.
- Create a
MapServiceListener,OpenGLContextandMapView. - Create a
LandmarkList,CoordinatesListusing thevrp::OrderListfrom above. - Instruct the
MapViewto highlight theLandmarkListfrom 2.) to print the orders, departures and destinations. - Create a
PolygonGeographicAreafrom theCoordinatesListand instruct theMapViewto center on it. - Create a
MarkerCollectionof typePolylinefor each route and add the routes shapes to them. - 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.

