Cancel
Showing results for 
Search instead for 
Did you mean: 

customer waiting when a requested products is not available

Valued Contributor
Valued Contributor

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?

4 REPLIES

Re: customer waiting when a requested products is not available

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor
The lower than symbol u are using in your method must be a higher than

" if wantstableQuantity > storeCheeseburger.numMU
then "

After you change this then your method works as you expect but will need debugging.

You are not producing enough burgers and your new customer will come and overwrite your table... so work on it a bit more.
cortega@interlatin.com.mx
+52 (81) 10801310
InterLatin S de RL de CV

Re: customer waiting when a requested products is not available

Valued Contributor
Valued Contributor

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"

Re: customer waiting when a requested products is not available

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

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:

 

@.move(drain);

 

Increase the number of burges to create in the init-method, then it runs.

 

I also have simplyfied your loadOperator method.

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

Re: customer waiting when a requested products is not available

Valued Contributor
Valued Contributor

Clrear! Thank you for your help.