Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.    // Esta es la lista de clusters para que luego puedas deshacer
  3.    // la agregación. Contiene una lista de clusters agregados por
  4.    // código postal, y cada uno de ellos contiene la lista de notas
  5.    // asignadas al código postal.
  6.    "clusters":[
  7.       {
  8.          "services":[
  9.             {
  10.                "client_id":"000004",
  11.                "client_name":"LAS CIES",
  12.                "lat":40.3370553,
  13.                "lng":-3.7500909,
  14.                "timewindows":[
  15.                   [
  16.                      33300,
  17.                      36000
  18.                   ]
  19.                ],
  20.                "duration":243,
  21.                "zip_code":28915,
  22.                "zone":63
  23.             }
  24.          ],
  25.          "zipcode":28915,
  26.          "timewindows":[
  27.             [
  28.                33300,
  29.                37800
  30.             ]
  31.          ],
  32.          "name":"28915",
  33.          "n_services":1,
  34.          "duration":243.0,
  35.          "location":{
  36.             "lat":40.3370553,
  37.             "lng":-3.7500909
  38.          }
  39.       },
  40.       {
  41.          "services":[
  42.             {
  43.                "client_id":"000006",
  44.                "client_name":"CAFETERIA EL RINCON DE BLAS",
  45.                "lat":40.477907,
  46.                "lng":-3.670319,
  47.                "timewindows":[
  48.  
  49.                ],
  50.                "duration":null,
  51.                "zip_code":28033,
  52.                "zone":33
  53.             }
  54.          ],
  55.          "zipcode":28033,
  56.          "name":"28033",
  57.          "n_services":1,
  58.          "duration":300.0,
  59.          "location":{
  60.             "lat":40.477907,
  61.             "lng":-3.670319
  62.          }
  63.       },
  64.       {
  65.          "services":[
  66.             {
  67.                "client_id":"000008",
  68.                "client_name":"LOS GIRASOLES",
  69.                "lat":40.428762,
  70.                "lng":-3.677837,
  71.                "timewindows":[
  72.                   [
  73.                      25200,
  74.                      26100
  75.                   ]
  76.                ],
  77.                "duration":110,
  78.                "zip_code":28001,
  79.                "zone":1
  80.             }
  81.          ],
  82.          "zipcode":28001,
  83.          "timewindows":[
  84.             [
  85.                25200,
  86.                27900
  87.             ]
  88.          ],
  89.          "name":"28001-0",
  90.          "n_services":1,
  91.          "duration":110.0,
  92.          "location":{
  93.             "lat":40.428762,
  94.             "lng":-3.677837
  95.          }
  96.       },
  97.       {
  98.          "services":[
  99.             {
  100.                "client_id":"000023",
  101.                "client_name":"CAF. CAYBU",
  102.                "lat":40.4279001,
  103.                "lng":-3.6884119,
  104.                "timewindows":[
  105.                   [
  106.                      36900,
  107.                      39600
  108.                   ]
  109.                ],
  110.                "duration":345,
  111.                "zip_code":28001,
  112.                "zone":1
  113.             }
  114.          ],
  115.          "zipcode":28001,
  116.          "timewindows":[
  117.             [
  118.                36900,
  119.                41400
  120.             ]
  121.          ],
  122.          "name":"28001-1",
  123.          "n_services":1,
  124.          "duration":345.0,
  125.          "location":{
  126.             "lat":40.4279001,
  127.             "lng":-3.6884119
  128.          }
  129.       },
  130.       {
  131.          "services":[
  132.             {
  133.                "client_id":"000018",
  134.                "client_name":"CASA PACO",
  135.                "lat":40.430376,
  136.                "lng":-3.720342,
  137.                "timewindows":[
  138.                   [
  139.                      23400,
  140.                      27000
  141.                   ]
  142.                ],
  143.                "duration":437,
  144.                "zip_code":28008,
  145.                "zone":8
  146.             },
  147.             {
  148.                "client_id":"000020",
  149.                "client_name":"LA CITE",
  150.                "lat":40.432732,
  151.                "lng":-3.733541,
  152.                "timewindows":[
  153.                   [
  154.                      32400,
  155.                      42300
  156.                   ],
  157.                   [
  158.                      45000,
  159.                      46800
  160.                   ],
  161.                   [
  162.                      54000,
  163.                      54900
  164.                   ],
  165.                   [
  166.                      59400,
  167.                      60300
  168.                   ]
  169.                ],
  170.                "duration":544,
  171.                "zip_code":28008,
  172.                "zone":8
  173.             }
  174.          ],
  175.          "zipcode":28008,
  176.          "timewindows":[
  177.             [
  178.                23400,
  179.                48600
  180.             ]
  181.          ],
  182.          "name":"28008-0",
  183.          "n_services":2,
  184.          "duration":490.5,
  185.          "location":{
  186.             "lat":40.431554000000006,
  187.             "lng":-3.7269415
  188.          }
  189.       },
  190.       {
  191.          "services":[
  192.             {
  193.                "client_id":"000019",
  194.                "client_name":"LA CARPA",
  195.                "lat":40.412445,
  196.                "lng":-3.7038458,
  197.                "timewindows":[
  198.                   [
  199.                      32400,
  200.                      34200
  201.                   ],
  202.                   [
  203.                      49500,
  204.                      55800
  205.                   ]
  206.                ],
  207.                "duration":185,
  208.                "zip_code":28012,
  209.                "zone":12
  210.             }
  211.          ],
  212.          "zipcode":28012,
  213.          "timewindows":[
  214.             [
  215.                32400,
  216.                36000
  217.             ]
  218.          ],
  219.          "name":"28012-0",
  220.          "n_services":1,
  221.          "duration":185.0,
  222.          "location":{
  223.             "lat":40.412445,
  224.             "lng":-3.7038458
  225.          }
  226.       },
  227.       {
  228.          "services":[
  229.             {
  230.                "client_id":"000034",
  231.                "client_name":"MARISQUERIA LUIS",
  232.                "lat":40.436208,
  233.                "lng":-3.672229,
  234.                "timewindows":[
  235.                   [
  236.                      52200,
  237.                      54000
  238.                   ]
  239.                ],
  240.                "duration":354,
  241.                "zip_code":28028,
  242.                "zone":28
  243.             }
  244.          ],
  245.          "zipcode":28028,
  246.          "timewindows":[
  247.             [
  248.                52200,
  249.                55800
  250.             ]
  251.          ],
  252.          "name":"28028",
  253.          "n_services":1,
  254.          "duration":354.0,
  255.          "location":{
  256.             "lat":40.436208,
  257.             "lng":-3.672229
  258.          }
  259.       },
  260.       {
  261.          "services":[
  262.             {
  263.                "client_id":"000036",
  264.                "client_name":"TABERNA ARANZAZU",
  265.                "lat":40.4386596,
  266.                "lng":-3.6785672,
  267.                "timewindows":[
  268.                   [
  269.                      27000,
  270.                      28800
  271.                   ],
  272.                   [
  273.                      29700,
  274.                      34200
  275.                   ],
  276.                   [
  277.                      36000,
  278.                      37800
  279.                   ],
  280.                   [
  281.                      55800,
  282.                      56700
  283.                   ]
  284.                ],
  285.                "duration":299,
  286.                "zip_code":28002,
  287.                "zone":2
  288.             },
  289.             {
  290.                "client_id":"000071",
  291.                "client_name":"ROSCANI",
  292.                "lat":40.4439497,
  293.                "lng":-3.6716896,
  294.                "timewindows":[
  295.                   [
  296.                      33300,
  297.                      34200
  298.                   ],
  299.                   [
  300.                      36000,
  301.                      37800
  302.                   ]
  303.                ],
  304.                "duration":208,
  305.                "zip_code":28002,
  306.                "zone":2
  307.             }
  308.          ],
  309.          "zipcode":28002,
  310.          "timewindows":[
  311.             [
  312.                27000,
  313.                39600
  314.             ]
  315.          ],
  316.          "name":"28002-0",
  317.          "n_services":2,
  318.          "duration":253.5,
  319.          "location":{
  320.             "lat":40.44130465,
  321.             "lng":-3.6751284
  322.          }
  323.       },
  324.       {
  325.          "services":[
  326.             {
  327.                "client_id":"000050",
  328.                "client_name":"LA CARTA DE RAST",
  329.                "lat":40.4363341,
  330.                "lng":-3.620528,
  331.                "timewindows":[
  332.                   [
  333.                      26100,
  334.                      27900
  335.                   ]
  336.                ],
  337.                "duration":382,
  338.                "zip_code":28037,
  339.                "zone":37
  340.             }
  341.          ],
  342.          "zipcode":28037,
  343.          "timewindows":[
  344.             [
  345.                26100,
  346.                29700
  347.             ]
  348.          ],
  349.          "name":"28037",
  350.          "n_services":1,
  351.          "duration":382.0,
  352.          "location":{
  353.             "lat":40.4363341,
  354.             "lng":-3.620528
  355.          }
  356.       }
  357.    ],
  358.    // Esta es la lista de servicios que tienes que enviar a optimizar, ya las
  359.    // he puesto en el formato correcto para que puedas enviarlo sin tener que
  360.    // realizar ninguna modificación
  361.    "clusters_as_services":[
  362.       {
  363.          "id":"28915",
  364.          "location":{
  365.             "lat":40.3370553,
  366.             "lng":-3.7500909
  367.          },
  368.          "duration":243,
  369.          "timewindows":[
  370.             [
  371.                33300,
  372.                37800
  373.             ]
  374.          ]
  375.       },
  376.       {
  377.          "id":"28033",
  378.          "location":{
  379.             "lat":40.477907,
  380.             "lng":-3.670319
  381.          },
  382.          "duration":300
  383.       },
  384.       {
  385.          "id":"28001-0",
  386.          "location":{
  387.             "lat":40.428762,
  388.             "lng":-3.677837
  389.          },
  390.          "duration":110,
  391.          "timewindows":[
  392.             [
  393.                25200,
  394.                27900
  395.             ]
  396.          ]
  397.       },
  398.       {
  399.          "id":"28001-1",
  400.          "location":{
  401.             "lat":40.4279001,
  402.             "lng":-3.6884119
  403.          },
  404.          "duration":345,
  405.          "timewindows":[
  406.             [
  407.                36900,
  408.                41400
  409.             ]
  410.          ]
  411.       },
  412.       {
  413.          "id":"28008-0",
  414.          "location":{
  415.             "lat":40.431554000000006,
  416.             "lng":-3.7269415
  417.          },
  418.          "duration":490,
  419.          "timewindows":[
  420.             [
  421.                23400,
  422.                48600
  423.             ]
  424.          ]
  425.       },
  426.       {
  427.          "id":"28012-0",
  428.          "location":{
  429.             "lat":40.412445,
  430.             "lng":-3.7038458
  431.          },
  432.          "duration":185,
  433.          "timewindows":[
  434.             [
  435.                32400,
  436.                36000
  437.             ]
  438.          ]
  439.       },
  440.       {
  441.          "id":"28028",
  442.          "location":{
  443.             "lat":40.436208,
  444.             "lng":-3.672229
  445.          },
  446.          "duration":354,
  447.          "timewindows":[
  448.             [
  449.                52200,
  450.                55800
  451.             ]
  452.          ]
  453.       },
  454.       {
  455.          "id":"28002-0",
  456.          "location":{
  457.             "lat":40.44130465,
  458.             "lng":-3.6751284
  459.          },
  460.          "duration":253,
  461.          "timewindows":[
  462.             [
  463.                27000,
  464.                39600
  465.             ]
  466.          ]
  467.       },
  468.       {
  469.          "id":"28037",
  470.          "location":{
  471.             "lat":40.4363341,
  472.             "lng":-3.620528
  473.          },
  474.          "duration":382,
  475.          "timewindows":[
  476.             [
  477.                26100,
  478.                29700
  479.             ]
  480.          ]
  481.       }
  482.    ],
  483.    "missing":[
  484.       "000005",
  485.       "000007"
  486.    ]
  487. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement