Dear community members,
I'm trying to build a model where customers take autonomously the wanted parts from a store and, when there are no parts, the customer waits until the parts are available.
Here is the code
is i:integer; k:integer; do k:= wantstable.ydim; if wantstableQuantity<storeCheeseburger.numMU then waituntil wantstableQuantity = storeCheeseburger.numMU prio 1; for i:=1 to wantstable[2,k] loop storeCheeseburger.cont.move(@); .mus.entity.create(Buffer1); next; else for i:=1 to wantstable[2,k] loop storeCheeseburger.cont.move(@); .mus.entity.create(Buffer1); next; end; end;
Actually the method dosn't stop when the number of products is lower than the required number. Attached you can find the model.
Can you see any mistake?
Solved! Go to Solution.
I made the change but it still doesn't work.
More in details:
- when the requested quantity exceeds the quantity in stock, the customer doesn't stop and leaves through the drain
- when the requested quantity is lower than the quantity in stock, the sotware gives me the following error message: "destination must be a material flow object, or a place on such an object, or the index of a succeeding object"
you cannot connect the buffer of the customer with the drain. If the customer has to wait, he runs through the buffer and will be destroyed in the drain. In the mean time perhaps a new customer arrives or no customer is present, if the method moves the burger (so the error is shown).
Set the capacity of the customer-buffer to 1, delete the connector to the drain, add at the end of the loadOpeator method:
Increase the number of burges to create in the init-method, then it runs.
I also have simplyfied your loadOperator method.
freelance simulation specialist