title | author | output | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Changes |
Lyndon Estes |
|
- Added (back) ability to select a subset of crops, based on target values passed into
targets
, viatradeoff_mod
,tradeoff_batch
, andpareto
. Switch is made ininput_handler
. - Reordered arguments in
tradeoff_mod
. - Added save for batch parameters to
tradeoff_batch
. - Added more plot flexibility (N crops plotted, colors) to
imp_plot
. - Added
heat
to create raster showing frequency of conversions. tradeoff_batch
passes out the bcode nowpareto
uses bcode passed fromtradeoff_batch
, and saves optitab to batch directory.tradeoff_batch
impact tables now come out as data.frames from both todisk TRUE and FALSE cases. Changes tobatch_param
made to accomodate (table rather than list). From the todisk=FALSE case, the output conversion tables are served as a list that is the second element of the output list.- Added
imp_sorter
function for selecting subsets of conversion maps and ordering them to correctly match names of selected impact tables. - Added new measures to
impact
for calculating total travel hours (impact_mod2
), and total biodiversity cost (impact_mod3
).
- Removed hard-coded
input_key
("ZA") intradeoff_batch
call totradeoff_mod
. - Fixed .tif append to
impacts_tab.rda
output fromtradeoff_batch
. - Fixed
tradeoff_batch
so thatimpacts_tab.rda
is a data.frame not a list. - Conversion tables from
tradeoff_batch
were being re-ordered because of random numbers/time-stamp structure inrun_code
. The run/batch/name is simplified and fixed, with corresponding changes totradeoff_batch
,tradeoff_mod
,pareto
.
-
Current production becomes non-spatial, adjusted with coefficient
-
Notes:
- currprod.rda is main file to read
-
Status: Done
-
-
Fraction available cropland needs to be incorporated
- Status:
- Done in
convert
- Done in
impacts
- Done in
- Status:
-
New biodiversity impact metric incorporated
- Status: Mostly - still need to change the biodiversity metric so that impact can be weighted evenly on protected weighted rarity and intactness
-
fetch_inputs
- including altering carbon-names.rda, dumping cropnames.rda entirely
- Updated fetch_inputs to read in convertible fraction data.table, and to find spatial metadata.
- Put in logic to check for equality of row number in input data.tables, and to call a halt if there are NAs in any of the inputs.
- removed datasets in R data folder, because they should be installed as part of library, and therefore not called with a specific path by this function. To allow users to generate their own data.
- All inputs now live under
external/data/[ID]
, and are read in directly from there. These changes are designed to separate model from R package structure.
- All inputs now live under
-
input_handler
yield_mod
- Name changed from
yield_mod_dt
- fixed to remove pp_curr from list of modified rasters
- noticed potential standardization issue
- renamed to just
yield_mod
- moved yield standardization to input_handler
- Name changed from
- added yield standardization here
- switched off one potential yield modification option
- all data.tables, including mask, reduced down to location with >0 farmable areas.
- key set on index of reduced mask
- cost/yield is performed on those areas only
- rearranged order of inputs to properly deal with recyled input list
- disabled yield modification function for now, on the assumption that this becomes an offline process for the time being. If ybeta_update is set to 1, model will halt.
-
targets
- name changed from
targets_dt
- replaced scheme for modifying current production with simple modification vector, which draws on vector of current production, with argument named
currprodmod
. - yield_mod argument removed.
- name changed from
-
constraints
- name changed from
contraints_dt
- allocation logic checked
- j loop in inner allocation loop replaced with data.table-centric code
- name changed from
-
convert
- Name changed from
convert_dt
- Replaced j for loop with data.table syntax
- Name changed from
-
impact
- Name changed from
impact_dt
- Modularized - impact metrics now calculated in sub-modules, except for total area converted.
- Revised metrics for cost - mean cost and cost/yield calculated also - these will be more appropriate than total cost
- New metrics for biodiversity, based on rarity. Several flavors to choose from - mean vegetation type rarity of converted pixels (0-1); rarity + protectedness (priority, 0 - 1); average intactness (0 - 1); mean of intactness and priority (the measure currently used by
constraints
); ha of forest reserves lost - Added additional biodiversityChanged biodiversity impact to be based on both intactness and rarity - i.e. run it on the cons prioritization layer.
- Reduced number of input arguments to 2 (il and conv).
- Name changed from
-
tradeoff_mod
- Updated to incorporate changes to 4 primary sub-modules.
-
tradeoff_batch
- Simplified (yield_mod disabled) and parallelized with foreach and doMC.
- Output saving options altered. Conversion tables written out without xy coordinates, to save disk space and write times.
- Outputs now write into
external/output
-
pareto
- Modularized
pareto_step
function created, removing this portion of code from inside main functionbatch_params
combines parameter permutations into matrix used bypareto
andtradeoff_batch
batch_stat
calculates summarizes impact metrics of interest from a batch run, which are fed tonon-dominator
.non-dominator
Separate function created for code that removes non-dominated solutions from output table of impacts- Function engine is
tradeoff_batch
.
- parameter returned with optimization table in output list
- Modularized