This example app demonstrates the following features:
- Add an optimization with orders that have all the fields set and display the solution on the map.
Create an optimization where for each order can be set:
- the descriptive fields:
- name
- address
- phone number
- the restrictive fields:
- the type: pick up or delivery
- the number of pieces, weight, and cube that have to be picked-up from it or delivered at it
- the service time: how much time does the vehicle stay at this order to do its job (ex: to unload the pieces)
- the time window within which the order must be visited
- the revenue which has to be received from this order
When you run the example app, an optimization will be saved, the solution will be returned and showed on map.
- Create a
vrp::Orderfor each order that has to be visited, set its fields, and then add it into avrp::OrderList. - Create a
vrp::Optimizationand set the list created at 1.) 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 3.), thevrp::Optimizationfrom 2.), 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.

