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. 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,
  weights = NULL,
  objectiveminutes = 10,
  dowscaling_model_type,
  mode,
  res_output,
  n_samples,
  par
)

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 number of facilities that can be allocated.

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.