cancel
Showing results for 
Search instead for 
Did you mean: 

Moving parts with batch loop

Builder
Builder

Hello everyone

 

I am trying to write a method to move parts from store using a batch loop as follows.

 

for n:=1 to 2*.batchSize loop
for i:=1 to supermarket.Xdim loop
for j:=1 to supermarket.Ydim loop
if Supermarket.pe(i,j).cont /=void and Supermarket.pe(i,j).cont.name="Main_frame_red" then
Supermarket.pe(i,j).cont.move(.models.life_3.parts_finishing.main_frame);


.Models.LIFE_3.modules_stock[1,"main_frame_red"]:=.Models.LIFe_3.modules_stock[1,"Main_frame_red"]-1
exitloop;
end;
next;
next;
next;

 

here first loop (batch size loop)  describes the batch size, a global variable as Batch size (value 3).

second and third loops represents the x and y dimensions of the store(supermarket).

 

I wanted to move 6 parts with name "main_frame_red" by considering 2 times batch size, but it is moving too many parts.

 

Could anyone help me where i am doing wrong. is this program works as i intended or not. 

 

Thank you

 

best regards

3 REPLIES

Re: Moving parts with batch loop

Phenom
Phenom

exitLoop terminates only one loop; try

 

exitLoop 2;

 

instead. This will terminate the two inner loops.

 

 

 

 


Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net


Re: Moving parts with batch loop

Builder
Builder

Thank you very much steffen

 

I tried and it some what helped me, but i am not getting enough parts to required destination.

Could you please have a look at my model.

 

I represent important objects with some colours in all the tabs.

 I call this method only once by "information flow" (method).

 

please ask me if anything is not clear

 

Thank you

 

best regards

Re: Moving parts with batch loop

Phenom
Phenom
sorry, but I cannot look into your method, because you are working with a non commercial license

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net