Create a new ExcludeResults object to store results for a solution.

new_exclude_results(exclude, held, id = uuid::UUIDgenerate())

Arguments

exclude

Weight object.

held

numeric proportion of the exclude covered by the solution. (e.g. 0.1 = 10%).

id

character unique identifier. Defaults to a random identifier (uuid::UUIDgenerate()).

Value

A ExcludeResults object.

Examples

# find data file paths
f1 <- system.file(
  "extdata", "projects", "sim_raster", "sim_raster_spatial.tif",
  package = "wheretowork"
)
f2 <- system.file(
  "extdata",  "projects", "sim_raster", "sim_raster_attribute.csv.gz",
  package = "wheretowork"
)
f3 <- system.file(
  "extdata",  "projects", "sim_raster", "sim_raster_boundary.csv.gz",
  package = "wheretowork"
)

# create new dataset
d <- new_dataset(f1, f2, f3)

# create new variable
v <- new_variable_from_auto(d, index = 1)

# create a new exclude
excl <- new_exclude(name = "Highways", variable = v)

# create a new exclude results object to store results
exclr <- new_exclude_results(excl, 80)

# print object
print(exclr)
#> ExcludeResults
#>   id:      fbd7f3c4-3c41-4b7f-a69e-c323d87e6cc5
#>   status: FALSE
#>   held: 80
#>   exclude: Highways [status: FALSE]
#> 
  variable: .../sim_raster_spatial.tif#Brown_necked_Parrot_Brown_necked_ [total: 1052 ]