-
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
Order of RandomGenerator #411
Comments
Oops forgot about the tc. It's 5_1. I don't think it's a comparator issue, I mean it worked for level 1-4. Here's how I compared it using Comparable<Event>
Order of events are Arrive -> Wait -> Serve -> Done -> Leave |
Here's how I did the random generation:
|
you need to update your timeNow variable in your loop else its will always be 0, thats why your customer timing is off |
Specifically @Random689 is talking about this line: It should be Then make your customers via |
i generate the arrival time first and generate 9 times since the first arrival time is given as 0. For the rest service time and resttime, you need to generate the time on the spot. for instance, although customer 8 arrive before customer 9, but they may queue in different position due to greedy/not greedy thus there Is chance that customer 9 is served before customer 8. Same for the resttime, as some need to rest while others do not, if you generate all the time at the start, it is not possible to match them to the correct customer. |
Summary
Does the order of generating the random numbers matter?
Do they need to be in a specific order, or can I bulk create 10x genA, then 10x genB,
vs
1x genA, 1x genB, 1x genA, 1x genB, ...
Edit: This is for tc 5_1
Description
I know the description says this:
It is also worth noting that the service time cannot be generated together with the arrival time as each customer is created before the simulation starts, since the nth customer to arrive might not be the nth customer to be served!
But this doesn't really mention if the order for each type of generation is separate or are they all combined.
Screenshots:
The text was updated successfully, but these errors were encountered: