create_adj_matrix_with_spp_rows_vs_PU_cols: Create adjacency matrix with species rows vs planning unit...

create_adj_matrix_with_spp_rows_vs_PU_colsR Documentation

Create adjacency matrix with species rows vs planning unit columns

Description

Create numeric adjacency matrix with one row for each species and one column for each planning unit and each matrix entry specifying whether that species occupies that planning unit. A 1 indicates the species does occupy the planning unit and 0 indicates it does not.

Usage

create_adj_matrix_with_spp_rows_vs_PU_cols(
  num_spp,
  num_PUs,
  PU_spp_pair_indices,
  PU_costs,
  spp_col_name,
  PU_col_name,
  dependent_node_IDs,
  correct_solution_vector_is_known
)

Arguments

num_spp

integer number of species in the problem

num_PUs

integer number of planning units

PU_spp_pair_indices

2 column data frame of PU IDs vs species IDs, where each row identifies a the ID of a given species that occurs on the given planning unit

PU_costs

numeric vector of planning unit costs

spp_col_name

character string giving species column name in data frames

PU_col_name

character string giving planning unit column name in data frames

dependent_node_IDs

integer vector of IDs of planning units contained in a constructed correct solution to a Xu problem

correct_solution_vector_is_known

boolean flag indicating whether a correct optimal solution vector is known for the problem (as opposed for example, to only knowing the correct cost)

Value

Returns bpm; integer matrix with one row for each species and one column for each planning unit. Each matrix entry specifies whether that species occupies that planning unit; 1 indicates the species does occupy the planning unit and 0 indicates it does not.


langfob/bdpg documentation built on Dec. 8, 2022, 5:33 a.m.