Learn R Programming

queuecomputer (version 1.2.0)

as.server.stepfun: Create a server.stepfun object with a roster of times and number of available servers.

Description

Create a server.stepfun object with a roster of times and number of available servers.

Usage

as.server.stepfun(x, y)

Value

A list and server.stepfun object with x and y as elements.

Arguments

x

numeric vector giving the times of changes in number of servers.

y

numeric vector one longer than x giving the number of servers available between x values.

Details

This function uses the analogy of a step function to specify the number of available servers throughout the day. It is used as input to the queue_step function. Alternatively one may use as.server.list to specify available servers as a list, however queue_step is much faster when as.server.stepfun is used as input rather than as.server.list.

If any of the service times are large compared to any element of diff(x) then the as.server.list function should be used.

See Also

as.server.list, queue_step, stepfun.

Examples

Run this code

servers <- as.server.stepfun(c(15,30,50), c(0, 1, 3, 2))
servers

Run the code above in your browser using DataLab