Replies: 6 comments 3 replies
-
Yes, it is certainly possible. You pass a function to the generator, so that function could return anything you need (as long as the numbers represent interarrival times). For example: env %>%
add_generator("customer", customer, function() c(my_arrival_vector, -1)) The env %>%
add_generator("customer", customer, at(cumsum(my_arrival_vector)) Note the Note: next time, please open this kind of questions in the Discussions section instead of the Issues one. I've moved this one there. |
Beta Was this translation helpful? Give feedback.
-
@Enchufa2 : Thank you so much Dr. Ucar . In the future, I will post directly in the discussions area. |
Beta Was this translation helpful? Give feedback.
-
As I understand, in this example I posted , the arrivals appear in single "bursts" but the services remain classical. For example, suppose 100 people appear on the first day and 83 are processed. On the second day, suppose 20 people appear - this means that we have 17 people from the first day and the 20 people from day 2 in the current queue. On the second day, we will start with the customer that has been waiting the longest (i.e. the 84th customer from the first day). Is this what the R code is doing? |
Beta Was this translation helpful? Give feedback.
-
@Enchufa2 Hi Dr. Ucar . Thank you so much for your reply. Could you please show me how to do this in R? As an example, here is the R code I am using for a standard m/m/k queue that compares the queue length for 3 servers vs 4 servers ... and the percent of people that have been waiting longer than 15 minutes :
|
Beta Was this translation helpful? Give feedback.
-
(Assuming the above code is correct), could you please show me how to modify the above code to correspond to a situation where the arrivals are predetermined? E.g..
Thank you so much Dr. Ucar. |
Beta Was this translation helpful? Give feedback.
-
Hi Dr. Ucar, My apologies for the confusion. I tried to use your advice on how to input a custom arrivals vector, but I am still confused on whether I am doing this correctly. Here is the code I am using:
The above code runs, but the % plots are empty , which makes me think I am not using the arrivals vector correctly as you had mentioned. Is this the correct way to use the arrivals vector? Once again, my apologies for the confusion. |
Beta Was this translation helpful? Give feedback.
-
I made this queue simulation that shows how the percent of all customers that waited more than 15 minutes changes when more servers are added to the system:
I then plotted the results in ggplot (code not shown, but I can add if someone is interested). The plots look like this - confirming that when more servers are added, the percent of customers that waited longer than 15 minutes increases at a lesser rate:
My Question: Suppose if instead of a constant arrival rate, I have a custom arrival rate vector:
That is, for each value of sim_time 1,2,3,4,... we insert my_arrival_vector[1], my_arrival_vector[2], my_arrival_vector[3] etc number of new people into the queue.
Is it possible to feed this vector into the simulation directly instead?
Note: Plotting Code
Beta Was this translation helpful? Give feedback.
All reactions