in my model the incoming parts are stored in a warehouse. To detect a free place I used methods which I called getfreeplace as attributes of the warehouse. For each different part there is one getfreeplace method which looks as follows:
(byRef x,y:integer):boolean is i:integer; k:integer; do if self.~.full then return false; else i := 7; for k := 1 to self.~.yDim loop if self.~.pe(i,k).empty then --save coords into parameters x:=i; y:=k; exitloop; end; next; return true; end; end;
The parts are then drawn out of the warehouse by the method Lager_Ausgang:
is x:integer; y:integer; part:string; found:boolean; do --look for the next partName in the cycleTable part:=Zyklustabelle[1,Zyklustabelle.position]; --look for the part in the stock of the warehouse Lagertabelle.setCursor(1,1); found:=Lagertabelle.find(part); if found and Puffer3.full=false then -- read coords from stock x:=Lagertabelle["X",Lagertabelle.cursorY]; y:=Lagertabelle["Y",Lagertabelle.cursorY]; --delete row in the stock-table Lagertabelle.cutRow(Lagertabelle.cursorY); -- increase position in cycle if Zyklustabelle.position = Zyklustabelle.YDim then Zyklustabelle.position:=1; else Zyklustabelle.position:=Zyklustabelle.position+1; end; Lager.pe(x,y).cont.move(Puffer3); end; end;
The warehouse has a capacity of 5000 parts (5 different parts --> 1000 store places for each part). Incoming parts are stored in the table "Lagertabelle" and outgoing parts are deleted from that table.
What happens in the model now is that when k=1000 of the method getfreeplace is reached the simulation stops after 334 days with the bug call: "A 'Void' can not receive the method 'empty'". The problem is that the parameter y is set as 0, so no real space in the warehouse is targeted.
My question now is: Why does this happen? As I understand the method it shall look from k=1 to k=1000 for every incoming part. When you look at the table "Lagertabelle" after 334 days you can see that when the simulation stops the warehouse is not full. There are about 500 parts of the part called "Elektrik". Nonetheless the method doesn't try to store the new parts in k=1 or other free places but in k=1000 which leads to the bug.
Can you help me with this problem? I have attached the model for you to see what I mean.
Solved! Go to Solution.
freelance simulation specialist