Exemplo n.º 1
0
        internal Pickings(Warehouse w, int wishSize)
        {
            int nbBlock          = w.NbBlock;
            int nbAisles         = w.NbAisles;
            int aisleLenght      = w.AisleLenght;
            int nbProductMax     = nbBlock * nbAisles * aisleLenght;
            int nbProductByBlock = nbAisles * aisleLenght;
            var wishList         = new HashSet <PickingPos>();
            var rnd = new Random();

            for (var i = 0; i < wishSize; i++)
            {
                int wishIdx   = rnd.Next(1, nbProductMax + 1);
                int blockIdx  = (wishIdx - 1) / nbProductByBlock + 1;
                int temp      = wishIdx - (blockIdx - 1) * nbProductByBlock;
                int aislesIdx = (temp - 1) / aisleLenght + 1;
                temp = temp - (aislesIdx - 1) * aisleLenght;
                int positionIdx = temp;
                var wish        = new PickingPos(wishIdx, blockIdx, aislesIdx, positionIdx, aisleLenght, nbBlock);
                wishList.Add(wish);
            }
            PickingList = wishList.OrderBy(x => x.WishIdx).ToList();
        }
Exemplo n.º 2
0
 internal static ShiftPoint ConverToShiftPoint(this PickingPos c)
 {
     return(new ShiftPoint(c.PickingPointX, c.PickingPointY));
 }