% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/max_cov_relocation.R
\name{max_coverage_relocation}
\alias{max_coverage_relocation}
\title{Maximum Coverage when considering relocation}
\usage{
max_coverage_relocation(existing_facility = NULL, proposed_facility,
  user, distance_cutoff, cost_install, cost_removal, cost_total,
  solver = "lpSolve", return_early = FALSE)
}
\arguments{
\item{existing_facility}{data.frame containing the facilities that are
already in existing, with columns names lat, and long.}

\item{proposed_facility}{data.frame containing the facilities that are
being proposed, with column names lat, and long.}

\item{user}{data.frame containing the users of the facilities, along with
column names lat, and long.}

\item{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.}

\item{cost_install}{integer the cost of installing a new facility}

\item{cost_removal}{integer the cost of removing a facility}

\item{cost_total}{integer the total cost allocated to the project}

\item{solver}{character "glpk" (default) or "lpSolve". "gurobi" is currently
in development, see \url{https://github.com/njtierney/maxcovr/issues/25}}

\item{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.}
}
\value{
dataframe of results
}
\description{
This function adds a relocation step
}
\examples{

\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)

}

}
