Skip to contents

This function is used to allocate facilities in a discrete location problem. It uses the accumulated cost algorithm to find the optimal location for the facilities based on a user-defined set of locations, objective travel time, and (maximum) number of allocable facilities. If a objectiveshare parameter is specified, the algorithm identifies the best set of size of up to n_fac facilities to achieve the targeted coverage share. The problem is solved using a statistical heuristic approach that generates samples of the candidate locations (on top of the existing locations) and selects the facilities in the one that minimizes the objective function.

Usage

allocation_discrete(
  demand_raster,
  traveltime_raster = NULL,
  bb_area,
  facilities = NULL,
  candidate,
  n_fac = Inf,
  objectiveshare = NULL,
  weights = NULL,
  objectiveminutes = 10,
  dowscaling_model_type,
  mode,
  res_output,
  n_samples,
  par,
  approach = "norm",
  exp_demand = 1,
  exp_weights = 1
)

Arguments

demand_raster

A raster object with the demand for the service.

traveltime_raster

The output of the traveltime function. If not provided, the function will run the traveltime function first.

bb_area

A boundary box object with the area of interest.

facilities

A sf object with the existing facilities.

candidate

A sf object with the candidate locations for the new facilities.

n_fac

The (maximum) number of facilities that can be allocated.

objectiveshare

The share of the demand layer to be covered by adding at most the number of facilities defined by the n_fac parameter from the pool of candidate facilities.

weights

A raster with the weights for the demand.

objectiveminutes

The objective travel time in minutes.

dowscaling_model_type

The type of model used for the spatial downscaling of the travel time layer.

mode

The mode of transport.

res_output

The spatial resolution of the friction raster (and of the analysis), in meters. If <1000, a spatial downscaling approach is used.

n_samples

The number of samples to generate in the heuristic approach for identifying the best set of facilities to be allocated.

par

A logical value indicating whether to run the function in parallel or not. Default is FALSE.

approach

The approach to be used for the allocation. Options are "norm" (default) and "equity". If "norm", the allocation is based on the normalized demand raster multiplied by the normalized weights raster. If "absweights", the allocation is based on the normalized demand raster multiplied by the raw weights raster.

exp_demand

The exponent for the demand raster. Default is 1. A higher value will give less relative weight to areas with higher demand - with respect to the weights layer. This is useful in cases where the users want to increase the allocation in areas with higher values in the weights layer.

exp_weights

The exponent for the weights raster. Default is 1.A higher value will give less relative weight to areas with higher weights - with respect to the demand layer. This is useful in cases where the users want to increase the allocation in areas with higher values in the demand layer.