This function modifies a discrete matrix to increase aggregation of SWF habitat categories, starting from an initial allocation of habitat (specified by swfCat) and non-habitat (specified by agriCat). The function follows a growing approach, where habitat seeds are clumped in two dimensions, while keeping the total habitat size constant.

swf.clumper.regular(
  Hmatrix = null.mt,
  swfCat,
  agriCat,
  foreCat = 3,
  Q,
  sigma,
  iterations = 20,
  kernelCl = 20,
  kernelRw = 20,
  NNeighbors = 0,
  maxDistance = 5,
  Density = "H",
  queensCase = FALSE,
  np = 1,
  deBug = FALSE
)

Arguments

Hmatrix

A matrix representing the initial habitat state.

swfCat

Integer representing habitat category in the matrix.

agriCat

Integer representing non-habitat category in the matrix.

foreCat

Integer representing fores (habitat) category in the matrix.

Q

Integer representing the number of cells to be moved in each kernel per iteration.

iterations

Number of iterations for the aggregation process.

kernelCl

Vertical size of the kernel for processing.

kernelRw

Horizontal size of the kernel for processing.

NNeighbors

Threshold of neighbours in a kernel below which habitat pixels are moved in a kernel.

maxDistance

Searching radius for habitat pixel aggregation.

Density

Strategy for selecting the cell as a gravity center. "H" to choose area with high habitat cover, "L" from low, "M" for median density.

queensCase

If TRUE, all 8 directions are considered for neighbors; if FALSE, only orthogonal neighbors are considered.

np

Number of cores for parallel processing.

deBug

If TRUE, debugging information is provided.