You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, thanks in advance for your help with this issue,
I am having a strange error come up which i think may be a result of me misunderstanding what add_linear_constraint() does.
I have a planning surface which represents the South African EEZ at 10 x 10 km resolution. The raster is made up of 26216 cells, 10809 of which have a value of 1. I want a solution to my conservation problem which only keeps a maximum of 10% of the planning units, which is 1080 cells (to achieve a 10% total area protection of the EEZ).
I am using a raster stack of 48 biodiversity feature layers which are shark and ray distribution maps, each raster layer has values ranging from 0 to 1 (probability of occurrence) within the EEZ.
Finally i have tailored targets for each biodiversity feature.
However a problem arises when i raise my targets. If i use a targets vector with low targets and each target set at either 0.2, 0.3 or 0.4 then gurobi can solve the problem. But when i use a targets vector with medium targets set at either 0.3, 0.4, or 0.5 i get this error: "Error in .local(a, b = b, ...) : no solution found (e.g. due to problem infeasibility or time limits)". Which is very strange as the coverage summary with low targets are well above what i am asking so i wouldn't except raising each target by 0.1 to make the problem that much more complex. So i am not sure what is going wrong?
It looks like the problem is that with medium targets, the solver can't find a solution, because what you ask it to do is not possible.
My guess would be that the low target scenario can be solved with 1080 pu's or less. Once you increase the target with min set, a solution would have to include >1080 pu's, which is why you get the error message.
Using the min_set objective function, you have constraints related to features and you also add a constraint with the add_linear_constraint function. Both constraint types will need to be met in order to find a solution.
In your case the question is: which constraint type is more important to keep? Do you really need to capture each feature representation to its targets value or is the area budget a hard cap at 1080 cells?
Because you can't do both, you have two options:
accept features might not meet their targets:
Here you can use the add_min_shortfall_objective objective or other budget driven objective functions. You will still add your targets and can explore add_feature_weights to make sure feature representation is well spread out across features or very important ones get higher weight.
accept that the solution could go over 1080 cells:
Here you could stay with min_set, but drop the linear constraint. You could add add_linear_penalties to ensure that only certain pu's get selected. This isn't quite what you were after with the linear constraint, but I thought I'd mention it here.
Thank you for your suggestions. It makes sense and i think the min_shorftall_objective with feature weights might be the way to go. I will close this issue however as i am now also discussing this problem further in my other issue and it might get confusing to have two running in parallel.
Hi there, thanks in advance for your help with this issue,
I am having a strange error come up which i think may be a result of me misunderstanding what add_linear_constraint() does.
I have a planning surface which represents the South African EEZ at 10 x 10 km resolution. The raster is made up of 26216 cells, 10809 of which have a value of 1. I want a solution to my conservation problem which only keeps a maximum of 10% of the planning units, which is 1080 cells (to achieve a 10% total area protection of the EEZ).
I am using a raster stack of 48 biodiversity feature layers which are shark and ray distribution maps, each raster layer has values ranging from 0 to 1 (probability of occurrence) within the EEZ.
Finally i have tailored targets for each biodiversity feature.
However a problem arises when i raise my targets. If i use a targets vector with low targets and each target set at either 0.2, 0.3 or 0.4 then gurobi can solve the problem. But when i use a targets vector with medium targets set at either 0.3, 0.4, or 0.5 i get this error: "Error in .local(a, b = b, ...) : no solution found (e.g. due to problem infeasibility or time limits)". Which is very strange as the coverage summary with low targets are well above what i am asking so i wouldn't except raising each target by 0.1 to make the problem that much more complex. So i am not sure what is going wrong?
Below is how i have set my problem:
problem_single = problem(pu,features) %>% # costs and features
add_min_set_objective() %>%
add_linear_constraints(threshold = 1080,sense = "<=",data = pu)%>%
add_relative_targets(t) %>%
add_binary_decisions() %>%
add_gurobi_solver()
This is the problem when i have low targets:
This is the problem when i have medium targets:
The text was updated successfully, but these errors were encountered: