I am simulating part of the supply chain of a grocery retail chain for my master thesis.
I have the model up and running fine, except for one aspect.
The products in the stores are sold individually, but the distribution center is delivering the products in case packs.
This entails that the DC can only deliver the products in multiples of case packs.
For instance if the case pack is 4, they can only deliver 4, 8, 12.... etc products.
I can't seem to find how I should model this restriction in plant simulation, could someone please help me?
The loop I have now is;
So for Monday for store 1 it determines if the stock level of product 1 is at or below the re-order level, if that is the case, it moves the products from the DC to store 1 till the max shelf capacity (which is 60). This however does not incorporate the case pack restriction, does someone know how to incorporate this?
I've been thinking about adding a check to divide the difference between the stock level and the max shelf capacity and then round that number down to the lowest integer, and then multiply this number by the case pack size. But I have no idea how to model this correctly.
I would really appreciate the help.
Solved! Go to Solution.
I guess you could use the modulo to solve this. You could subtract the remainder of the integer division of the case pack size from the stock, like this:
is _time:datetime; i:integer; stock:integer; do _time:=eventController.absSimTime; if DayOfWeek(_time)=1 then if ~.Store_1.stock_level_1 <= ~.Store_1.Prod_1_must_order_level then -- subtract remainder of integer division stock:=(60 - ~.Store_1.Shelf_prod_1.numMu) -
((60-~.Store_1.Shelf_prod_1.numMu)\\casePackSize); for i:=1 to stock loop BufferProd_1.MU(1).move(~.Store_1.Inbound_Store1);. next; end; end; end;
You should parameterize the 60...
Dear Mr. Bangsow,
I have incorporated the case pack restriction as you suggested (see picture below).
The '60' is parameterized by 'Shelf1', 'Shelf 2' etc., the case pack size is parameterized by 'CaseSize_prod1' etc.
As you can see, plant simulation gives an error message; 'syntax error near line 10 at <;>'.
I can't seem to find the cause of this, because that <;> should really be there.
I would rather not send the model publically, as I am not sure which information might be confident.
But if you would like to have the model, because I can imagine it is easier for you to find the problem, I could send it to you.
I would really appreciate your help.
With kind regards,
is _time:datetime; i:integer; stock:integer; do _time:=eventController.absSimTime; if DayOfWeek(_time)=1 then if ~.Store_1.Shelf_prod_1.numMu <= ~.Store_1.Prod_1_must_order_level then stock:=(~.Store_1_Shelf1 - ~.Store_1.Shelf_prod_1.numMu) - (((~.Store_1_Shelf1 - ~.Store_1.Shelf_prod_1.numMu)\\CaseSize_prod1); for i:=1 to stock loop BufferProd_1.MU(1).move(~.Store_1.Inbound_Store1); next; end; if ~.Store_1.Shelf_prod_2.numMu <= ~.Store_1.Prod_2_must_order_level then stock:=(~.Store_1_Shelf2 - ~.Store_1.Shelf_prod_2.numMu) - (((~.Store_1_Shelf2 - ~.Store_1.Shelf_prod_2.numMu)\\CaseSize_prod2); for i:=1 to stock loop BufferProd_2.MU(1).move(~.Store_1.Inbound_Store1); next; end; if ~.Store_1.Shelf_prod_3.numMu <= ~.Store_1.Prod_3_must_order_level then stock:=(~.Store_1_Shelf3 - ~.Store_1.Shelf_prod_3.numMu) - (((~.Store_1_Shelf3 - ~.Store_1.Shelf_prod_3.numMu)\\CaseSize_prod3); for i:=1 to stock loop BufferProd_3.MU(1).move(~.Store_1.Inbound_Store1); next; end; -- The next delivery day starts (in this case Wednesday). elseif DayofWeek(_time)=3 then