I have a small doubt regarding batch size produced by Source.
My source produces Mu's in a table file based on the quantity mentioned earlier. But at the start of the simulation i want to specify a batch size, so that Mu's quantity in a table file should be multiplied by Batch size
for example ,initially Mu.a has a quantity 1 (if batch size is 1) then if i mention Batch size as 2 then it should show quantity 2 in a table file.
Could you please help How to implement that?
My idea is this one.
I will take global varible n and consider it's value batch number.(value is 2 then batch 2 and so on).
then i want to write init method that if global variable value is 2 then table file should be multiplied by 2.
I don't know how to write a program and whether it's a good ideaor not.
Could anyone help me please
Solved! Go to Solution.
first you need to extend your MU-selection table. You need a column 5 for the base quantity (right mouse click on the table --> attributes and methods --> attribute maxXDim --> double click --> 5).
Than you can use the init-method to change the quantity. Insert the base quantity into the column 5.
Than you can use a loop to calculate the quantity from the base quantity in column 5 and a global variable (globVar):
for local i:=1 to yourTable.YDim loop
Now you can use globVar e.g. in the ExperimentManager to organize your experiments.
Thank you very much Steffen for your continuous help.
I have one more problem with my model which i attached below.
I have locked the source after producing 41 parts but still it is moving parts after 41.
Actually in my model if store don't have enough parts then the exit locked of source is false (method S_market), but after producing 41 parts exit locked is true (in entrance control of source).
As the store calls the method several times in my model i couldn't able to lock the source and it is moving parts even after 41 parts.
How can i lock exactly for 41 parts, could you Help me please.
Sorry for bad explanation, I have marked the methods in red in my model. please have a look at it.
I cannot see the content of the method S_marked, but you need to check there also the condition of the method source_numOut to stop the source after 41 parts.
Take also into account, that the statistics will be reset after the time you set in the eventController (e.g. statNumOut of the source will be re-set to zero), so maybe you need a additional counter (global variable), e.g. exit control rear of the source.
Thank you Steffen
the following is the content of S_market method.
Yes as you said there is a condition for the exit unlocking of source in this method. But as it is keeps on calling S_market the source exit always unlock, but the source should not produce after 41 parts and it is producing now more.
You could see the condition at the end of the program.
Is there any other possibility to solve it?
for i:=1 to Supermarket.xdim loop
for k:=1 to Supermarket.ydim loop
if Supermarket.pe(i,k).cont /=void and Supermarket.pe(i,k).cont.name="Lower_Hfshell_red" then
elseif Supermarket.pe(i,k).cont /=void and Supermarket.pe(i,k).cont.name="Anchor_finis_220_72
--reduce the Module_inventory
--reorder, if Module_inventory is below 3
if Module_inventory[1,"lower_hfshell_red"] <3 then