-
Notifications
You must be signed in to change notification settings - Fork 0
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
Issue: Lab 08 Fail Test Case: 9_17 #342
Comments
considering how you passed all other test cases preceding it, I doubt its from your event comparator. I think it might be where you actually "add" the event into PQ. |
Does your event comparator include checks for if event timings happen to be the same? For me, if events happen at the same time, then the event with smaller customer number will be popped from PQ first. |
your eventcomparator seems right to me. maybe it is other issue. does this problem only occur to event about selfcheck |
seems to be the case I'll go take a look again |
yup my comparator does check for that |
Seems to be the case it could be because of the way I make my events wait with an increment of 0.001 if it is waiting at a self checkout counter |
Summary
The order of printing the results seems to be off.
Description:
I think it might have something to do with my event comparator? The logic for my comparator first checks if the difference between the events are less than ERR (1E-6), if difference falls within the error (ERR), it checks if the first event has a greater customer number than the second event, if so, it returns 1 else it returns -1. If difference does not fall within the error, it returns Double.compare(first.getTimeStamp(), second.getTimeStamp()). It seems correct to me but I may be mistaken.
Screenshots
The text was updated successfully, but these errors were encountered: