queue_step {queuecomputer}R Documentation

Compute the departure times and queue lengths for a queueing system from arrival and service times.

Description

Compute the departure times and queue lengths for a queueing system from arrival and service times.

Usage

queue_step(arrivals, service, servers = 1, labels = NULL)

Arguments

arrivals

numeric vector of non-negative arrival times

service

numeric vector of service times with the same ordering as arrival_df.

servers

a non-zero natural number, an object of class server.stepfun or an object of class server.list.

labels

character vector of customer labels (deprecated).

Details

If only departure times are needed, the queue function is faster.

Value

An list object of class queue_list with the following components:

See Also

queue, summary.queue_list, plot.queue_list

Examples


# With two servers
set.seed(1)
n <- 100

arrivals <- cumsum(rexp(n, 3))
service <- rexp(n)


queue_obj <- queue_step(arrivals,
    service = service, servers = 2)


summary(queue_obj)
plot(queue_obj, which = 5)

# It seems like the customers have a long wait.
# Let's put two more servers on after time 20


server_list <- as.server.stepfun(c(20),c(2,4))

queue_obj2 <- queue_step(arrivals,
    service = service,
    servers = server_list)

summary(queue_obj2)
if(require(ggplot2, quietly = TRUE)){

    plot(queue_obj2, which = 5)

}



[Package queuecomputer version 1.2.0 Index]