-
Notifications
You must be signed in to change notification settings - Fork 2
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
remove an event from eventqueue #369
Comments
don't think so. You should manually reverse the changes. But if your incorrect event stems from server resting, simply rescheduling an event would be just fine. |
it sounds like the changes will still be made, but it depends on how your server/customer is stored |
it really depends on how you implement your events, but if I understand correctly the changes will not be made |
it most probably won't undo the changes you made to the state of the servers, so you'll probably have to manually undo the changes everytime you remove an event |
i suggest you only add in event that is confirmed, such as you add the done event after you finish the serve event, since the event are in a priority queue and they are hard to remove. in my structure, I first use the arrive event and check the servers' availability and decide to use wait/serve event. all these events are stored in the priority queue which has a compareTo() method to compare. |
I
Yes, agree as if you schedule the event already in PriorityQueue, it is hard to remove it from the queue before it is being printing. If you increment the Statistics according to each event being scheduled, it will affect the data to be printed out at the end as well. Not scheduling it if it is not meant to be served seems to be the better way. You can try not returning serve from wait, but returning serve after the previous customer rests! |
Summary
when I remove an event from an eventqueue ,will the changes still be made
Description
in the Main class, I defined an eventqueue, which is all the event (Like Arrive, Serve). If I first add an event in it, then I realised that this event is not right ,so I remove this event from the eventqueue. In the event, I made some changes to the server or customer. If I remove the event, will these changes still be made or these changes are also removed?
Screenshots (if any):
Insert Images here if necessary
The text was updated successfully, but these errors were encountered: