I am weak in programming and need help with sample methods.
my model has two store objects(1-finished WH, 2-sub Assembly WH).
At first if finished Wh has a part 'A' and when it is less than 3, then it has to call the another method (method of Sub assemblyWH)
In that method, if Sub assembly Wh has a part B and when it is equal to 3 it should move to required successor, when it is less than 3 then it has to reset the respective source so that it can supply parts to it.
Could anyone help me how can i write program for this logic and how can i call these methods whenever required
Thanks in advance
Solved! Go to Solution.
Thank you Mr.Steffen
I have added Inventory tables to stores.
Actually i want start the simulation from backwards. i wrote the logics as a comment in my model attached below.
the source should start when it receives information from Supermarket in the model.
my idea is that i want write an INIT method to check PlantWh first then Simulation executes the logics backwards
One more question, how can write a method as a Exit control of store. because there is no exit control in store tab
Thank you very much Mr.steffen
I want to write the method in the following way, please correct me.
I have locked all the sources at first with first Init method (source.exitlocked:=true).
the next init method starts as follows
Init method :
if plant_WH.numMU <3 then
Then the method (S_Market) is as follows which i don't know how to write exactly.
for i:=1 to store.xdim loop
for k:=1 to store.ydim loop
if store.pe(i,k).cont /=void and Store.pe(i,k).cont.name="Lower_Hfshell_red" and then
elseif store.pe(i,k).cont.name="lower_hfshell_red" <3 then
As i don't know the exact syntax, could you please help me in writing this
Thank you very much
if you want to move one Lower_Hfshell_red and reorder, if the inventory is below 3, this may help (I use the inventory):
is i:integer; k:integer; do for i:=1 to store.xdim loop for k:=1 to store.ydim loop if store.pe(i,k).cont /=void and Store.pe(i,k).cont.name="Lower_Hfshell_red" then store.pe(i,k).cont.move(Motor_Assembly); --reduce the inventory inventory[1,"lower_hfshell_red"]:= inventory[1,"lower_hfshell_red"]-1; exitLoop 2; end; next; next; --reorder, if inventory is below 3 if inventory[1,"lower_hfshell_red"] <3 then Source.exitlocked:=false; end; end;
Remark: you cannot move parts directly to the assemblyStation (this is possible from version 13), so you will get a error message
Hello Mr. Steffen
I am getting an error message " the max depth of Calls was exceeded".
But my Init method only calls other method once.
I have changed Max depth calls (model settings-- simulation), but still it is showing the same message.
Is there any solution for this?
Thank you very much