public void ExecuteOrder(ProblemDescription description, int i, List <Command> commands)
        {
            var order = description.Orders[i];

            description.Orders.RemoveAt(i);
            var orderProductsAux = new Dictionary <int, int>(order.orderedProducts);

            var warehouseList = FindBestPath(order, description);

            foreach (int idWarehouse in warehouseList)
            {
                foreach (int idProd in order.orderedProducts.Keys.ToList())
                {
                    if (order.orderedProducts[idProd] == 0)
                    {
                        continue;
                    }

                    if (idProd >= description.Warehouses[idWarehouse].heldProducts.Count)
                    {
                        continue;
                    }
                    if (description.Warehouses[idWarehouse].heldProducts[idProd] > 0)
                    {
                        int ammountToRetrieve = Math.Min(order.orderedProducts[idProd], description.Warehouses[idWarehouse].heldProducts[idProd]);

                        description.Warehouses[idWarehouse].heldProducts[idProd] -= ammountToRetrieve; //remove from available on wh
                        order.orderedProducts[idProd] -= ammountToRetrieve;                            //remove from order

                        LoadCommand command = new LoadCommand();
                        command.DroneId       = Id;
                        command.WarehouseId   = idWarehouse;
                        command.ProductId     = idProd;
                        command.ProductAmount = ammountToRetrieve;
                        commands.Add(command);
                    }
                    TurnsToNextAction += DistanceCalculator.CalculateDistance(NextPosition, description.Warehouses[idWarehouse].position) + 1;
                    NextPosition       = description.Warehouses[idWarehouse].position;
                }
            }
            foreach (int idProd in orderProductsAux.Keys)
            {
                if (orderProductsAux[idProd] == 0)
                {
                    continue;
                }
                var command = new DeliverCommand();
                command.DroneId       = Id;
                command.CustomerId    = order.RealId;
                command.ProductId     = idProd;
                command.ProductAmount = orderProductsAux[idProd];
                commands.Add(command);
                TurnsToNextAction += DistanceCalculator.CalculateDistance(NextPosition, order.position) + 1;
                NextPosition       = order.position;
            }
        }
        public void ExecuteOrder(ProblemDescription description, int i, List<Command> commands)
        {
            var order = description.Orders[i];
            description.Orders.RemoveAt(i);
            var orderProductsAux = new Dictionary<int,int>(order.orderedProducts);

            var warehouseList = FindBestPath(order, description);

            foreach (int idWarehouse in warehouseList)
            {
                foreach(int idProd in order.orderedProducts.Keys.ToList()) {
                    if (order.orderedProducts[idProd] == 0) continue;

                    if (idProd >= description.Warehouses[idWarehouse].heldProducts.Count) continue;
                    if (description.Warehouses[idWarehouse].heldProducts[idProd] > 0)
                    {
                        int ammountToRetrieve = Math.Min(order.orderedProducts[idProd], description.Warehouses[idWarehouse].heldProducts[idProd]);

                        description.Warehouses[idWarehouse].heldProducts[idProd] -= ammountToRetrieve; //remove from available on wh
                        order.orderedProducts[idProd] -= ammountToRetrieve; //remove from order

                        LoadCommand command = new LoadCommand();
                        command.DroneId = Id;
                        command.WarehouseId = idWarehouse;
                        command.ProductId = idProd;
                        command.ProductAmount = ammountToRetrieve;
                        commands.Add(command);
                    }
                    TurnsToNextAction += DistanceCalculator.CalculateDistance(NextPosition, description.Warehouses[idWarehouse].position) + 1;
                    NextPosition = description.Warehouses[idWarehouse].position;
                }
            }
            foreach(int idProd in orderProductsAux.Keys)
            {
                if (orderProductsAux[idProd] == 0) continue;
                var command = new DeliverCommand();
                command.DroneId = Id;
                command.CustomerId = order.RealId;
                command.ProductId = idProd;
                command.ProductAmount = orderProductsAux[idProd];
                commands.Add(command);
                TurnsToNextAction += DistanceCalculator.CalculateDistance(NextPosition, order.position) + 1;
                NextPosition = order.position;
            }
        }