Maximum Coverage when considering relocation
Source:R/max_cov_relocation.R
max_coverage_relocation.Rd
This function adds a relocation step
Usage
max_coverage_relocation(
existing_facility = NULL,
proposed_facility,
user,
distance_cutoff,
cost_install,
cost_removal,
cost_total,
solver = "lpSolve",
return_early = FALSE
)
Arguments
- existing_facility
data.frame containing the facilities that are already in existing, with columns names lat, and long.
- proposed_facility
data.frame containing the facilities that are being proposed, with column names lat, and long.
- user
data.frame containing the users of the facilities, along with column names lat, and long.
- distance_cutoff
numeric indicating the distance cutoff (in metres) you are interested in. If a number is less than distance_cutoff, it will be 1, if it is greater than it, it will be 0.
- cost_install
integer the cost of installing a new facility
- cost_removal
integer the cost of removing a facility
- cost_total
integer the total cost allocated to the project
- solver
character "glpk" (default) or "lpSolve". "gurobi" is currently in development, see https://github.com/njtierney/maxcovr/issues/25
- return_early
logical TRUE if I do not want to run the extraction process, FALSE if I want to just return the lpsolve model etc.
Examples
if (FALSE) { # \dontrun{
library(dplyr)
# subset to be the places with towers built on them.
york_selected <- york |> filter(grade == "I")
york_unselected <- york |> filter(grade != "I")
# OK, what if I just use some really crazy small data to optimise over.
#
mc_relocate <- max_coverage_relocation(existing_facility = york_selected,
proposed_facility = york_unselected,
user = york_crime,
distance_cutoff = 100,
cost_install = 5000,
cost_removal = 200,
cost_total = 600000)
mc_relocate
summary(mc_relocate)
} # }