Ir al contenido principal
Uso de Optimizador por API
Carlos Zambrano avatar
Escrito por Carlos Zambrano
Actualizado hace más de 3 años

En este artículo encontrarás recomendaciones sobre cómo utilizar nuestro optimizador por API para operaciones nocturnas (comenzando antes de las 23:59 y continuando después de las 00:00 del día siguiente).

Se debe enviar la estructura json de la siguiente manera:

  • Ingresar la información de la ventana horaria como "arrayOfTimeWindows", dentro de la información de la visita, por ejemplo: "arrayOfTimeWindows": [["23:59", "26:00"]. Ponemos 24:30h porque serían 24h (a las 0:00) + 2 horas. No es necesario colocar los campos “window_start” e “window_end”.

  • Enviar al final, en las opciones de ruteo: "longRoutes": true.

  • (Opcional) Colocar el horario de trabajo del vehículo como: "shift_start": "21:00", "shift_end": "29:00". Ponemos “29:00” porque sería 24h (a las 0:00) + 5 horas.

Ejemplo:

{

"vehicles": [

{

"ident": "241381",

"location_start": {

"ident": "vehicle-start-241381",

"lat": -33.370969,

"lon": -70.648726

},

"location_end": {

"ident": "vehicle-end-241381",

"lat": -33.370969,

"lon": -70.648726

},

"capacity": 85,

"capacity_2": 1,

"capacity_3": 1,

"shift_start": "21:00",

"shift_end": "29:00",

"skills": [37869],

"refill": 60,

"zones": [],

"cost": null,

"min_load": 0,

"min_load_2": 0,

"min_load_3": 0

}

],

"nodes": [

{

"ident": "d718f93a-1a2d-0e44-650a-2d7640ed3d57",

"group": [

"d718f93a-1a2d-0e44-650a-2d7640ed3d57"

],

"group_id": null,

"address": "SANTA MARIA 2670, PROVIDENCIA, Santiago",

"lat": -33.416713,

"lon": -70.609643,

"duration": 20,

"load": 1,

"load_2": 0,

"load_3": 0,

"window_start": "00:00",

"window_end": "23:59",

"window_start_2": "23:59",

"window_end_2": "23:59",

"programmedDate": "",

"cluster": 0,

"skills_required": [],

"skills_optional": [],

"priority_level": 0,

"zones": [],

"arrayOfTimeWindows": [["23:59","24:30"]],

"pickLoad": 0,

"pickLoad_2": 0,

"pickLoad_3": 0

},

{

"ident": "485d6d5e-0e08-bf58-1c3c-8adbf669166a",

"group": [

"485d6d5e-0e08-bf58-1c3c-8adbf669166a"

],

"group_id": null,

"address": "MARTIN DE ZAMORA 2964, LAS CONDES, Santiago",

"lat": -33.424343,

"lon": -70.592236,

"duration": 10,

"load": 1,

"load_2": 0,

"load_3": 0,

"window_start": "00:00",

"window_end": "23:59",

"window_start_2": "23:59",

"window_end_2": "23:59",

"programmedDate": "",

"cluster": 0,

"skills_required": [],

"skills_optional": [],

"priority_level": 0,

"zones": [],

"arrayOfTimeWindows": ["23:59","24:30"],

"pickLoad": 0,

"pickLoad_2": 0,

"pickLoad_3": 0

},

{

"ident": "dc07554a-5f6b-aac6-4c7d-5462079abff6",

"group": [

"dc07554a-5f6b-aac6-4c7d-5462079abff6"

],

"group_id": null,

"address": "PRESIDENTE RIESCO 5561, LAS CONDES, Santiago",

"lat": -33.404727,

"lon": -70.574135,

"duration": 15,

"load": 1,

"load_2": 0,

"load_3": 0,

"window_start": "00:00",

"window_end": "23:59",

"window_start_2": "23:59",

"window_end_2": "23:59",

"programmedDate": "",

"cluster": 0,

"skills_required": [],

"skills_optional": [],

"priority_level": 0,

"zones": [],

"arrayOfTimeWindows": [],

"pickLoad": 0,

"pickLoad_2": 0,

"pickLoad_3": 0

},

{

"ident": "2c051a0b-2e2b-ed59-4869-1f2ee3b8ea68",

"group": [

"2c051a0b-2e2b-ed59-4869-1f2ee3b8ea68"

],

"group_id": null,

"address": "ANDRES BELLO 2711, LAS CONDES, Santiago",

"lat": -33.415076,

"lon": -70.605321,

"duration": 15,

"load": 1,

"load_2": 0,

"load_3": 0,

"window_start": "00:00",

"window_end": "23:59",

"window_start_2": "23:59",

"window_end_2": "23:59",

"programmedDate": "",

"cluster": 0,

"skills_required": [],

"skills_optional": [],

"priority_level": 0,

"zones": [],

"arrayOfTimeWindows": [],

"pickLoad": 0,

"pickLoad_2": 0,

"pickLoad_3": 0

}

],

"balance": false,

"single_tour": true,

"beauty": false,

"use_euclidean_distance": false,

"country": "CL",

"longRoutes": true,

"enable_graphs": false,

"auto_reorder": false,

"intensive_intra": false,

"open_routes_logic": true,

}

¿Ha quedado contestada tu pregunta?