Skip to contents

CallDemandModel: Poisson harmonic regression of hourly calls with daily, weekly and annual cycles and a trend (IRLS with the glm convergence rule), with forecasts. ErlangC: probability of waiting. StaffingRequirement: minimal units per period for a waiting probability, service level or mean-wait target, with optional square-root staffing. PatrolCarRequirement: PCAM-style maximum of queueing, response-time and patrol-frequency requirements. Identical to the Python arm morie.fn.staffing.

Usage

CallDemandModel(
  counts,
  hours,
  daily = 3,
  weekly = 2,
  annual = 2,
  trend = TRUE,
  new_hours = NULL,
  maxit = 100,
  epsilon = 1e-10
)

ErlangC(c, a)

StaffingRequirement(
  arrival_rates,
  handle_time,
  target = "wait_prob",
  level = 0.2,
  threshold = 0,
  beta = NULL
)

PatrolCarRequirement(
  arrival_rate,
  handle_time,
  area,
  response_speed,
  target_response,
  street_miles = 0,
  patrol_speed = 1,
  patrol_frequency = 0,
  target_wait = 0.2,
  metric = "euclidean"
)

Arguments

counts

Hourly call counts.

hours

Hour indices.

daily, weekly, annual

Numbers of harmonics.

trend

Include a linear trend.

new_hours

Hours to forecast.

maxit, epsilon

IRLS controls.

c

Number of servers.

a

Offered load.

arrival_rates, arrival_rate

Calls per hour.

handle_time

Mean handling time (hours).

target

"wait_prob", "service_level" or "asa".

level

Target value.

threshold

Service-level answer time.

beta

Square-root staffing parameter.

area

Beat area.

response_speed

Response speed.

target_response

Target travel time.

street_miles

Street length to patrol.

patrol_speed

Patrol speed.

patrol_frequency

Required passes per hour.

target_wait

Target waiting probability.

metric

"euclidean" or "rectilinear".

Value

List or numeric.

References

Green, L. V., Kolesar, P. J. and Whitt, W. (2007). Coping with time-varying demand when setting staffing requirements for a service system. Production and Operations Management 16, 13-39.

Chaiken, J. M. and Dormont, P. (1978). A patrol car allocation model: background. Management Science 24, 1280-1290.

Wilson, J. M. and Weiss, A. (2012). A Performance-Based Approach to Police Staffing and Allocation. U.S. Department of Justice, COPS Office.

Examples

ErlangC(3, 2)
#> [1] 0.4444444
StaffingRequirement(c(1, 4), 1, level = 0.2)$units
#> [1] 3 7