Description Usage Arguments Details See Also Examples

View source: R/core_queuefunctions.R

`queue`

is a faster version of `queue_step`

but the input returned is much simpler. It is not compatible with the `summary.queue_list`

method or the `plot.queue_list`

method.

1 |

`arrivals` |
numeric vector of non-negative arrival times |

`service` |
numeric vector of non-negative service times |

`servers` |
a non-zero natural number, an object of class |

`serveroutput` |
boolean whether the server used by each customer should be returned. |

If the arrival vector is out of order the function will reorder it. The same reordering will be applied to the service vector, this is so each customer keeps their service time. Once the queue is computed the original order is put back.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
n <- 1e2
arrivals <- cumsum(rexp(n, 1.8))
service <- rexp(n)
departures <- queue(
arrivals, service, servers = 2)
head(departures)
curve(ecdf(departures)(x) * n,
from = 0, to = max(departures),
xlab = "Time", ylab = "Number of customers")
curve(ecdf(arrivals)(x) * n,
from = 0, to = max(departures),
col = "red", add = TRUE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.