Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test case 4_3 #376

Open
xxianhuii opened this issue Apr 26, 2021 · 6 comments
Open

test case 4_3 #376

xxianhuii opened this issue Apr 26, 2021 · 6 comments

Comments

@xxianhuii
Copy link

Summary

I am unable to pass test case 4_3 because customer waits at the wrong server which leads to subsequent errors.

Description

As mentioned above, customer waits at wrong server number despite code passing level 3. Is there any thing that i should take note of?

Screenshots (if any):

Screenshot 2021-04-27 at 2 01 56 AM

@ryanlml
Copy link

ryanlml commented Apr 26, 2021

Hi! I've had this issue, which I realised was because I removed a customer from the queue immediately at done event. If you dequeue too early, customers that come in during the rest time may join the queue instead of leaving.

@somenobody98
Copy link

Hi! I've had this issue, which I realised was because I removed a customer from the queue immediately at done event. If you dequeue too early, customers that come in during the rest time may join the queue instead of leaving.

Yup this was my issue too, one way of doing it is to create another event that helps to delay the removal of the next customer of the queue until the server has finish resting.

@ErMingYong
Copy link

The issue stems from the server accepting a customer when it is resting. Hence, the problem lies with the queueing of customers for the server itself.
I circumvented this by creating an intermediate class between my Done and Rest events to have a period where the server is resting only, and after it has rest finish, it will then proceed to the next customer. Hence, stimulating the server not accepting customer even when it is resting

@vishandi
Copy link

I got this issue as well. In my case that is because I do not mark the Server currently Serving as unavailable, so the queue is messed up and when customer 14 comes he goes to Server 1, in which the queue should be full. If you want to construct the input for this particular test case, you can retrieve the info you needed from sample test case 3 of level 5 in the problem statement and try it using Main4. My friend told me this and although I do not guarantee the hidden test use the exact same input, after passing that constructed input I passes the hidden test. Good luck!

@Herrekt
Copy link

Herrekt commented Apr 28, 2021

I had this problem too. Mine was reducing the queue length when the server is done even though it was resting. I addressed it by creating another event for server resting, where it will only dequeue after the rest time is completed.

@JWulaXia
Copy link

i also encounter this issue, this is because the queue can take in new customer regardless of whether the server is at rest. However, the server can only serve the next customer once it done resting. So I think you need to check which queue still got place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants