Open edwin716 opened 3 years ago
What is your getstatus()! How do you decide the value of the status? Seems like your canQueue is wrong.
hi, the problem could be your implementation of maximum queue length? because the server 3 should have a queue length of more than 1 which would allow both customers 2 and 3 the queue at the same time, but for yours after customer 2 joins the queue, customer 3 can no longer join and hence leaves instead!
actually if your canQueue is correct i don't think you would need the hasNoWaitingCustomer condition anymore
May be you can try printing out the Servers in the Shop and their queue (how many people / who is queueing). Then from there you can trace back what went wrong. it could be the find method/ the getStatus() method
yup, like what someone else suggested canQueue should be able to cover hasNoWaitingCustomer. printing out the servers and their queue lengths will help a lot in tracing! you might be updating the servers wrongly such that it doesn't find anything that canQueue
One other point you can look at would be the way you implement WaitEvent and whether you made sure you have actually added Customer 2 into the queue so that when you do y.getQueueLength() the changes is reflected
Description
Hi, I'm facing this issue whereby the customer leaves instead of waiting. I believe it has to be smth wrong with my ArriveEvent but can't seem to find the issue. Would appreciate any inputs thanks!
Screenshots (if any):