This is an old revision of the document!

Optimize order execution

In order to use optimization while executing orders use order/optimize:

				       "pf":{<uint> || {JSON}},
				       "pt":{<uint> || {JSON}
			   "preference":{<uint>:<uint>,...} // DEPRECATED


Param Description
itemId resource id
orders optimized orders array (orders indexes/orders JSON delimited with comma)
warehouses warehouses array
flags optimization flags
gis gis settings
busyRoutes busy period, next index
tf busy period start time
tt busy period end time
pf busy period start location: order id or JSON
pt busy period end location: order id or JSON
provider maps source: 0 - none, 1 - Gurtam Maps(default), 2 - Google
mode transport: driving, walking, bicycling or transit (only for google provider)
avoid restrictions to the route: tolls, highways, ferries and/or indoor (only for google provider)
departure_time desired time of departure (only for google provider)
traffic_model assumptions: best_guess, pessimistic or optimistic (only for google provider)
transit_mode preferred modes: bus, subway, train, tram and/or rail (only for google provider)
transit_routing_preference preferences for transit requests (only for google provider)
addPoints return track in response: 1 - yes, 0 - no
speed speed for optimization, km/h(60 on default)
units units array
priority order of orders: {unit index:{order index:expected index of order in a route}} (index equal to -1 will fix this order as last in a route)
criterions route completion criterions:
max_mileage - maximum mileage, m;
max_duration - maximum duration, sec;
max_order_count - maximum orders count;
max_idling - maximum idle time between orders, sec;
split_intervals - if 1, then split based on intervals
(if the execution time of the order with unloading and moving, misses the next order time interval)
preference order priority in route

:!: JSON format is the same as in Update order request.

:!: More about Google provider settings.


Flag Description
0x1 optimize by order schedule (order tf и tt params are used)
0x2 optimize by all orders completion duration
0x20 optimization by carrying capacity(weight)
0x40 optimization by effective capacity(volume)
0x80 optimize only orders with tt > current time; if tf < current time, then tf = current time
If criterions are exceed:
0x100 order is terminated
0x200 added visit reload warehouse
0x300 route splited to several


	"1":{				/* 1st units optimization */
					"ml":<uint>,    /* mileage */
					"tm":<uint>,	/* time to visit order area */
					"id":<uint>	/* order index in array send in request (starts from 0)  */
					"ml":<uint>,    /* mileage */
					"tm":<uint>,	/* time to visit order area */
					"id":<uint>	/* order index in array send in request (starts from 0)  */
	"2":{				/* 2nd unit optimization (if stated unit number is greater than one) */
					"ml":<uint>,    /* mileage */
					"tm":<uint>,	/* time to visit order area */
					"id":<uint>	/* order index in array send in request (starts from 0)  */
					"ml":<uint>,    /* mileage */
					"tm":<uint>,	/* time to visit order area */
					"id":<uint>	/* order index in array send in request (starts from 0)  */
	...,				/* other unit number optimization (if more than two units optimization stated) */
	"success":<bool>		/* optimization status: 
                                          1 - success (there is solution to meet all requirements),
                                          0 - failed */

:!: If only warehouse orders were assigned to unit(0x4 flag) - it will not appear in the response.
:!: If route splited to several, it will be routes array in the response.

Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon   |   Copyright © 2002-2020 Gurtam