-
Notifications
You must be signed in to change notification settings - Fork 25
/
management_zones_tutorial.html
981 lines (946 loc) · 147 KB
/
management_zones_tutorial.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Management zones tutorial</title>
<script src="data:application/javascript;base64,Ly8gUGFuZG9jIDIuOSBhZGRzIGF0dHJpYnV0ZXMgb24gYm90aCBoZWFkZXIgYW5kIGRpdi4gV2UgcmVtb3ZlIHRoZSBmb3JtZXIgKHRvCi8vIGJlIGNvbXBhdGlibGUgd2l0aCB0aGUgYmVoYXZpb3Igb2YgUGFuZG9jIDwgMi44KS4KZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIGZ1bmN0aW9uKGUpIHsKICB2YXIgaHMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCJkaXYuc2VjdGlvbltjbGFzcyo9J2xldmVsJ10gPiA6Zmlyc3QtY2hpbGQiKTsKICB2YXIgaSwgaCwgYTsKICBmb3IgKGkgPSAwOyBpIDwgaHMubGVuZ3RoOyBpKyspIHsKICAgIGggPSBoc1tpXTsKICAgIGlmICghL15oWzEtNl0kL2kudGVzdChoLnRhZ05hbWUpKSBjb250aW51ZTsgIC8vIGl0IHNob3VsZCBiZSBhIGhlYWRlciBoMS1oNgogICAgYSA9IGguYXR0cmlidXRlczsKICAgIHdoaWxlIChhLmxlbmd0aCA+IDApIGgucmVtb3ZlQXR0cmlidXRlKGFbMF0ubmFtZSk7CiAgfQp9KTsK"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">
/* for pandoc --citeproc since 2.11 */
div.csl-bib-body { }
div.csl-entry {
clear: both;
}
.hanging div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}
</style>
<link rel="stylesheet" href="data:text/css,body%20%7B%0Abackground%2Dcolor%3A%20%23fff%3B%0Amargin%3A%201em%20auto%3B%0Amax%2Dwidth%3A%20700px%3B%0Aoverflow%3A%20visible%3B%0Apadding%2Dleft%3A%202em%3B%0Apadding%2Dright%3A%202em%3B%0Afont%2Dfamily%3A%20%22Open%20Sans%22%2C%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20Arial%2C%20sans%2Dserif%3B%0Afont%2Dsize%3A%2014px%3B%0Aline%2Dheight%3A%201%2E35%3B%0A%7D%0A%23TOC%20%7B%0Aclear%3A%20both%3B%0Amargin%3A%200%200%2010px%2010px%3B%0Apadding%3A%204px%3B%0Awidth%3A%20400px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Aborder%2Dradius%3A%205px%3B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Afont%2Dsize%3A%2013px%3B%0Aline%2Dheight%3A%201%2E3%3B%0A%7D%0A%23TOC%20%2Etoctitle%20%7B%0Afont%2Dweight%3A%20bold%3B%0Afont%2Dsize%3A%2015px%3B%0Amargin%2Dleft%3A%205px%3B%0A%7D%0A%23TOC%20ul%20%7B%0Apadding%2Dleft%3A%2040px%3B%0Amargin%2Dleft%3A%20%2D1%2E5em%3B%0Amargin%2Dtop%3A%205px%3B%0Amargin%2Dbottom%3A%205px%3B%0A%7D%0A%23TOC%20ul%20ul%20%7B%0Amargin%2Dleft%3A%20%2D2em%3B%0A%7D%0A%23TOC%20li%20%7B%0Aline%2Dheight%3A%2016px%3B%0A%7D%0Atable%20%7B%0Amargin%3A%201em%20auto%3B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dcolor%3A%20%23DDDDDD%3B%0Aborder%2Dstyle%3A%20outset%3B%0Aborder%2Dcollapse%3A%20collapse%3B%0A%7D%0Atable%20th%20%7B%0Aborder%2Dwidth%3A%202px%3B%0Apadding%3A%205px%3B%0Aborder%2Dstyle%3A%20inset%3B%0A%7D%0Atable%20td%20%7B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dstyle%3A%20inset%3B%0Aline%2Dheight%3A%2018px%3B%0Apadding%3A%205px%205px%3B%0A%7D%0Atable%2C%20table%20th%2C%20table%20td%20%7B%0Aborder%2Dleft%2Dstyle%3A%20none%3B%0Aborder%2Dright%2Dstyle%3A%20none%3B%0A%7D%0Atable%20thead%2C%20table%20tr%2Eeven%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Ap%20%7B%0Amargin%3A%200%2E5em%200%3B%0A%7D%0Ablockquote%20%7B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Apadding%3A%200%2E25em%200%2E75em%3B%0A%7D%0Ahr%20%7B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%3A%20none%3B%0Aborder%2Dtop%3A%201px%20solid%20%23777%3B%0Amargin%3A%2028px%200%3B%0A%7D%0Adl%20%7B%0Amargin%2Dleft%3A%200%3B%0A%7D%0Adl%20dd%20%7B%0Amargin%2Dbottom%3A%2013px%3B%0Amargin%2Dleft%3A%2013px%3B%0A%7D%0Adl%20dt%20%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Aul%20%7B%0Amargin%2Dtop%3A%200%3B%0A%7D%0Aul%20li%20%7B%0Alist%2Dstyle%3A%20circle%20outside%3B%0A%7D%0Aul%20ul%20%7B%0Amargin%2Dbottom%3A%200%3B%0A%7D%0Apre%2C%20code%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0Aborder%2Dradius%3A%203px%3B%0Acolor%3A%20%23333%3B%0Awhite%2Dspace%3A%20pre%2Dwrap%3B%20%0A%7D%0Apre%20%7B%0Aborder%2Dradius%3A%203px%3B%0Amargin%3A%205px%200px%2010px%200px%3B%0Apadding%3A%2010px%3B%0A%7D%0Apre%3Anot%28%5Bclass%5D%29%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Acode%20%7B%0Afont%2Dfamily%3A%20Consolas%2C%20Monaco%2C%20%27Courier%20New%27%2C%20monospace%3B%0Afont%2Dsize%3A%2085%25%3B%0A%7D%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%7B%0Apadding%3A%202px%200px%3B%0A%7D%0Adiv%2Efigure%20%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0Aimg%20%7B%0Abackground%2Dcolor%3A%20%23FFFFFF%3B%0Apadding%3A%202px%3B%0Aborder%3A%201px%20solid%20%23DDDDDD%3B%0Aborder%2Dradius%3A%203px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Amargin%3A%200%205px%3B%0A%7D%0Ah1%20%7B%0Amargin%2Dtop%3A%200%3B%0Afont%2Dsize%3A%2035px%3B%0Aline%2Dheight%3A%2040px%3B%0A%7D%0Ah2%20%7B%0Aborder%2Dbottom%3A%204px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Apadding%2Dbottom%3A%202px%3B%0Afont%2Dsize%3A%20145%25%3B%0A%7D%0Ah3%20%7B%0Aborder%2Dbottom%3A%202px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Afont%2Dsize%3A%20120%25%3B%0A%7D%0Ah4%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23f7f7f7%3B%0Amargin%2Dleft%3A%208px%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Ah5%2C%20h6%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23ccc%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Aa%20%7B%0Acolor%3A%20%230033dd%3B%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0Aa%3Ahover%20%7B%0Acolor%3A%20%236666ff%3B%20%7D%0Aa%3Avisited%20%7B%0Acolor%3A%20%23800080%3B%20%7D%0Aa%3Avisited%3Ahover%20%7B%0Acolor%3A%20%23BB00BB%3B%20%7D%0Aa%5Bhref%5E%3D%22http%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0Aa%5Bhref%5E%3D%22https%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0A%0Acode%20%3E%20span%2Ekw%20%7B%20color%3A%20%23555%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Edt%20%7B%20color%3A%20%23902000%3B%20%7D%20%0Acode%20%3E%20span%2Edv%20%7B%20color%3A%20%2340a070%3B%20%7D%20%0Acode%20%3E%20span%2Ebn%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Efl%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Ech%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Est%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Eco%20%7B%20color%3A%20%23888888%3B%20font%2Dstyle%3A%20italic%3B%20%7D%20%0Acode%20%3E%20span%2Eot%20%7B%20color%3A%20%23007020%3B%20%7D%20%0Acode%20%3E%20span%2Eal%20%7B%20color%3A%20%23ff0000%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Efu%20%7B%20color%3A%20%23900%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Eer%20%7B%20color%3A%20%23a61717%3B%20background%2Dcolor%3A%20%23e3d2d2%3B%20%7D%20%0A" type="text/css" />
</head>
<body>
<h1 class="title toc-ignore">Management zones tutorial</h1>
<div id="TOC">
<ul>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#usage">Usage</a>
<ul>
<li><a href="#simple-minimum-set-problem">Simple minimum set problem</a></li>
<li><a href="#adding-management-zones">Adding management zones</a></li>
<li><a href="#multiple-zones-with-varying-costs">Multiple zones with varying costs</a></li>
<li><a href="#multiple-zones-with-complex-targets">Multiple zones with complex targets</a></li>
<li><a href="#multiple-zones-with-extra-constraints">Multiple zones with extra constraints</a></li>
<li><a href="#multiple-zones-with-fragmentation-penalties">Multiple zones with fragmentation penalties</a></li>
<li><a href="#multiple-zones-with-fragmentation-penalties-and-mandatory-allocations">Multiple zones with fragmentation penalties and mandatory allocations</a></li>
</ul></li>
<li><a href="#conclusion">Conclusion</a></li>
<li><a href="#references">References</a></li>
</ul>
</div>
<div id="introduction" class="section level2">
<h2>Introduction</h2>
<p>One of the main aims in conservation planning is to identify the most cost-effective set of areas to manage biodiversity <span class="citation">(Margules & Pressey 2000)</span>. To achieve this, prioritizations are generally created to identify areas for expanding protected area systems. However, many real-world conservation problems do not simply involve deciding if an area should be protected or not <span class="citation">(e.g., Klein <em>et al.</em> 2009; Stigner <em>et al.</em> 2016)</span>. Instead, many problems involve a range of different management categories and the goal is to determine which areas should be allocated to which management category. For example, a manager might have a range of different methods (e.g., baiting or trapping at various intensities) for controlling invasive pests in a set of different areas <span class="citation">(e.g., Cattarino <em>et al.</em> 2018)</span>. They would need a prioritization that shows which control methods should be implemented in which areas. In this particular case, a binary prioritization showing which areas contain the most biodiversity is simply not helpful. Furthermore, many real-world problems require decisions that meet multiple, and sometimes conflicting, objectives from different stakeholders. For example, a manager might need to implement a set of no-take and partial-take areas to prevent overfishing, but also ensure that there still remain plenty of areas for fishing activities <span class="citation">(e.g., Wilson <em>et al.</em> 2010; Klein <em>et al.</em> 2013)</span>. Popularized by the <em>Marxan with Zones</em> decision support tool <span class="citation">(Watts <em>et al.</em> 2009)</span>, this concept has become known as “zones” and is becoming increasingly important in conservation planning.</p>
<p>The aim of this tutorial is to showcase the zones functionality of the <em>prioritizr R</em> package. It will assume a certain level of familiarity with conservation planning terminology and the package. If you don’t have much experience in either of these topics, we recommend first reading the <a href="package_overview.html"><em>Package overview</em></a> vignette.</p>
</div>
<div id="usage" class="section level2">
<h2>Usage</h2>
<div id="simple-minimum-set-problem" class="section level3">
<h3>Simple minimum set problem</h3>
<p>In the <em>prioritizr R</em> package, all conservation planning problems – including those which contain multiple management zones or actions – are initialized using the <code>problem</code> function. To refresh our memory on how we can construct problems, let us quickly construct a simple conservation planning problem. This problem will use the simulated built-in planning unit and feature data distributed with the package. It will have a minimum set objective, targets which require that solution secure to 10 % of the habitat in the study area for each feature, and binary decision variables indicating that planning units are selected or not selected for protection.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># load packages</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(prioritizr)</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(raster)</span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># load data</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu">data</span>(sim_pu_raster, sim_features)</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="co"># create targets for each of the five features</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>t1 <span class="ot"><-</span> <span class="fu">rep</span>(<span class="fl">0.1</span>, <span class="dv">5</span>)</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="co"># build single-zone problem</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a>p1 <span class="ot"><-</span> <span class="fu">problem</span>(sim_pu_raster, sim_features) <span class="sc">%>%</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_min_set_objective</span>() <span class="sc">%>%</span></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_relative_targets</span>(t1) <span class="sc">%>%</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_binary_decisions</span>()</span>
<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a><span class="co"># print problem</span></span>
<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(p1)</span></code></pre></div>
<pre><code>## Conservation Problem
## planning units: RasterLayer (90 units)
## cost: min: 190.13275, max: 215.86385
## features: layer.1, layer.2, layer.3, ... (5 features)
## objective: Minimum set objective
## targets: Relative targets [targets (min: 0.1, max: 0.1)]
## decisions: Binary decision
## constraints: <none>
## penalties: <none>
## portfolio: default
## solver: default</code></pre>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="co"># solve problem</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>s1 <span class="ot"><-</span> <span class="fu">solve</span>(p1)</span></code></pre></div>
<pre><code>## Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (linux64)
## Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
## Optimize a model with 5 rows, 90 columns and 450 nonzeros
## Model fingerprint: 0x4bb5d283
## Variable types: 0 continuous, 90 integer (90 binary)
## Coefficient statistics:
## Matrix range [2e-01, 9e-01]
## Objective range [2e+02, 2e+02]
## Bounds range [1e+00, 1e+00]
## RHS range [3e+00, 8e+00]
## Found heuristic solution: objective 2337.9617767
## Presolve time: 0.00s
## Presolved: 5 rows, 90 columns, 450 nonzeros
## Variable types: 0 continuous, 90 integer (90 binary)
## Found heuristic solution: objective 2332.1004028
## Root relaxation presolved: 5 rows, 90 columns, 450 nonzeros
##
##
## Root relaxation: objective 1.931582e+03, 12 iterations, 0.00 seconds (0.00 work units)
##
## Nodes | Current Node | Objective Bounds | Work
## Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
##
## 0 0 1931.58191 0 4 2332.10040 1931.58191 17.2% - 0s
## H 0 0 1987.3985291 1931.58191 2.81% - 0s
##
## Explored 1 nodes (12 simplex iterations) in 0.00 seconds (0.00 work units)
## Thread count was 1 (of 8 available processors)
##
## Solution count 3: 1987.4 2332.1 2337.96
##
## Optimal solution found (tolerance 1.00e-01)
## Best objective 1.987398529053e+03, best bound 1.931581907658e+03, gap 2.8085%</code></pre>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="co"># calculate feature representation</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>r1 <span class="ot"><-</span> <span class="fu">eval_feature_representation_summary</span>(p1, s1)</span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(r1)</span></code></pre></div>
<pre><code>## # A tibble: 5 × 5
## summary feature total_amount absolute_held relative_held
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 overall layer.1 83.3 8.91 0.107
## 2 overall layer.2 31.2 3.13 0.100
## 3 overall layer.3 72.0 7.34 0.102
## 4 overall layer.4 42.7 4.35 0.102
## 5 overall layer.5 56.7 6.01 0.106</code></pre>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="co"># plot solution</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(s1, <span class="at">main =</span> <span class="st">"solution"</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAIAAACb4TnXAAAACXBIWXMAAA7DAAAOwwHHb6hkAAARKUlEQVR4nO3daXwUVbqA8ff0loSQhIQlsjuEsCiLgAsqizKiQHDHEbiGTVHZroZBXBiHi8oiCIOCgoobOIjIoiB61VG8MTKio16DIsOOOOwICRCzddd8SFBDKj2ddN5KNM//15/S1VUVyJNTXVV9YizLEgA6XFW9A8BvGYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoI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oIDFBEYIAiAgMUERigiMAARQQGKCIwQBGBAYoIDFBEYIAiAgMUERigiMAARQQGKCIwQBGBAYoIDFBEYICifwMT40uJ49CwBAAAAABJRU5ErkJggg==" style="display: block; margin: auto;" /></p>
</div>
<div id="adding-management-zones" class="section level3">
<h3>Adding management zones</h3>
<p>Now let us imagine that instead of having a single management zone (e.g., protected area), we have two management zones. Similar to the example above, we require a solution that secures 10 % of the habitat in the study area for each feature in the first management zone. But we also require a solution that secures 5 % of the habitat in the study area for each feature in the second management zone. Each planning unit must be allocated to either zone or not selected for management at all. In this example, each planning unit costs the same when it is allocated to either of the two zones. We can formulate and solve this problem using the following code.</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create a matrix with the targets</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="co"># here each column corresponds to a different zone,</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a><span class="co"># each row corresponds to a different feature, and</span></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a><span class="co"># each cell value corresponds to the target</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a>t2 <span class="ot"><-</span> <span class="fu">matrix</span>(<span class="cn">NA</span>, <span class="at">ncol =</span> <span class="dv">2</span>, <span class="at">nrow =</span> <span class="dv">5</span>)</span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a>t2[, <span class="dv">1</span>] <span class="ot"><-</span> <span class="fl">0.1</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a>t2[, <span class="dv">2</span>] <span class="ot"><-</span> <span class="fl">0.05</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a><span class="co"># print targets</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(t2)</span></code></pre></div>
<pre><code>## [,1] [,2]
## [1,] 0.1 0.05
## [2,] 0.1 0.05
## [3,] 0.1 0.05
## [4,] 0.1 0.05
## [5,] 0.1 0.05</code></pre>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create a zones object that contains the amount of each feature</span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a><span class="co"># in each planning unit when it is allocated to each zone</span></span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a><span class="co"># since our zones pertain to the same habitat data, we will</span></span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a><span class="co"># to specify the same habitat data for each zone</span></span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a>z2 <span class="ot"><-</span> <span class="fu">zones</span>(<span class="st">"zone 1"</span> <span class="ot">=</span> sim_features, <span class="st">"zone 2"</span> <span class="ot">=</span> sim_features)</span>
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-7"><a href="#cb11-7" aria-hidden="true" tabindex="-1"></a><span class="co"># print zones</span></span>
<span id="cb11-8"><a href="#cb11-8" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(z2)</span></code></pre></div>
<pre><code>## Zones
## zones: zone 1, zone 2 (2 zones)
## features: 1, 2, 3, ... (5 features)
## data type: RasterStack</code></pre>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create a raster stack with the planning unit data</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a><span class="co"># since our planning unit costs are the same for each zone,</span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="co"># we will create a stack with two replicates of the cost data</span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a>pu2 <span class="ot"><-</span> <span class="fu">stack</span>(sim_pu_raster, sim_pu_raster)</span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a><span class="co"># print stack</span></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(pu2)</span></code></pre></div>
<pre><code>## class : RasterStack
## dimensions : 10, 10, 100, 2 (nrow, ncol, ncell, nlayers)
## resolution : 0.1, 0.1 (x, y)
## extent : 0, 1, 0, 1 (xmin, xmax, ymin, ymax)
## crs : NA
## names : layer.1, layer.2
## min values : 190.1328, 190.1328
## max values : 215.8638, 215.8638</code></pre>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="co"># build two-zone problem</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a>p2 <span class="ot"><-</span> <span class="fu">problem</span>(pu2, z2) <span class="sc">%>%</span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_min_set_objective</span>() <span class="sc">%>%</span></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_relative_targets</span>(t2) <span class="sc">%>%</span></span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_binary_decisions</span>()</span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-7"><a href="#cb15-7" aria-hidden="true" tabindex="-1"></a><span class="co"># print problem</span></span>
<span id="cb15-8"><a href="#cb15-8" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(p2)</span></code></pre></div>
<pre><code>## Conservation Problem
## zones: zone 1, zone 2 (2 zones)
## planning units: RasterStack (90 units)
## cost: min: 190.13275, max: 215.86385
## features: 1, 2, 3, ... (5 features)
## objective: Minimum set objective
## targets: Relative targets [targets (min: 0.05, max: 0.1)]
## decisions: Binary decision
## constraints: <none>
## penalties: <none>
## portfolio: default
## solver: default</code></pre>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="co"># solve problem</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a>s2 <span class="ot"><-</span> <span class="fu">solve</span>(p2)</span></code></pre></div>
<pre><code>## Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (linux64)
## Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
## Optimize a model with 100 rows, 180 columns and 1080 nonzeros
## Model fingerprint: 0x5c140ae3
## Variable types: 0 continuous, 180 integer (180 binary)
## Coefficient statistics:
## Matrix range [2e-01, 1e+00]
## Objective range [2e+02, 2e+02]
## Bounds range [1e+00, 1e+00]
## RHS range [1e+00, 8e+00]
## Found heuristic solution: objective 3568.4931335
## Presolve time: 0.01s
## Presolved: 100 rows, 180 columns, 1080 nonzeros
## Variable types: 0 continuous, 180 integer (180 binary)
## Found heuristic solution: objective 3440.6550903
## Root relaxation presolved: 100 rows, 180 columns, 1080 nonzeros
##
##
## Root relaxation: objective 2.911333e+03, 75 iterations, 0.00 seconds (0.00 work units)
##
## Nodes | Current Node | Objective Bounds | Work
## Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
##
## 0 0 2911.33336 0 10 3440.65509 2911.33336 15.4% - 0s
## H 0 0 2996.1175232 2911.33336 2.83% - 0s
##
## Explored 1 nodes (79 simplex iterations) in 0.01 seconds (0.00 work units)
## Thread count was 1 (of 8 available processors)
##
## Solution count 3: 2996.12 3440.66 3568.49
##
## Optimal solution found (tolerance 1.00e-01)
## Best objective 2.996117523193e+03, best bound 2.911333356299e+03, gap 2.8298%</code></pre>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="co"># calculate feature representation</span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a>r2 <span class="ot"><-</span> <span class="fu">eval_feature_representation_summary</span>(p2, s2)</span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(r2)</span></code></pre></div>
<pre><code>## # A tibble: 15 × 5
## summary feature total_amount absolute_held relative_held
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 overall 1 167. 13.4 0.0803
## 2 overall 2 62.4 4.77 0.0765
## 3 overall 3 144. 10.9 0.0758
## 4 overall 4 85.3 6.41 0.0751
## 5 overall 5 113. 9.06 0.0799
## 6 zone 1 1 83.3 8.87 0.106
## 7 zone 1 2 31.2 3.21 0.103
## 8 zone 1 3 72.0 7.21 0.100
## 9 zone 1 4 42.7 4.27 0.100
## 10 zone 1 5 56.7 6.03 0.106
## 11 zone 2 1 83.3 4.50 0.0541
## 12 zone 2 2 31.2 1.56 0.0500
## 13 zone 2 3 72.0 3.70 0.0515
## 14 zone 2 4 42.7 2.14 0.0501
## 15 zone 2 5 56.7 3.03 0.0533</code></pre>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="co"># plot solution</span></span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a><span class="co"># here we use the category layer function to generate raster showing the zone</span></span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a><span class="co"># that each planning unit was allocated. Specifically, pixels with the</span></span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a><span class="co"># value 1 are allocated to "zone 1" and pixels with the value 2 are allocated</span></span>
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true" tabindex="-1"></a><span class="co"># to "zone 2". Thus units depicted in gray are not allocated</span></span>
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true" tabindex="-1"></a><span class="co"># to any zone, units depicted in yellow are allocated to zone 1, and units</span></span>
<span id="cb21-7"><a href="#cb21-7" aria-hidden="true" tabindex="-1"></a><span class="co"># depicted in green are allocated to zone 2</span></span>
<span id="cb21-8"><a href="#cb21-8" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(<span class="fu">category_layer</span>(s2), <span class="at">main =</span> <span class="st">"solution"</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAIAAACb4TnXAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAQMklEQVR4nO3daXhTdb7A8d8/OUmT0p1NiixDKeCG4IriwMgVBWXEbeZir0UEUUf00TIIjLhxURxg4OKAAyqK+8IiyqJXZxCF6rhcdYQREUQ2hYIobSlYyHLui4LQkoTS9HdS2u/nyRuSk3NOS749W/KPsW1bAOhwJXoFgPqMwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICU2D/OPtSnzHGlTlw0b7qPmn3P2feVVBQMPzel9eEajwT1DVWolcAFew9K1+dNvXv+1xNhlx874BO7kSvD2oHgdVVptH5t0+f2T9kvB06exK9MqgpdhGPYJetnntfXo9OLdJ9Xl9qs/bn9L/90eXbApUmKf7ixXvyepzUIt3va5TVqvNFgx58dc3uaN/FG3h/eI5ljPF2m7QudOC+fYsHZbmMMb6+T+607Z9ev7Nnv4kfB0TELllU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AxQRGKCIwABFBAYo4p0cB8T+2H/28lgfz9vaI9bfqRjPjT0oQOyzIylpxTEeRR3BFgxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKGtaFZmOiDsDgdsf6ArhWybEuNLvdsf5OxX5uzNnGWqUYP0uNacyzgWtYH1cBHMYuIqCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxT9P+4aFlqBdvaBAAAAAElFTkSuQmCC" style="display: block; margin: auto;" /></p>
</div>
<div id="multiple-zones-with-varying-costs" class="section level3">
<h3>Multiple zones with varying costs</h3>
<p>Real-world problems often have different costs for managing planning units under different zones. These problems also tend to have different expected amounts of each feature when planning units are managed differently. So let us consider a slightly more complex example. Similar to before we will have two management zones. But this time, the cost of managing each planning unit is different depending on which management zone it is assigned to in the solution. Furthermore, when we assign a planning unit to the second zone, we only expect to end up with half of the habitat we would get if we managed the unit in the first zone (e.g., because the second zone is a partial-take zone and the first zone is a no-take zone). We will use the same target data as in the previous example.</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create new planning unit and cost data</span></span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="fu">data</span>(sim_pu_zones_stack)</span>
<span id="cb22-3"><a href="#cb22-3" aria-hidden="true" tabindex="-1"></a>pu3 <span class="ot"><-</span> sim_pu_zones_stack[[<span class="dv">1</span><span class="sc">:</span><span class="dv">2</span>]]</span>
<span id="cb22-4"><a href="#cb22-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb22-5"><a href="#cb22-5" aria-hidden="true" tabindex="-1"></a><span class="co"># plot cost data</span></span>
<span id="cb22-6"><a href="#cb22-6" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(pu3, <span class="at">main =</span> <span class="fu">c</span>(<span class="st">"zone 1"</span>, <span class="st">"zone 2"</span>), <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYAAAAEgCAIAAAAyuTMGAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAgAElEQVR4nO3deXgURf4G8G91z5FAbhKOAAIJyiUBAhg5A5ost8ilyCKsnF7oIggiEQTldFFRVuCnoHKIcogiXkBADhFXkEsRUMKNBgKE3JnMdP/+SGYSkpqQyXRS3fJ+nt19lkqlp5P55u2a6u5qpqoqAQCIIIneAQC4fSGAAEAYBBAACIMAAgBhEEAAIAwCCACEQQABgDAIIAAQBgEEAMIggABAGAQQAAiDAPKI7dCyf48ZO+mjEw7RewIGYr/03cInerS8I7iK1TcwvEnnIS99/Esa7sEkImK4GbXscn59o1fHidvTwp/alrSoq1n07oAhKH9+OqLD4BWn84r+obGqrSZu3j6vSxATtl/6gBHQLSmpZw79sG394hcfuqfjxB2piuj9AUOx7VswedXpPJX5txj59qbEbevmDIi0MjXz0JvPvnnYLnrvxFP1JHfL2Jq8SDS3mX3Mrqqqqlw/tHrqI50a1wzwsVYJrtP8/uGvbPgtTXF+v/3k/BgzEckR47f99umUvi3rBPhY/Wo16/7siqPpRV7HkfLTsgn92jaoVtXXv0Zk697P/Pe787nudur6ij4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GEQQAAgDAIIAIRBAAGAMAggABAGAQQAwiCAAEAYBBAACIMAAgBhEEAAIAwCCACEQQABgDAIIAAQBgEEAMIggABAGAQQAAiDAAIAYRBAACAMAggAhPl/aQXTa6K5c78AAAAASUVORK5CYII=" style="display: block; margin: auto;" /></p>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create problem</span></span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a>p3 <span class="ot"><-</span> <span class="fu">problem</span>(pu3, <span class="fu">zones</span>(sim_features, sim_features <span class="sc">*</span> <span class="fl">0.5</span>)) <span class="sc">%>%</span></span>
<span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_min_set_objective</span>() <span class="sc">%>%</span></span>
<span id="cb23-4"><a href="#cb23-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_relative_targets</span>(t2) <span class="sc">%>%</span></span>
<span id="cb23-5"><a href="#cb23-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_binary_decisions</span>()</span>
<span id="cb23-6"><a href="#cb23-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb23-7"><a href="#cb23-7" aria-hidden="true" tabindex="-1"></a><span class="co"># print problem</span></span>
<span id="cb23-8"><a href="#cb23-8" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(p3)</span></code></pre></div>
<pre><code>## Conservation Problem
## zones: 1, 2 (2 zones)
## planning units: RasterStack (90 units)
## cost: min: 182.60173, max: 221.36296
## features: 1, 2, 3, ... (5 features)
## objective: Minimum set objective
## targets: Relative targets [targets (min: 0.05, max: 0.1)]
## decisions: Binary decision
## constraints: <none>
## penalties: <none>
## portfolio: default
## solver: default</code></pre>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="co"># solve problem</span></span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a>s3 <span class="ot"><-</span> <span class="fu">solve</span>(p3)</span></code></pre></div>
<pre><code>## Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (linux64)
## Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
## Optimize a model with 100 rows, 180 columns and 1080 nonzeros
## Model fingerprint: 0xdfa75166
## Variable types: 0 continuous, 180 integer (180 binary)
## Coefficient statistics:
## Matrix range [1e-01, 1e+00]
## Objective range [2e+02, 2e+02]
## Bounds range [1e+00, 1e+00]
## RHS range [8e-01, 8e+00]
## Found heuristic solution: objective 3667.7708740
## Presolve time: 0.01s
## Presolved: 100 rows, 180 columns, 1080 nonzeros
## Variable types: 0 continuous, 180 integer (180 binary)
## Found heuristic solution: objective 3388.0249329
## Root relaxation presolved: 100 rows, 180 columns, 1080 nonzeros
##
##
## Root relaxation: objective 2.884872e+03, 38 iterations, 0.00 seconds (0.00 work units)
##
## Nodes | Current Node | Objective Bounds | Work
## Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
##
## 0 0 2884.87201 0 8 3388.02493 2884.87201 14.9% - 0s
## H 0 0 2958.1201477 2884.87201 2.48% - 0s
##
## Explored 1 nodes (38 simplex iterations) in 0.01 seconds (0.00 work units)
## Thread count was 1 (of 8 available processors)
##
## Solution count 3: 2958.12 3388.02 3667.77
##
## Optimal solution found (tolerance 1.00e-01)
## Best objective 2.958120147705e+03, best bound 2.884872007846e+03, gap 2.4762%</code></pre>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="co"># calculate feature representation</span></span>
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a>r3 <span class="ot"><-</span> <span class="fu">eval_feature_representation_summary</span>(p3, s3)</span>
<span id="cb27-3"><a href="#cb27-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(r3)</span></code></pre></div>
<pre><code>## # A tibble: 15 × 5
## summary feature total_amount absolute_held relative_held
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 overall 1 125. 11.1 0.0891
## 2 overall 2 46.8 3.92 0.0838
## 3 overall 3 108. 9.28 0.0860
## 4 overall 4 64.0 5.37 0.0839
## 5 overall 5 85.1 7.46 0.0877
## 6 1 1 83.3 8.94 0.107
## 7 1 2 31.2 3.13 0.100
## 8 1 3 72.0 7.42 0.103
## 9 1 4 42.7 4.29 0.101
## 10 1 5 56.7 6.01 0.106
## 11 2 1 41.6 2.19 0.0527
## 12 2 2 15.6 0.794 0.0509
## 13 2 3 36.0 1.87 0.0519
## 14 2 4 21.3 1.08 0.0505
## 15 2 5 28.4 1.44 0.0509</code></pre>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="co"># plot solution</span></span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(<span class="fu">category_layer</span>(s3), <span class="at">main =</span> <span class="st">"solution"</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAIAAACb4TnXAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAQJUlEQVR4nO3daXhU9b3A8d9/5sxkJmRllSBgCQHcEFxRLFSuKCgVUduLuQYRBK3oo6EIVNy4uBQoXLxgQUVxXwBFWfRqiyhE63LVChURRDaFgChJCBiY5fRFAEkyM4ZMfmeyfD/PvGHmzDknkC9nnf8Y27YFgA5XolcAaMgIDFBEYIAiAgMUERigiMAARQQGKCIwQBGBAYoIDFBEYIAiAgMUERigiMAARQQGKCIwQBGBAYoIDFBEYIAiAgMUERigiMAARQQGKCIwQBGBAYoIDFBEYIAiA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9snOao56Dxj06Phs7zi80d4xKGag84zNj0aPuPxGF9y1Uc886zmoPOMTY+Gb/3mLSs++DDCC7ZdUFDQokWLiO/Kyclp3759tHlWc9B5xqZHA3f22Wc//fTTM2fPrvpSk5SUuXPnulyRd6YGDRp00003RZttNQedZ2z6+i321zvEGH0t9sBs9e5Scgx5eXl5eXm1PttqDjrP2PRATVRz0HnGpgdqopqDzjM2PVAjsQadZ2x6IF4xBp1nbHrHJWRs+thnMmJw/iSH7riIjRJbMEARgQGKCAxQRGCAosZ1J0fsz/bHEPtejdhfaVca662xKH0BH5zEFgxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKGteF5rbJNfyWN2NqPnKD2+30V8vVeG3j+TERUeP6uArgMHYRAUUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEARgQGKCAxQRGCAIgIDFBEYoOjf/wcco8D3TTYAAAAASUVORK5CYII=" style="display: block; margin: auto;" /></p>
</div>
<div id="multiple-zones-with-complex-targets" class="section level3">
<h3>Multiple zones with complex targets</h3>
<p>So far, we have dealt with problems where each feature has a target that pertains to a single zone. But sometimes we have targets that pertain to multiple zones. For example, what if we were in charge of managing pest control in a set of areas and we had three different pest control methods we could implement in any given planning unit. We could (i) set up a few traps in a given planning unit and make 10 % of the habitat in the unit pest-free, (ii) set up a lot of traps and make 50 % of the habitat in the unit pest-free, or (iii) drop baits over a given planning unit and make 80 % of the planning unit pest-free. Each of these different actions has a different cost, with a few low intensity trapping costing $100 per planning unit, a high intensity trapping costing $300, and baiting costing $200 (please note these costs aren’t meant to be realistic). After defining our management actions and costs, we require a solution that will yield 8 units of pest free habitat per feature. It’s important to note that unlike the previous examples, here we don’t have targets for each feature in each zone, but rather our targets are for each feature and across multiple zones. In other words, we don’t really care which management actions we implement, we just want the set of actions that will meet our targets for minimum expenditure. We can formulate and solve this problem using the following code.</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create planning unit data with costs</span></span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a>pu4 <span class="ot"><-</span> <span class="fu">stack</span>(<span class="fu">Which</span>(<span class="sc">!</span><span class="fu">is.na</span>(sim_pu_raster)) <span class="sc">*</span> <span class="dv">100</span>,</span>
<span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">Which</span>(<span class="sc">!</span><span class="fu">is.na</span>(sim_pu_raster)) <span class="sc">*</span> <span class="dv">300</span>,</span>
<span id="cb30-4"><a href="#cb30-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">Which</span>(<span class="sc">!</span><span class="fu">is.na</span>(sim_pu_raster)) <span class="sc">*</span> <span class="dv">200</span>)</span>
<span id="cb30-5"><a href="#cb30-5" aria-hidden="true" tabindex="-1"></a><span class="fu">names</span>(pu4) <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"few.traps"</span>, <span class="st">"many.traps"</span>, <span class="st">"baiting"</span>)</span>
<span id="cb30-6"><a href="#cb30-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb30-7"><a href="#cb30-7" aria-hidden="true" tabindex="-1"></a><span class="co"># plot planning unit data</span></span>
<span id="cb30-8"><a href="#cb30-8" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(pu4, <span class="at">nr =</span> <span class="dv">1</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAAEgCAIAAABaSrE+AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAf40lEQVR4nO3de0AU1eIH8HNmZpeX8pCXoGJqiiA+8YnmVRG9amXa9dXDLFMwjNJ8VDd/erXSnj4yFK9m2bUy06uWmkolUpqaWimIlqaIT7xiKKDszszvDw4FLAEDcxaPfj9/5bS7rPv1fJmZnTOH6rpOAACAEKm23wAAwK0ChQgAwKAQAQAYFCIAAINCBABgUIgAAAwKEQCAcUIh2o4uGxbm4+oaOm2Pjf9PA7izFe6IC5ItETMO2avwYDXt5Q5WOXDctsKqbb/t8S9ENWNt4sZjN1s/+X/Dm8k1eB1b6ox72rQfufykZtpbA+dBfLck6hP5j/Gxj/2tkUxKZVRq+51E4f0Dsn9NO3VVo96hndoGu9MavJB+/ezRtLQb2Tcxs0ZEiO+WJAUPeHHxAPaHEhmV2n5H0Tmb3c5S9IMk38e33Cw4tmbyoPaNfer4NO48ct7XF1T7sXmdLdRz2JpcXT2zuJeVyHc9s6tQL/wmvqEs3/3c7sKiV7Ef/uN1LF1eT989PVSR74pdmjSue+iYzwq0Symvj+x8l6+71dWnSbfRi/f/ruk3t8fWl5TW8W9O7dmwrlfDdvc+98mxAl3Xde3ydwsf63G3fx13r+BW/Sa+dyhX4/0Z3LoKv45vKMlNBsc+2MrX3c03fOhbWzfPGXS3t7tnw86Pf5BRqOvlfba2vdNDFbnx42+8cn8LH3fP4PYj3z3w64oBHlRpMe17m67r9iMvd7BIvg+vzy36MYjPiYo+utDRL8V1qV/Hq1HkkBlbzth1vfwo7UfmtLdIAU9+ebN0Rkd/Lt6ulxf3wetFP+vaz++NiwrxDQx/YM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ABgUIgAAg0IEAGBQiAAADAoRAIBBIQIAMChEAAAGhQgAwKAQAQAYFCIAAINCBABgUIgAAAwKEQCAQSECADAoRAAABoUIAMCgEAEAGBQiAACDQgQAYFCIAAAMChEAgEEhAgAwKEQAAAaFCADAoBABABgUIgAAg0IEAGBQiAAADAoRAIBBIQIAMChEAAAGhQgAwKAQAQAYFCIAAINCBABgUIgAAAwKEQCAQSECADAoRAAABoUIAMD8P3fYe4FCtPWfAAAAAElFTkSuQmCC" style="display: block; margin: auto;" /></p>
<div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create targets</span></span>
<span id="cb31-2"><a href="#cb31-2" aria-hidden="true" tabindex="-1"></a>t4 <span class="ot"><-</span> tibble<span class="sc">::</span><span class="fu">tibble</span>(<span class="at">feature =</span> <span class="fu">names</span>(sim_features),</span>
<span id="cb31-3"><a href="#cb31-3" aria-hidden="true" tabindex="-1"></a> <span class="at">zone =</span> <span class="fu">list</span>(<span class="fu">names</span>(pu4))[<span class="fu">rep</span>(<span class="dv">1</span>, <span class="dv">5</span>)],</span>
<span id="cb31-4"><a href="#cb31-4" aria-hidden="true" tabindex="-1"></a> <span class="at">target =</span> <span class="fu">rep</span>(<span class="dv">8</span>, <span class="dv">5</span>),</span>
<span id="cb31-5"><a href="#cb31-5" aria-hidden="true" tabindex="-1"></a> <span class="at">type =</span> <span class="fu">rep</span>(<span class="st">"absolute"</span>, <span class="dv">5</span>))</span>
<span id="cb31-6"><a href="#cb31-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb31-7"><a href="#cb31-7" aria-hidden="true" tabindex="-1"></a><span class="co"># print targets</span></span>
<span id="cb31-8"><a href="#cb31-8" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(t4)</span></code></pre></div>
<pre><code>## # A tibble: 5 × 4
## feature zone target type
## <chr> <list> <dbl> <chr>
## 1 layer.1 <chr [3]> 8 absolute
## 2 layer.2 <chr [3]> 8 absolute
## 3 layer.3 <chr [3]> 8 absolute
## 4 layer.4 <chr [3]> 8 absolute
## 5 layer.5 <chr [3]> 8 absolute</code></pre>
<div class="sourceCode" id="cb33"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create problem</span></span>
<span id="cb33-2"><a href="#cb33-2" aria-hidden="true" tabindex="-1"></a>p4 <span class="ot"><-</span> <span class="fu">problem</span>(pu4, <span class="fu">zones</span>(<span class="at">few.traps =</span> sim_features <span class="sc">*</span> <span class="fl">0.1</span>,</span>
<span id="cb33-3"><a href="#cb33-3" aria-hidden="true" tabindex="-1"></a> <span class="at">many.traps =</span> sim_features <span class="sc">*</span> <span class="fl">0.5</span>,</span>
<span id="cb33-4"><a href="#cb33-4" aria-hidden="true" tabindex="-1"></a> <span class="at">baiting =</span> sim_features <span class="sc">*</span> <span class="fl">0.8</span>,</span>
<span id="cb33-5"><a href="#cb33-5" aria-hidden="true" tabindex="-1"></a> <span class="at">feature_names =</span> <span class="fu">names</span>(sim_features))) <span class="sc">%>%</span></span>
<span id="cb33-6"><a href="#cb33-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_min_set_objective</span>() <span class="sc">%>%</span></span>
<span id="cb33-7"><a href="#cb33-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_manual_targets</span>(t4) <span class="sc">%>%</span></span>
<span id="cb33-8"><a href="#cb33-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_binary_decisions</span>()</span>
<span id="cb33-9"><a href="#cb33-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb33-10"><a href="#cb33-10" aria-hidden="true" tabindex="-1"></a><span class="co"># print problem</span></span>
<span id="cb33-11"><a href="#cb33-11" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(p4)</span></code></pre></div>
<pre><code>## Conservation Problem
## zones: few.traps, many.traps, baiting (3 zones)
## planning units: RasterStack (100 units)
## cost: min: 0, max: 300
## features: layer.1, layer.2, layer.3, ... (5 features)
## objective: Minimum set objective
## targets: Absolute targets [targets (min: 8, max: 8)]
## decisions: Binary decision
## constraints: <none>
## penalties: <none>
## portfolio: default
## solver: default</code></pre>
<div class="sourceCode" id="cb35"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a><span class="co"># solve problem</span></span>
<span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a>s4 <span class="ot"><-</span> <span class="fu">solve</span>(p4)</span></code></pre></div>
<pre><code>## Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (linux64)
## Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
## Optimize a model with 105 rows, 300 columns and 1800 nonzeros
## Model fingerprint: 0xba527df5
## Variable types: 0 continuous, 300 integer (300 binary)
## Coefficient statistics:
## Matrix range [2e-02, 1e+00]
## Objective range [1e+02, 3e+02]
## Bounds range [1e+00, 1e+00]
## RHS range [1e+00, 8e+00]
## Found heuristic solution: objective 9400.0000000
## Presolve removed 14 rows and 120 columns
## Presolve time: 0.00s
## Presolved: 91 rows, 180 columns, 360 nonzeros
## Found heuristic solution: objective 4700.0000000
## Variable types: 0 continuous, 180 integer (180 binary)
## Root relaxation presolved: 91 rows, 180 columns, 360 nonzeros
##
##
## Root relaxation: objective 3.663237e+03, 1 iterations, 0.00 seconds (0.00 work units)
##
## Nodes | Current Node | Objective Bounds | Work
## Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
##
## 0 0 3663.23656 0 1 4700.00000 3663.23656 22.1% - 0s
## H 0 0 3800.0000000 3663.23656 3.60% - 0s
##
## Explored 1 nodes (1 simplex iterations) in 0.01 seconds (0.00 work units)
## Thread count was 1 (of 8 available processors)
##
## Solution count 3: 3800 4700 9400
##
## Optimal solution found (tolerance 1.00e-01)
## Best objective 3.800000000000e+03, best bound 3.700000000000e+03, gap 2.6316%</code></pre>
<div class="sourceCode" id="cb37"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="co"># calculate feature representation</span></span>
<span id="cb37-2"><a href="#cb37-2" aria-hidden="true" tabindex="-1"></a>r4 <span class="ot"><-</span> <span class="fu">eval_feature_representation_summary</span>(p4, s4)</span>
<span id="cb37-3"><a href="#cb37-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(r4)</span></code></pre></div>
<pre><code>## # A tibble: 20 × 5
## summary feature total_amount absolute_held relative_held
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 overall layer.1 117. 18.3 0.157
## 2 overall layer.2 43.7 8.19 0.187
## 3 overall layer.3 101. 15.2 0.151
## 4 overall layer.4 59.7 11.6 0.194
## 5 overall layer.5 79.4 12.7 0.161
## 6 few.traps layer.1 8.33 0 0
## 7 few.traps layer.2 3.12 0 0
## 8 few.traps layer.3 7.20 0 0
## 9 few.traps layer.4 4.27 0 0
## 10 few.traps layer.5 5.67 0 0
## 11 many.traps layer.1 41.6 0 0
## 12 many.traps layer.2 15.6 0 0
## 13 many.traps layer.3 36.0 0 0
## 14 many.traps layer.4 21.3 0 0
## 15 many.traps layer.5 28.4 0 0
## 16 baiting layer.1 66.6 18.3 0.275
## 17 baiting layer.2 25.0 8.19 0.328
## 18 baiting layer.3 57.6 15.2 0.264
## 19 baiting layer.4 34.1 11.6 0.340
## 20 baiting layer.5 45.4 12.7 0.281</code></pre>
<div class="sourceCode" id="cb39"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a><span class="co"># plot solution</span></span>
<span id="cb39-2"><a href="#cb39-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(<span class="fu">category_layer</span>(s4), <span class="at">main =</span> <span class="st">"solution"</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre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aAb8VcBQ5VIxolkbhvH7rwoWGRkZErMVOsgR+GMnNpvtmv6+1lKILRggiMAAQQQGCCIwQBAHOUpSiVwCUgAOchQ7tmCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQdH3dMkBr2RswXK2qoQXdkD3wa1vafj5B4Pq6kgMIMHYRAUEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIOh/f9ojDUA9qokAAAAASUVORK5CYII=" style="display: block; margin: auto;" /></p>
</div>
<div id="multiple-zones-with-extra-constraints" class="section level3">
<h3>Multiple zones with extra constraints</h3>
<p>So it looks like baiting is the way to go! Except that we might recall that we can’t use baits in most of the planning units because they contain native species that are susceptible to baits. So now we need to specify that which of our planning units cannot be assigned to the third zone (baiting) to obtain a more useful solution.</p>
<div class="sourceCode" id="cb40"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create data.frame to specify that we cannot bait in the first 40 units</span></span>
<span id="cb40-2"><a href="#cb40-2" aria-hidden="true" tabindex="-1"></a>l5 <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">pu =</span> <span class="fu">seq</span>(<span class="dv">1</span>, <span class="dv">80</span>),</span>
<span id="cb40-3"><a href="#cb40-3" aria-hidden="true" tabindex="-1"></a> <span class="at">zone =</span> <span class="st">"baiting"</span>,</span>
<span id="cb40-4"><a href="#cb40-4" aria-hidden="true" tabindex="-1"></a> <span class="at">status =</span> <span class="dv">0</span>)</span>
<span id="cb40-5"><a href="#cb40-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb40-6"><a href="#cb40-6" aria-hidden="true" tabindex="-1"></a><span class="co"># preview locked data</span></span>
<span id="cb40-7"><a href="#cb40-7" aria-hidden="true" tabindex="-1"></a><span class="fu">head</span>(l5)</span></code></pre></div>
<pre><code>## pu zone status
## 1 1 baiting 0
## 2 2 baiting 0
## 3 3 baiting 0
## 4 4 baiting 0
## 5 5 baiting 0
## 6 6 baiting 0</code></pre>
<div class="sourceCode" id="cb42"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create problem</span></span>
<span id="cb42-2"><a href="#cb42-2" aria-hidden="true" tabindex="-1"></a>p5 <span class="ot"><-</span> <span class="fu">problem</span>(pu4, <span class="fu">zones</span>(<span class="at">few.traps =</span> sim_features <span class="sc">*</span> <span class="fl">0.1</span>,</span>
<span id="cb42-3"><a href="#cb42-3" aria-hidden="true" tabindex="-1"></a> <span class="at">many.traps =</span> sim_features <span class="sc">*</span> <span class="fl">0.5</span>,</span>
<span id="cb42-4"><a href="#cb42-4" aria-hidden="true" tabindex="-1"></a> <span class="at">baiting =</span> sim_features <span class="sc">*</span> <span class="fl">0.8</span>,</span>
<span id="cb42-5"><a href="#cb42-5" aria-hidden="true" tabindex="-1"></a> <span class="at">feature_names =</span> <span class="fu">names</span>(sim_features))) <span class="sc">%>%</span></span>
<span id="cb42-6"><a href="#cb42-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_min_set_objective</span>() <span class="sc">%>%</span></span>
<span id="cb42-7"><a href="#cb42-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_manual_targets</span>(t4) <span class="sc">%>%</span></span>
<span id="cb42-8"><a href="#cb42-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_manual_locked_constraints</span>(l5) <span class="sc">%>%</span></span>
<span id="cb42-9"><a href="#cb42-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_binary_decisions</span>()</span>
<span id="cb42-10"><a href="#cb42-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb42-11"><a href="#cb42-11" aria-hidden="true" tabindex="-1"></a><span class="co"># print problem</span></span>
<span id="cb42-12"><a href="#cb42-12" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(p5)</span></code></pre></div>
<pre><code>## Conservation Problem
## zones: few.traps, many.traps, baiting (3 zones)
## planning units: RasterStack (100 units)
## cost: min: 0, max: 300
## features: layer.1, layer.2, layer.3, ... (5 features)
## objective: Minimum set objective
## targets: Absolute targets [targets (min: 8, max: 8)]
## decisions: Binary decision
## constraints: <Manually locked planning units [80 locked units]>
## penalties: <none>
## portfolio: default
## solver: default</code></pre>
<div class="sourceCode" id="cb44"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="co"># solve problem</span></span>
<span id="cb44-2"><a href="#cb44-2" aria-hidden="true" tabindex="-1"></a>s5 <span class="ot"><-</span> <span class="fu">solve</span>(p5)</span></code></pre></div>
<pre><code>## Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (linux64)
## Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
## Optimize a model with 105 rows, 300 columns and 1800 nonzeros
## Model fingerprint: 0x0d87ce25
## Variable types: 0 continuous, 300 integer (300 binary)
## Coefficient statistics:
## Matrix range [2e-02, 1e+00]
## Objective range [1e+02, 3e+02]
## Bounds range [1e+00, 1e+00]
## RHS range [1e+00, 8e+00]
## Found heuristic solution: objective 13600.000000
## Presolve removed 14 rows and 120 columns
## Presolve time: 0.00s
## Presolved: 91 rows, 180 columns, 360 nonzeros
## Found heuristic solution: objective 9600.0000000
## Variable types: 0 continuous, 180 integer (180 binary)
## Root relaxation presolved: 91 rows, 180 columns, 360 nonzeros
##
##
## Root relaxation: objective 6.938068e+03, 1 iterations, 0.00 seconds (0.00 work units)
##
## Nodes | Current Node | Objective Bounds | Work
## Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
##
## 0 0 6938.06815 0 1 9600.00000 6938.06815 27.7% - 0s
## H 0 0 7000.0000000 6938.06815 0.88% - 0s
## 0 0 6938.06815 0 1 7000.00000 6938.06815 0.88% - 0s
##
## Explored 1 nodes (1 simplex iterations) in 0.01 seconds (0.00 work units)
## Thread count was 1 (of 8 available processors)
##
## Solution count 3: 7000 9600 13600
##
## Optimal solution found (tolerance 1.00e-01)
## Best objective 7.000000000000e+03, best bound 7.000000000000e+03, gap 0.0000%</code></pre>
<div class="sourceCode" id="cb46"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="co"># calculate feature representation</span></span>
<span id="cb46-2"><a href="#cb46-2" aria-hidden="true" tabindex="-1"></a>r5 <span class="ot"><-</span> <span class="fu">eval_feature_representation_summary</span>(p5, s5)</span>
<span id="cb46-3"><a href="#cb46-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(r5)</span></code></pre></div>
<pre><code>## # A tibble: 20 × 5
## summary feature total_amount absolute_held relative_held
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 overall layer.1 117. 21.8 0.187
## 2 overall layer.2 43.7 8.04 0.184
## 3 overall layer.3 101. 17.7 0.176
## 4 overall layer.4 59.7 10.9 0.182
## 5 overall layer.5 79.4 15.2 0.192
## 6 few.traps layer.1 8.33 0 0
## 7 few.traps layer.2 3.12 0 0
## 8 few.traps layer.3 7.20 0 0
## 9 few.traps layer.4 4.27 0 0
## 10 few.traps layer.5 5.67 0 0
## 11 many.traps layer.1 41.6 7.40 0.178
## 12 many.traps layer.2 15.6 3.42 0.219
## 13 many.traps layer.3 36.0 6.00 0.167
## 14 many.traps layer.4 21.3 4.84 0.227
## 15 many.traps layer.5 28.4 5.26 0.186
## 16 baiting layer.1 66.6 14.4 0.217
## 17 baiting layer.2 25.0 4.62 0.185
## 18 baiting layer.3 57.6 11.7 0.203
## 19 baiting layer.4 34.1 6.05 0.177
## 20 baiting layer.5 45.4 9.98 0.220</code></pre>
<div class="sourceCode" id="cb48"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="co"># plot solution</span></span>
<span id="cb48-2"><a href="#cb48-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(<span class="fu">category_layer</span>(s5), <span class="at">main =</span> <span class="st">"solution"</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAIAAACb4TnXAAAACXBIWXMAAA7DAAAOwwHHb6hkAAARh0lEQVR4nO3dd3wUdd7A8d9vW3ZDKgEizSChSlEUAaUpB1ISRdS7BzgDSFPaIyDt5EFElHogXOAAARELKF2KPqBIi130hINDkCIoBEVJaIZsmfsjgCSZYMjmuwmbz/s1/zC7OzNAPpnZmf3NasMwFAAZlqLeACCYERggiMAAQQQGCCIwQBCBAYIIDBBEYIAgAgMEERggiMAAQQQGCCIwQBCBAYIIDBBEYIAgAgMEERggiMAAQQQGCCIwQBCBAYIIDBBEYIAgAgMEERggiMAAQQQGCCIwQBCBAYIIDBBEYAKMXxZ1cGqtLdHd1l3M74vOfjJ3+JAhQ4aOeWuft8ALQXFjK+oNQBbj/K5VyTPev2gp0+v+MZ1rWYt6e1A4CKy40qXuGTRrbkevdtSoby/qjUFBcYiYi3Fu7/Jnu7aoVT7S6XCGl6vWqOOg2dtPuLM9Je2bJf/XtUXt8pEuZ6nSleu37vHC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IDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBBEYIIjAAEEEBggiMEAQgQGCCAwQRGCAIAIDBP0XQ80M44yTnlgAAAAASUVORK5CYII=" style="display: block; margin: auto;" /></p>
</div>
<div id="multiple-zones-with-fragmentation-penalties" class="section level3">
<h3>Multiple zones with fragmentation penalties</h3>
<p>So now the best strategy seems to be a combination of high intensity trapping and baiting. But we can also see that this solution is fairly fragmented, so we can add penalties to cluster managed planning units together. Here we will add penalties that will cluster the planning units allocated to the two trapping zones together, and penalties that will cluster the planning units allocated to the baiting zone together. We will also set an overall penalty factor to 640 to strongly penalize fragmented solutions.</p>
<div class="sourceCode" id="cb49"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create matrix that describe boundary penalties between planning units</span></span>
<span id="cb49-2"><a href="#cb49-2" aria-hidden="true" tabindex="-1"></a><span class="co"># allocated to different zones</span></span>
<span id="cb49-3"><a href="#cb49-3" aria-hidden="true" tabindex="-1"></a>z6 <span class="ot"><-</span> <span class="fu">diag</span>(<span class="dv">3</span>)</span>
<span id="cb49-4"><a href="#cb49-4" aria-hidden="true" tabindex="-1"></a>z6[<span class="dv">1</span>, <span class="dv">2</span>] <span class="ot"><-</span> <span class="dv">1</span></span>
<span id="cb49-5"><a href="#cb49-5" aria-hidden="true" tabindex="-1"></a>z6[<span class="dv">2</span>, <span class="dv">1</span>] <span class="ot"><-</span> <span class="dv">1</span></span>
<span id="cb49-6"><a href="#cb49-6" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(z6) <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"few.traps"</span>, <span class="st">"many.traps"</span>, <span class="st">"baiting"</span>)</span>
<span id="cb49-7"><a href="#cb49-7" aria-hidden="true" tabindex="-1"></a><span class="fu">rownames</span>(z6) <span class="ot"><-</span> <span class="fu">colnames</span>(z6)</span>
<span id="cb49-8"><a href="#cb49-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb49-9"><a href="#cb49-9" aria-hidden="true" tabindex="-1"></a><span class="co"># print matrix</span></span>
<span id="cb49-10"><a href="#cb49-10" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(z6)</span></code></pre></div>
<pre><code>## few.traps many.traps baiting
## few.traps 1 1 0
## many.traps 1 1 0
## baiting 0 0 1</code></pre>
<div class="sourceCode" id="cb51"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create problem</span></span>
<span id="cb51-2"><a href="#cb51-2" aria-hidden="true" tabindex="-1"></a>p6 <span class="ot"><-</span> <span class="fu">problem</span>(pu4, <span class="fu">zones</span>(<span class="st">"few.traps"</span> <span class="ot">=</span> sim_features <span class="sc">*</span> <span class="fl">0.1</span>,</span>
<span id="cb51-3"><a href="#cb51-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"many.traps"</span> <span class="ot">=</span> sim_features <span class="sc">*</span> <span class="fl">0.5</span>,</span>
<span id="cb51-4"><a href="#cb51-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"baiting"</span> <span class="ot">=</span> sim_features <span class="sc">*</span> <span class="fl">0.8</span>,</span>
<span id="cb51-5"><a href="#cb51-5" aria-hidden="true" tabindex="-1"></a> <span class="at">feature_names =</span> <span class="fu">names</span>(sim_features))) <span class="sc">%>%</span></span>
<span id="cb51-6"><a href="#cb51-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_min_set_objective</span>() <span class="sc">%>%</span></span>
<span id="cb51-7"><a href="#cb51-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_manual_targets</span>(t4) <span class="sc">%>%</span></span>
<span id="cb51-8"><a href="#cb51-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_manual_locked_constraints</span>(l5) <span class="sc">%>%</span></span>
<span id="cb51-9"><a href="#cb51-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_boundary_penalties</span>(<span class="at">penalty =</span> <span class="dv">640</span>, <span class="at">zones =</span> z6) <span class="sc">%>%</span></span>
<span id="cb51-10"><a href="#cb51-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_binary_decisions</span>()</span>
<span id="cb51-11"><a href="#cb51-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb51-12"><a href="#cb51-12" aria-hidden="true" tabindex="-1"></a><span class="co"># print problem</span></span>
<span id="cb51-13"><a href="#cb51-13" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(p6)</span></code></pre></div>
<pre><code>## Conservation Problem
## zones: few.traps, many.traps, baiting (3 zones)
## planning units: RasterStack (100 units)
## cost: min: 0, max: 300
## features: layer.1, layer.2, layer.3, ... (5 features)
## objective: Minimum set objective
## targets: Absolute targets [targets (min: 8, max: 8)]
## decisions: Binary decision
## constraints: <Manually locked planning units [80 locked units]>
## penalties: <Boundary penalties [edge factor (min: 0.5, max: 0.5), penalty (640), zones]>
## portfolio: default
## solver: default</code></pre>
<div class="sourceCode" id="cb53"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a><span class="co"># solve problem</span></span>
<span id="cb53-2"><a href="#cb53-2" aria-hidden="true" tabindex="-1"></a>s6 <span class="ot"><-</span> <span class="fu">solve</span>(p6)</span></code></pre></div>
<pre><code>## Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (linux64)
## Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
## Optimize a model with 1905 rows, 1200 columns and 5400 nonzeros
## Model fingerprint: 0x9915d2c6
## Variable types: 0 continuous, 1200 integer (1200 binary)
## Coefficient statistics:
## Matrix range [2e-02, 1e+00]
## Objective range [1e+02, 6e+02]
## Bounds range [1e+00, 1e+00]
## RHS range [1e+00, 8e+00]
## Found heuristic solution: objective 20096.000000
## Presolve removed 1028 rows and 232 columns
## Presolve time: 0.06s
## Presolved: 877 rows, 968 columns, 2712 nonzeros
## Variable types: 0 continuous, 968 integer (968 binary)
## Found heuristic solution: objective 19632.000000
## Root relaxation presolved: 877 rows, 968 columns, 2712 nonzeros
##
##
## Root relaxation: objective 1.005410e+04, 568 iterations, 0.02 seconds (0.01 work units)
##
## Nodes | Current Node | Objective Bounds | Work
## Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
##
## 0 0 10054.0986 0 57 19632.0000 10054.0986 48.8% - 0s
## H 0 0 11300.000000 10054.0986 11.0% - 0s
## H 0 0 11140.000000 10054.0986 9.75% - 0s
##
## Explored 1 nodes (823 simplex iterations) in 0.11 seconds (0.04 work units)
## Thread count was 1 (of 8 available processors)
##
## Solution count 4: 11140 11300 19632 20096
##
## Optimal solution found (tolerance 1.00e-01)
## Best objective 1.114000000000e+04, best bound 1.005600000000e+04, gap 9.7307%</code></pre>
<div class="sourceCode" id="cb55"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a><span class="co"># calculate feature representation</span></span>
<span id="cb55-2"><a href="#cb55-2" aria-hidden="true" tabindex="-1"></a>r6 <span class="ot"><-</span> <span class="fu">eval_feature_representation_summary</span>(p6, s6)</span>
<span id="cb55-3"><a href="#cb55-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(r6)</span></code></pre></div>
<pre><code>## # A tibble: 20 × 5
## summary feature total_amount absolute_held relative_held
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 overall layer.1 117. 22.5 0.193
## 2 overall layer.2 43.7 8.11 0.186
## 3 overall layer.3 101. 18.0 0.178
## 4 overall layer.4 59.7 11.3 0.190
## 5 overall layer.5 79.4 15.7 0.198
## 6 few.traps layer.1 8.33 0 0
## 7 few.traps layer.2 3.12 0 0
## 8 few.traps layer.3 7.20 0 0
## 9 few.traps layer.4 4.27 0 0
## 10 few.traps layer.5 5.67 0 0
## 11 many.traps layer.1 41.6 8.00 0.192
## 12 many.traps layer.2 15.6 3.49 0.224
## 13 many.traps layer.3 36.0 6.24 0.174
## 14 many.traps layer.4 21.3 5.28 0.247
## 15 many.traps layer.5 28.4 5.72 0.202
## 16 baiting layer.1 66.6 14.4 0.217
## 17 baiting layer.2 25.0 4.62 0.185
## 18 baiting layer.3 57.6 11.7 0.203
## 19 baiting layer.4 34.1 6.05 0.177
## 20 baiting layer.5 45.4 9.98 0.220</code></pre>
<div class="sourceCode" id="cb57"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb57-1"><a href="#cb57-1" aria-hidden="true" tabindex="-1"></a><span class="co"># plot solution</span></span>
<span id="cb57-2"><a href="#cb57-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(<span class="fu">category_layer</span>(s6), <span class="at">main =</span> <span class="st">"solution"</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAIAAACb4TnXAAAACXBIWXMAAA7DAAAOwwHHb6hkAAARiklEQVR4nO3dd3wUdd7A8d9vWzYhlRZpBglViqIIKE05kJIoot49wEmRprRHQNrJg4go9UC4wAECIhZQuhR9QJEWu+gJB4cgRVAIipLQDNky90cA2WQSQzbfXdh83q/5h9ndmQHyyczO7G9WG4ahAMiwBHsDgFBGYIAgAgMEERggiMAAQQQGCCIwQBCBAYIIDBBEYIAgAgMEERggiMAAQQQGCCIwQBCBAYIIDBBEYIAgAgMEERggiMAAQQQGCCIwQBCBAYIIDBBEYIAgAgMEERggiMAAQQQGCCIwQBCBCTB+WdTeqbW2xHVbd7GgLzr7ydzhQ4YMGTrmrX2eQi8E1xtbsDcA2Yzzu1alzHj/oqV0r/vHdKppDfb2oGgQ2PVKl7hn0Ky5HTzaUb2ePdgbg8LiEDEX49ze5c92aV6zXIzT4YwqW7Vhh0Gzt59w+Twl/Zsl/9elea1yMeHOEiUr1WvV44VV+87m9V28ro+GJtq01o7GUw94Ls27uL5HSYvW2tlu4SnD+PWd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YP8w3jAUIAAAAASUVORK5CYII=" style="display: block; margin: auto;" /></p>
<p>Finally, it appears we might have a viable solution for this made-up conservation problem.</p>
</div>
<div id="multiple-zones-with-fragmentation-penalties-and-mandatory-allocations" class="section level3">
<h3>Multiple zones with fragmentation penalties and mandatory allocations</h3>
<p>Finally, we might be interested in conservation planning scenarios where every single planning unit must be allocated to a management zone. This is often the case when developing land-use plans where every single planning unit needs to be allocated to a specific management zone. Though it makes less sense here, let’s see what happens to the solution if we needed to do at least one form of control in every single planning unit.</p>
<div class="sourceCode" id="cb58"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="co"># create matrix that describe boundary penalties between planning units</span></span>
<span id="cb58-2"><a href="#cb58-2" aria-hidden="true" tabindex="-1"></a><span class="co"># allocated to different zones</span></span>
<span id="cb58-3"><a href="#cb58-3" aria-hidden="true" tabindex="-1"></a>p7 <span class="ot"><-</span> <span class="fu">problem</span>(pu4, <span class="fu">zones</span>(<span class="st">"few.traps"</span> <span class="ot">=</span> sim_features <span class="sc">*</span> <span class="fl">0.1</span>,</span>
<span id="cb58-4"><a href="#cb58-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"many.traps"</span> <span class="ot">=</span> sim_features <span class="sc">*</span> <span class="fl">0.5</span>,</span>
<span id="cb58-5"><a href="#cb58-5" aria-hidden="true" tabindex="-1"></a> <span class="st">"baiting"</span> <span class="ot">=</span> sim_features <span class="sc">*</span> <span class="fl">0.8</span>,</span>
<span id="cb58-6"><a href="#cb58-6" aria-hidden="true" tabindex="-1"></a> <span class="at">feature_names =</span> <span class="fu">names</span>(sim_features))) <span class="sc">%>%</span></span>
<span id="cb58-7"><a href="#cb58-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_min_set_objective</span>() <span class="sc">%>%</span></span>
<span id="cb58-8"><a href="#cb58-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_manual_targets</span>(t4) <span class="sc">%>%</span></span>
<span id="cb58-9"><a href="#cb58-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_mandatory_allocation_constraints</span>() <span class="sc">%>%</span></span>
<span id="cb58-10"><a href="#cb58-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_manual_locked_constraints</span>(l5) <span class="sc">%>%</span></span>
<span id="cb58-11"><a href="#cb58-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_boundary_penalties</span>(<span class="at">penalty =</span> <span class="dv">640</span>, <span class="at">zones =</span> z6) <span class="sc">%>%</span></span>
<span id="cb58-12"><a href="#cb58-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">add_binary_decisions</span>()</span>
<span id="cb58-13"><a href="#cb58-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb58-14"><a href="#cb58-14" aria-hidden="true" tabindex="-1"></a><span class="co"># print problem</span></span>
<span id="cb58-15"><a href="#cb58-15" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(p7)</span></code></pre></div>
<pre><code>## Conservation Problem
## zones: few.traps, many.traps, baiting (3 zones)
## planning units: RasterStack (100 units)
## cost: min: 0, max: 300
## features: layer.1, layer.2, layer.3, ... (5 features)
## objective: Minimum set objective
## targets: Absolute targets [targets (min: 8, max: 8)]
## decisions: Binary decision
## constraints: <Manually locked planning units [80 locked units]
## Mandatory allocation constraints [apply constraints? (1)]>
## penalties: <Boundary penalties [edge factor (min: 0.5, max: 0.5), penalty (640), zones]>
## portfolio: default
## solver: default</code></pre>
<div class="sourceCode" id="cb60"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb60-1"><a href="#cb60-1" aria-hidden="true" tabindex="-1"></a><span class="co"># solve problem</span></span>
<span id="cb60-2"><a href="#cb60-2" aria-hidden="true" tabindex="-1"></a>s7 <span class="ot"><-</span> <span class="fu">solve</span>(p7)</span></code></pre></div>
<pre><code>## Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (linux64)
## Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
## Optimize a model with 1905 rows, 1200 columns and 5400 nonzeros
## Model fingerprint: 0x3dc383b8
## Variable types: 0 continuous, 1200 integer (1200 binary)
## Coefficient statistics:
## Matrix range [2e-02, 1e+00]
## Objective range [1e+02, 6e+02]
## Bounds range [1e+00, 1e+00]
## RHS range [1e+00, 8e+00]
## Found heuristic solution: objective 19600.000000
## Presolve removed 1120 rows and 324 columns
## Presolve time: 0.05s
## Presolved: 785 rows, 876 columns, 2448 nonzeros
## Variable types: 0 continuous, 876 integer (876 binary)
## Found heuristic solution: objective 18988.000000
## Root relaxation presolved: 785 rows, 876 columns, 2448 nonzeros
##
##
## Root relaxation: objective 1.323093e+04, 265 iterations, 0.01 seconds (0.00 work units)
##
## Nodes | Current Node | Objective Bounds | Work
## Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
##
## 0 0 13230.9255 0 95 18988.0000 13230.9255 30.3% - 0s
## H 0 0 13260.000000 13230.9255 0.22% - 0s
##
## Explored 1 nodes (426 simplex iterations) in 0.07 seconds (0.03 work units)
## Thread count was 1 (of 8 available processors)
##
## Solution count 3: 13260 18988 19600
##
## Optimal solution found (tolerance 1.00e-01)
## Best objective 1.326000000000e+04, best bound 1.323200000000e+04, gap 0.2112%</code></pre>
<div class="sourceCode" id="cb62"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a><span class="co"># calculate feature representation</span></span>
<span id="cb62-2"><a href="#cb62-2" aria-hidden="true" tabindex="-1"></a>r7 <span class="ot"><-</span> <span class="fu">eval_feature_representation_summary</span>(p7, s7)</span>
<span id="cb62-3"><a href="#cb62-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(r7)</span></code></pre></div>
<pre><code>## # A tibble: 20 × 5
## summary feature total_amount absolute_held relative_held
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 overall layer.1 117. 23.4 0.201
## 2 overall layer.2 43.7 8.04 0.184
## 3 overall layer.3 101. 19.4 0.192
## 4 overall layer.4 59.7 10.9 0.182
## 5 overall layer.5 79.4 16.1 0.203
## 6 few.traps layer.1 8.33 5.92 0.711
## 7 few.traps layer.2 3.12 2.33 0.745
## 8 few.traps layer.3 7.20 5.25 0.730
## 9 few.traps layer.4 4.27 3.18 0.745
## 10 few.traps layer.5 5.67 4.00 0.706
## 11 many.traps layer.1 41.6 3.02 0.0725
## 12 many.traps layer.2 15.6 1.09 0.0700
## 13 many.traps layer.3 36.0 2.41 0.0670
## 14 many.traps layer.4 21.3 1.66 0.0779
## 15 many.traps layer.5 28.4 2.11 0.0743
## 16 baiting layer.1 66.6 14.4 0.217
## 17 baiting layer.2 25.0 4.62 0.185
## 18 baiting layer.3 57.6 11.7 0.203
## 19 baiting layer.4 34.1 6.05 0.177
## 20 baiting layer.5 45.4 9.98 0.220</code></pre>
<div class="sourceCode" id="cb64"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb64-1"><a href="#cb64-1" aria-hidden="true" tabindex="-1"></a><span class="co"># plot solution</span></span>
<span id="cb64-2"><a href="#cb64-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(<span class="fu">category_layer</span>(s7), <span class="at">main =</span> <span class="st">"solution"</span>, <span class="at">axes =</span> <span class="cn">FALSE</span>, <span class="at">box =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAIAAACb4TnXAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAQ6klEQVR4nO3deZzN9f7A8ffnbHPOmNWaXcZYSkKFIsqPQgrVvT/cSLYW/MK13bRJGy5xR6FIUhRZstQvJdu0p25cEtmLIWXGDI05y/f+McSMM8KZ9znMvJ6P849zvvP9fjGv+X7P9zvzHmNZlgDQYYv0DgBFGYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMUERggCICAxQRGKCIwABFBAYoIjBAEYEBiggMU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igiMEARgQGKCAxQRGCAIgIDFBEYoIjAAEUEBigiMEDRfwHJN+Bowhn7GAAAAABJRU5ErkJggg==" style="display: block; margin: auto;" /></p>
</div>
</div>
<div id="conclusion" class="section level2">
<h2>Conclusion</h2>
<p>Hopefully, this vignette has provided an informative introduction to building and solving problems with multiple zones. Although we have examined only a few different functions here, almost every single function for modifying conservation planning problems is compatible with problems that contain zones. It’s worth noting that working with multiple zones is a lot trickier than working with a single zone, so we would recommend playing around with the code in the <em>Examples</em> sections of the package documentation to help understand how functions work when applied to multiple zones.</p>
</div>
<div id="references" class="section level2 unnumbered">
<h2 class="unnumbered">References</h2>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-r25" class="csl-entry">
Cattarino, L., Hermoso, V., Carwardine, J., Adams, V.M., Kennard, M.J. & Linke, S. (2018). Information uncertainty influences conservation outcomes when prioritizing multi-action management efforts. <em>Journal of Applied Ecology</em>, Available at: https://doi.org/10.1111/1365–2664.13147.
</div>
<div id="ref-r27" class="csl-entry">
Klein, C.J., Tulloch, V.J., Halpern, B.S., Selkoe, K.A., Watts, M.E., Steinback, C., Scholz, A. & Possingham, H.P. (2013). Tradeoffs in marine reserve design: Habitat condition, representation, and socioeconomic costs. <em>Conservation Letters</em>, <em>6</em>, 324–332.
</div>
<div id="ref-r5" class="csl-entry">
Klein, C., Wilson, K., Watts, M., Stein, J., Berry, S., Carwardine, J., Smith, M.S., Mackey, B. & Possingham, H. (2009). Incorporating ecological and evolutionary processes into continental-scale conservation planning. <em>Ecological Applications</em>, <em>19</em>, 206–217.
</div>
<div id="ref-r4" class="csl-entry">
Margules, C.R. & Pressey, R.L. (2000). Systematic conservation planning. <em>Nature</em>, <em>405</em>, 243–253.
</div>
<div id="ref-r18" class="csl-entry">
Stigner, M.G., Beyer, H.L., Klein, C.J. & Fuller, R.A. (2016). Reconciling recreational use and conservation values in a coastal protected area. <em>Journal of Applied Ecology</em>, <em>53</em>, 1206–1214.
</div>
<div id="ref-r2" class="csl-entry">
Watts, M.E., Ball, I.R., Stewart, R.S., Klein, C.J., Wilson, K., Steinback, C., Lourival, R., Kircher, L. & Possingham, H.P. (2009). <span class="nocase">Marxan with Zones: Software for optimal conservation based land- and sea-use zoning</span>. <em>Environmental Modelling & Software</em>, <em>24</em>, 1513–1521.
</div>
<div id="ref-r26" class="csl-entry">
Wilson, K.A., Meijaard, E., Drummond, S., Grantham, H.S., Boitani, L., Catullo, G., Christie, L., Dennis, R., Dutton, I., Falcucci, A. & others. (2010). Conserving biodiversity in production landscapes. <em>Ecological Applications</em>, <em>20</em>, 1721–1732.
</div>
</div>
</div>
<!-- code folding -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>