[SHOULD ADD SECTIONS TO THIS OR CREATE A NEW VIGNETTE THAT IS TASK-BASED AND GIVES YAML FILES/SECTIONS FOR COMMON TASKS GENERATING 1 PROBLEM OR GENERATING 4 VARIANTS OR DOING TONS OF RUNS, ETC.]
The bdpg
package allows many different parameters for many different actions to be input through its parameters list. This R list can be built in any way you like, however, one very common way is to build a yaml file that is read and converted to an R (e.g., by running under tzar). While the parameters list doesn't have to be loaded in this way, the yaml file format provides a nicely structured way of viewing and explaining parameters and groups of parameters. Consequently, explanations in this vignette will be phrased in terms of yaml code that could produce their settings in the parameters list.
Sometimes sets of parameters will be ignored entirely when a related master boolean parameter is set in a particular way. This is designed to make it easy to switch off certain things in the yaml file without having to delete all of the related flags. This is particularly desirable during debugging when you may know that a problem has nothing to do with a certain set of parameters and you want the run to be done more quickly by skipping that part of the code. For example, some of the network metrics are very time-consuming to compute. If compute_network_metrics is set to FALSE, then all parameters related to network metrics will be ignored and the metrics will not be computed.
full_output_dir_with_slash: $$output_path$$ runset_description: | Small set of runs of a Xu hard scenario with error generation both on and off plus running simulated annealing and richness heuristic. runset_name: $$runset$$ runset_abbrev: "bdpgSingleRunForTestAndDebug" run_id: $$run_id$$
full_output_dir_with_slash: $$output_path$$
runset_description: | Small set of runs of a Xu hard scenario with error generation both on and off plus running simulated annealing and richness heuristic.
runset_name: $$runset$$
runset_abbrev: "bdpgSingleRunForTestAndDebug"
run_id: $$run_id$$
integerize_string: "round"
integerize_string: "round"
too_many_possible_links_error_flag_file_name: $$output_path$$too_many_possible_links_error_flag_file.txt
too_many_possible_links_error_flag_file_name: $$output_path$$too_many_possible_links_error_flag_file.txt
# summary_filename: prob_diff_results.csv # summary_without_run_id_filename: prob_diff_results_with_0_run_id.csv
# summary_filename: prob_diff_results.csv
# summary_without_run_id_filename: prob_diff_results_with_0_run_id.csv
set_rand_seed_at_creation_of_all_new_major_objects: FALSE bdpg_run_init_rand_seed: 1763688087
set_rand_seed_at_creation_of_all_new_major_objects: FALSE
bdpg_run_init_rand_seed: 1763688087 ``` -------------------------------------------------------------------------------- # Xu benchmark problems If you're reading the Xu problem from a file in Xu's benchmark problem file format instead of generating it, you need to give the input file name and the cost of the correct solution (since it's not specified in the file). ### Example ```yaml read_Xu_problem_from_Xu_bench_file: TRUE Xu_bench_infile_name: "/Users/bill/D/Projects/ProblemDifficulty/data/Xu - problem difficulty datasets/frb30-15-msc with MSC 420/frb30-15-1.msc" #"/Users/bill/Desktop/Papers downloaded/Problem difficulty/Problem difficulty datasets/Xu - problem difficulty datasets/frb30-15-msc with MSC 420/frb30-15-1.msc" given_correct_solution_cost: 420
read_Xu_problem_from_Xu_bench_file: TRUE
Xu_bench_infile_name: "/Users/bill/D/Projects/ProblemDifficulty/data/Xu - problem difficulty datasets/frb30-15-msc with MSC 420/frb30-15-1.msc"
given_correct_solution_cost: 420
do_gurobi: TRUE use_given_time_as_limit: TRUE time_limit: 600 use_marxan_time_as_limit: FALSE use_gap_limit: TRUE gap_limit: 0.005
do_gurobi: TRUE
use_given_time_as_limit: TRUE
use_marxan_time_as_limit: FALSE
use_given_time_as_limit: TRUE
use_gap_limit: TRUE
gap_limit: 0.005
run_marxan: TRUE marxan_runmode: 1 marxan_heurtype: -1 # marxan control parameters # # If marxan_use_default_input_parameters is TRUE, then all of these # marxan_... parameters set in this file are ignored and marxan's # default values are used instead. # The one exception to this is the variable marxan_spf_const, # which is a bit different from all the other parameters and is set # in the just below the marxan_... parameters in this file. marxan_use_default_input_parameters: FALSE # marxan_input_parameters_file_name: "/Users/bill/D/Marxan/input.dat" marxan_input_parameters_file_name: "$$library_path(marxanLibrary)$$input.dat" marxan_dir: "$$library_path(marxanLibrary)$$" # marxan_input_dir: "$$library_path(marxanLibrary)$$input/" # marxan_output_dir: "$$library_path(marxanLibrary)$$output/" marxan_pu_file_name: "pu.dat" marxan_spec_file_name: "spec.dat" marxan_puvspr_file_name: "puvspr.dat" marxan_num_reps: 100 marxan_num_iterations: "1000000" # marxan_num_reps: 1 # marxan_num_iterations: "10000" marxan_spf_rule: "POWER_OF_10"
run_marxan: TRUE
marxan_runmode: 1
marxan_heurtype: -1
marxan_use_default_input_parameters: FALSE
marxan_input_parameters_file_name: "$$library_path(marxanLibrary)$$input.dat"
marxan_dir: "$$library_path(marxanLibrary)$$"
marxan_pu_file_name: "pu.dat"
marxan_spec_file_name: "spec.dat"
marxan_puvspr_file_name: "puvspr.dat"
marxan_num_reps: 100
marxan_num_iterations: "1000000"
marxan_spf_rule: "POWER_OF_10"
# NOTE that the choice of random seed in the yaml file is important # for this single run test because the example creates a test problem # based on drawing the control parameters from a random distribution. # When the seed was 111, the test crashed with the message below. # When I changed it to 701, it ran to completion. # Failing: max_possible_tot_num_links ( 3291 ) > maximum allowed ( 2000 ). # Save workspace image to ~/D/rdv-framework/projects/rdvPackages/biodivprobgen/.RData? [y/n/c]: # However, the fail was just what it was supposed to do when those # parameters came up, so the yaml file could be changed to use 111 # instead of 701 if you want to induce a crash to test that error # trapping. # seed: 701 # 2017 12 06 - BTL # Instead, you could just set the total number of links or spp # to some tiny amount that was sure to fail. max_allowed_possible_tot_num_links: 1500 max_allowed_num_spp: 2000 derive_alpha_from_n__num_groups_and_opt_frac_0.5: FALSE use_unif_rand_alpha__: FALSE alpha__: 0.52 use_unif_rand_n__num_groups: TRUE n__num_groups_lower_bound: 61 n__num_groups_upper_bound: 62 # n__num_groups_upper_bound: 80 # use_unif_rand_n__num_groups: TRUE # n__num_groups_lower_bound: 8 # n__num_groups_upper_bound: 100 use_unif_rand_r__density: FALSE r__density: 0.8 # use_unif_rand_r__density: TRUE # r__density_lower_bound: 0.01 # r__density_upper_bound: 5.0 use_unif_rand_p__prop_of_links_between_groups: TRUE p__prop_of_links_between_groups_lower_bound: 0.01 p__prop_of_links_between_groups_upper_bound: 0.99 #-------------------- # Parameters for building a multi-problem by wrapping a lognormal # distribution around a base Xu problem. gen_multi_bdproblem: TRUE wrap_lognormal_dist_around_Xu: TRUE allow_imperfect_wrap: TRUE # new variable - BTL - 2017 12 13 desired_Xu_spp_frac_of_all_spp: 0.5 solution_frac_of_landscape: 0.3 desired_max_abundance_frac: 0.7 dep_set_PUs_eligible: FALSE add_one_to_lognormal_abundances: FALSE # seed_value_for_search: 11 # no longer set this way - BTL - 2017 12 13 max_search_iterations: 500 plot_rounded_abundances: TRUE
max_allowed_possible_tot_num_links: 1500
max_allowed_num_spp: 2000
gen_4_basic_variants: TRUE single_action_using_tzar_reps: FALSE #TRUE
gen_4_basic_variants: TRUE
single_action_using_tzar_reps: FALSE #TRUE
derive_alpha_from_n__num_groups_and_opt_frac_0.5: FALSE use_unif_rand_alpha__: FALSE alpha__: 0.52 use_unif_rand_n__num_groups: TRUE n__num_groups_lower_bound: 61 n__num_groups_upper_bound: 62 # n__num_groups_upper_bound: 80 # use_unif_rand_n__num_groups: TRUE # n__num_groups_lower_bound: 8 # n__num_groups_upper_bound: 100 use_unif_rand_r__density: FALSE r__density: 0.8 # use_unif_rand_r__density: TRUE # r__density_lower_bound: 0.01 # r__density_upper_bound: 5.0 use_unif_rand_p__prop_of_links_between_groups: TRUE p__prop_of_links_between_groups_lower_bound: 0.01 p__prop_of_links_between_groups_upper_bound: 0.99
derive_alpha_from_n__num_groups_and_opt_frac_0.5: FALSE
use_unif_rand_alpha__: FALSE
alpha__lower_bound - Definition - Type/Allowed values - Default value - Rules
# alpha__lower_bound: 0.2
# alpha__upper_bound: 0.3
alpha__: 0.52
use_unif_rand_n__num_groups: TRUE
# n__num_groups_lower_bound: 61
n__num_groups_upper_bound: 62
n__num_groups: 50
use_unif_rand_r__density: FALSE
r__density: 0.8
# r__density_lower_bound: 0.01
use_unif_rand_p__prop_of_links_between_groups: TRUE
p__prop_of_links_between_groups_lower_bound: 0.01
p__prop_of_links_between_groups_upper_bound: 0.99
# p__prop_of_links_between_groups: 0.5
Parameters for building a multi-problem by wrapping a lognormal distribution around a base Xu problem.
gen_multi_bdproblem: TRUE wrap_lognormal_dist_around_Xu: TRUE allow_imperfect_wrap: TRUE # new variable - BTL - 2017 12 13 desired_Xu_spp_frac_of_all_spp: 0.5 solution_frac_of_landscape: 0.3 desired_max_abundance_frac: 0.7 dep_set_PUs_eligible: FALSE add_one_to_lognormal_abundances: FALSE max_search_iterations: 500 plot_rounded_abundances: TRUE
gen_multi_bdproblem: TRUE
wrap_lognormal_dist_around_Xu: TRUE
allow_imperfect_wrap: TRUE # new variable - BTL - 2017 12 13
desired_Xu_spp_frac_of_all_spp: 0.5
solution_frac_of_landscape: 0.3
desired_max_abundance_frac: 0.7
dep_set_PUs_eligible: FALSE
add_one_to_lognormal_abundances: FALSE
max_search_iterations: 500
plot_rounded_abundances: TRUE
apply_error_to_spp_occupancy_data: TRUE # match_error_counts: TRUE match_error_counts: FALSE #-------------------- # Constant errors spp_occ_FP_error_type: "CONSTANT" spp_occ_FP_const_rate: 0 #0.05 #0 #0.1 spp_occ_FN_error_type: "CONSTANT" spp_occ_FN_const_rate: 0.05 #0.1 #0.1
apply_error_to_spp_occupancy_data: TRUE
match_error_counts: FALSE
spp_occ_FP_error_type: "CONSTANT"
spp_occ_FP_const_rate: 0 #0.05 #0 #0.1
spp_occ_FN_error_type: "CONSTANT"
spp_occ_FN_const_rate: 0.05 #0.1 #0.1
compute_network_metrics: FALSE # if FALSE, overrides all other network flags below compute_network_metrics_COR: TRUE compute_network_metrics_APP: TRUE compute_network_metrics_wrapped_COR: TRUE compute_network_metrics_wrapped_APP: TRUE use_igraph_metrics: TRUE use_bipartite_metrics: TRUE #bipartite_metrics_to_use: "ALLBUTDD" # bipartite_metrics_to_use: "all_except_slow_indices" bipartite_metrics_to_use: "quick_test"
compute_network_metrics: FALSE # if FALSE, overrides all other network flags below
compute_network_metrics_COR: TRUE
compute_network_metrics_APP: TRUE
compute_network_metrics_wrapped_COR: TRUE
compute_network_metrics_wrapped_APP: TRUE
use_igraph_metrics: TRUE
use_bipartite_metrics: TRUE
bipartite_metrics_to_use: "quick_test"
TEMPLATE
END TEMPLATE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.