NEWS.md
add_rsymphony_solver
and add_lpsymphony_solver
throwing an an infeasible error message for feasible problems containing continuous or semi-continuous variables.presolve_check
function more informative (#124).rij_matrix
so that amounts are calculated correctly for vector-based planning unit data.fast_extract
.add_locked_in_constraints
and add_locked_out_constraints
functions so that they no longer throw an unnecessary warning when when they are added to multi-zone problems using raster data with NA
values.add_locked_in_constraints
and add_locked_out_constraints
functions to provide recommended practices for raster data.rarity_weighted_richness
returning incorrect scores when the feature data contains one feature that has zeros amounts in all planning units (e.g. the tas_features
object in the prioritizrdata R package; #120).add_gurobi_solver
returning solution statuses that are slightly larger than one (e.g. 1+1.0e-10) when solving problems with proportion-type decisions (#118).add_gurobi_solver
, add_lpsymphony_solver
, and add_rsymphony_solver
functions so that they will not return solutions with values less than zero or greater than one when solving problems with proportion-type decisions. This issue is the result of inconsistent precision when performing floating point arithmetic (#117).add_locked_in_constraints
and add_locked_out_constraints
functions to provide a more helpful error message the locked_in
/locked_out
argument refers to a column with data that are not logical (i.e. TRUE
/FALSE
; #118).solve
function to throw a more accurate and helpful error message when no solutions are found (e.g. due to problem infeasibility or solver time limits).add_max_phylo_objective
function to add_max_phylo_div_objective
.add_max_phylo_end_objective
function to maximize the phylogenetic endemism of species adequately represented in a prioritization (#113).add_max_phylo_end_objective
, replacement_cost
, and rarity_weighted_richness
functions to the Prioritizr vignette.sim_phylogeny
).add_max_phylo_div_objective
function.irreplaceability
manual entry to document functions for calculating irreproducibility scores.replacement_cost
function to calculate irreproducibility scores for each planning unit in a solution using the replacement cost method (#26).rarity_weighted_richness
function to calculate irreproducibility scores for each planning unit in a solution using rarity weighted richness scores (#26).add_min_shortfall_objective
function to find solutions that minimize target shortfalls.add_min_shortfall_objective
function to main vignette.problem
tests so that they work when no solvers are installed.feature_representation
function now requires missing (NA
) values for planning unit statuses in a solution for planning units that have missing (NA
) cost data.presolve_check
function to investigate potential sources of numerical instability before trying to solve a problem. The manual entry for this function discusses common sources of numerical instability and approaches for fixing them.solve
function will now use the presolve_check
function to verify that problems do not have obvious sources of numerical instability before trying to solve them. If a problem is likely to have numerical instability issues then this function will now throw an error (unless the solve(x, force = TRUE)
).add_rsymphony_solver
function now uses sparse matrix formats so that attempts can be made to solve large problems with SYMPHONY—though it is unlikely that SYMPHONY will be able to solve such problems in a feasible period of time.tibble::as.tibble
instead of tibble::as_tibble
.solve
(#110).add_boundary_penalties
and add_connectivity_penalties
function (#106).ConservationProblem-class
objects. These methods were implemented to be used in future interactive applications and are not currently used in the package. As a consequence, these bugs do not affect the correctness of any results.bad error message
error being thrown when input rasters are not comparable (i.e. same coordinate reference system, extent, resolutions, and dimensionality) (#104).solve
printing annoying text about tbl_df
(#75).add_neighbor_constraints
and add_contiguity_constraints
functions used more memory than they actually needed (#102). This is because the argument validation code converted sparse matrix objects (i.e. dgCMatrix
) to base objects (i.e. matrix
) class temporarily. This bug only meant inefficient utilization of computer resources—it did not affect the correctness of any results.add_mandatory_allocation_constraints
function. This function can be used to ensure that every planning unit is allocated to a management zone in the solution. It is useful when developing land-use plans where every single parcel of land must be assigned to a specific land-use zone.add_mandatory_allocation_constraints
to the Management Zones and Prioritizr vignettes.$find(x)
method for Collection
prototypes that caused it to throw an error incorrectly. This method was not used in earlier versions of this package.feature_representation
function that caused the “amount_held” column to have NA values instead of the correct values. This bug only affected problems with multiple zones.category_layer
function that it this function to incorrectly throw an error claiming that the input argument to x
was invalid when it was in fact valid. This bug is encountered when different layers the argument to x
have non-NA values in different cells.add_contiguity_constraints
function now uses sparse matrix formats internally for single-zone problems. This means that the constraints can be applied to single-zoned problem with many more planning units.add_connectivity_penalties
function now uses sparse matrix formats internally for single-zone problems. This means that connectivity penalties can be applied to single-zoned problem with many more planning units.add_locked_in_constraints
and add_locked_out_constraints
that incorrectly threw an error when using logical
locked data (i.e. TRUE
/FALSE
) because it incorrectly thought that valid inputs were invalid.add_locked_in_constraints
, add_locked_out_constraints
, and add_manual_locked_constraints
where solving the same problem object twice resulted in incorrect planning units being locked in or out of the solution (#92).feature_abundances
that caused the solve function to throw an error when attempting to solve problems with a single feature.add_cuts_portfolio
that caused the portfolio to return solutions that were not within the specified optimality gap when using the Gurobi solver.add_pool_portfolio
function.feature_representation
function now allows numeric
solutions with attributes (e.g. when output by the solve
function) when calculating representation statistics for problems with numeric
planning unit data (#91).add_manual_targets
function threw a warning when some features had targets equal to zero. This resulted in an excessive amount of warnings. Now, warnings are thrown for targets that are less then zero.problem
function sometimes incorrectly threw a warning that feature data had negative values when the data actually did not contain negative values. This has now been addressed.problem
function now allows negative values in the cost and feature data (and throws a warning if such data are detected).add_absolute_targets
and add_manual_targets
functions now allow negative targets (but throw a warning if such targets are specified).compile
function throws an error if a problem is compiled using the expanded formulation with negative feature data.add_absolute_targets
function now throws an warning—instead of an error—if the specified targets are greater than the feature abundances in planning units to accommodate negative values in feature data.add_max_cover_objective
in prioritizr vignette (#90).add_relative_targets
documentation now makes it clear that locked out planning units are included in the calculations for setting targets (#89).add_loglinear_targets
function now includes a feature_abundances
parameter for specifying the total amount of each feature to use when calculating the targets (#89).feature_abundances
function to calculate the total amount of each feature in the planning units (#86).add_cuts_portfolio
function uses the Gurobi solution pool to generate unique solutions within a specified gap of optimality when tasked with solving problems with Gurobi (version 8.0.0+; #80).add_pool_portfolio
function to generate a portfolio of solutions using the Gurobi solution pool (#77).boundary_matrix
function now has the experimental functionality to use GEOS STR trees to speed up processing (#74).feature_representation
function to how well features are represented in solutions (#73).solve
function printing superfluous text (#75).sim_pu_zones_stack
, sim_pu_zones_polygons
, and sim_features_zones
for exploring conservation problems with multiple management zones.zones
function and Zones
class to organize data with multiple zones.problem
function now accepts Zone
objects as arguments for feature
to create problems with multiple zones.add_relative_targets
and add_absolute_targets
functions for adding targets to problems can be used to specify targets for each feature in each zone.add_manual_targets
function for creating targets that pertain to multiple management zones.solve
function now returns a list
of solutions when generating a portfolio of solutions.add_locked_in_constraints
and add_locked_out_constraints
functions for specifying which planning units are locked in or out now accept matrix
arguments for specifying which zones are locked in or out.add_manual_locked_constraints
function to manually specify which planning units should or shouldn’t be allocated to specific zones in solutions.zones
parameter) and specify how they they should be applied (using the data
parameter. All of these functions have default arguments that mean that problems with a single zone should have the same optimal solution as problems created in the earlier version of the package.add_feature_weights
function can be used to weight different the representation of each feature in each zone.binary_stack
, category_layer
, and category_vector
functions have been provided to help work with data for multiple management zones.?prioritizr
), and README.marxan_problem
has been updated with more comprehensive documentation and to provide more helpful error messages. For clarity, it will now only work with tabular data in the standard Marxan format.add_boundary_penalties
(#62).add_locked_in_constraints
and add_locked_out_constraints
throw an exception when used with semi-continuous-type decisions (#59).compile
thrown when the same planning unit is locked in and locked out now prints the planning unit indices in a readable format.add_locked_in_constraints
and add_locked_out_constraints
are ignored when using proportion-type decisions (#58).predefined_optimization_problem
which incorrectly recognized some inputs as invalid when they were in fact valid.R CMD check
related to proto in Depends.add_lpsymphony_solver
now throws warnings to alert users to potentially incorrect solutions (partially addressing #40).add_max_cover_objective
function has been renamed to the add_max_utility_objective
, because the formulation does not follow the historical formulation of the maximum coverage reserve selection problem (#38).add_max_cover_objective
function now follows the historical maximum coverage objective. This fundamentally changes add_max_cover_objective
function and breaks compatibility with previous version of prioritizr (#38).add_lpsymphony_solver
causing error when attempting to solve problems.numeric
vector data that caused an error.numeric
vector input with rij data containing NA values.apply_boundary_penalties
and add_connectivity_penalties
causing the function to throw an error when the number of boundaries/edges is less than the number of planning units.boundary_matrix
calculations (#30).add_max_phylo_objective
(#24).ScalarParameter
and ArrayParameter
prototypes to check t that functions for generating widgets have their dependencies installed.numeric
planning unit data and portfolios that caused the solve
to throw an error.Spatial*DataFrame
input to marxan_problem
would always use the first column in the attribute table for the cost data. This bug is serious so analysis that used Spatial*DataFrame
inputs in marxan_problem
should be rerun.problem
objects.data.frame
and Spatial*DataFrame
objects are now stored in columns named “solution_*" (e.g. “solution_1”) to store multiple solutions.verbose
argument to all solvers. This replaces the verbosity
argument in add_lpsymphony_solver
and add_rsymphony_solver
.add_lpsymphony_solver
and add_rsymphony_solver
is reduced.ConservationProblem$print()
now only prints the first three species names and a count of the total number of features. This update means that ConservationProblem
objects with lots of features can now safely be printed without polluting the R console.time_limit
.devtools::build_vignettes()
. Earlier versions needed the vignettes to be compiled using the Makefile to copy files around to avoid tangled R code causing failures during R CMD CHECK. Although no longer needed, the vignettes can still be compiled using the shell command make vigns
if desired.rmarkdown::render("README.Rmd")
or using the shell command make readme
. Note that the figures for README.md
can be found in the directory man/figures
.prshiny
will now only be run if executed during an interactive R session. Prior to this R CMD CHECK would hang.marxan_problem
using input data.frame
objects.priortizr::compile
function.problem.data.frame
that meant that it did not check for missing values in rij$pu
.add_absolute_targets
and add_relative_targets` related to their standardGeneric being incorrectly definedadd_corridor_targets
when argument connectivities
is a list
. The elements in the list are assumed to be dsCMatrix
objects (aka symmetric sparse matrices in a compressed format) and are coerced to dgCMatrix
objects to reduce computational burden. There was a typo, however, and so the objects were coerced to dgCmatrix
and not dgCMatrix
. This evidently was ok in earlier versions of the RcppArmadillo and/or Matrix packages but not in the most recent versions.parallel::detectCores()
returns NA
on some systems preventing users from using the Gurobi solver–even when one thread is specified.structure(NULL, ...)
with structure(list(), ...)
.new_waiver
from internal.R.add_default_decisions
and add_default_solver
to own help fileadd_default_objectives
and add_default_targets
private functionsadd_corridor_constraints
that fails to actually add the constraints with argument to connectivity
is a list.make install
command so that it now actually installs the package.