This example app demonstrates the following features:
- Add an optimization with a single vehicle with different departure and destination locations and display the solution on the map.
In this optimization the orders are visited using only one vehicle which starts its route at one location and ends it at another location.
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 route type to beRT_CustomEnd. - Create a
vrp::Optimizationand set the objects created at 1.) and 2.) to it. Also set the departure from which the vehicle will start its route and the destination where it will end the route. - Create a
ProgressListener,vrp::Service, and avrp::Requestthat will be used for tracking 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 status of the associated request. Once it reaches a finished state, 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.

