rtMoveReflectNoGoVegBoundary: movement affected by vegetation and NoGo areas, to cells...

Description Usage Arguments Value Examples

Description

rtMoveReflectNoGoVegBoundary moves proportion of popn in each cell to the 4 neighbouring cells. The number of movers out is influenced by vegetation. Movers are divided equally between the 4 cardinal neighbours. If any of the neighboring cells are no-go areas the flies that would have moved there stay in their current cell. Thus movement to the other neighbouring cells will not be increased in this time step. But it will be increased in following time steps because the neighbouring cells will receive a proportion of the flies that didn't move to the nogo area in the preceeding timestep. This could represent flies turning back from an unpleasant area in one timestep and then trying other directions later. Boundaries are reflecting. This function works on a single age class, it can be made to work on multiple age classes by passing an array[y,x,age] to aaply(.margins=3) Doesn't try to cope with nrow or ncol==1.

Usage

1
2
3
4
rtMoveReflectNoGoVegBoundary(m = array(c(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0),
  dim = c(3, 4)), mNog = NULL, mVegMove = NULL, mVegCats = array(c("O",
  "O", "O", "O", "S", "O", "O", "O", "O", "O", "O", "O"), dim = c(3, 4)),
  iBestVeg = 4, pMove = 0.4, verbose = FALSE)

Arguments

m

a matrix of cells containing a single number representing one age

mNog

a matrix of cells of 0&1, 0 for nogo areas

mVegMove

a matrix of vegetation movement modifiers >1 increases movement out of the cell, <1 decreases movement out of the cell

mVegCats

a matrix of vegetation categories

iBestVeg

which is the preferred vegetation number (1-5) for this species

pMove

proportion of popn that moves out of the cell.

verbose

print what it's doing T/F

Value

an updated matrix following movement

Examples

1
2
3
4
5
6
7
8
#1 nogo neighbour
rtMoveReflectNoGoVegBoundary(m = array(c(0,0,0,0,1,0,0,0,0,0,0,0),dim=c(3,4)), mNog = array(c(1,0,1,1,1,1,1,1,1,1,1,1),dim=c(3,4)), verbose=TRUE)
#2 nogo neighbours
rtMoveReflectNoGoVegBoundary(m = array(c(0,0,0,0,1,0,0,0,0,0,0,0),dim=c(3,4)), mNog = array(c(1,0,1,0,1,1,1,1,1,1,1,1),dim=c(3,4)), verbose=TRUE)
#3 nogo neighbours
rtMoveReflectNoGoVegBoundary(m = array(c(0,0,0,0,1,0,0,0,0,0,0,0),dim=c(3,4)), mNog = array(c(1,0,1,0,1,0,1,1,1,1,1,1),dim=c(3,4)), verbose=TRUE)
#4 nogo neighbours, all flies stay
rtMoveReflectNoGoVegBoundary(m = array(c(0,0,0,0,1,0,0,0,0,0,0,0),dim=c(3,4)), mNog = array(c(1,0,1,0,1,0,1,0,1,1,1,1),dim=c(3,4)), verbose=TRUE)

AndySouth/rtsetse documentation built on May 5, 2019, 6:02 a.m.