rtMoveReflectNoGo: movement with NoGo areas, to cells NESW, reflecting...

Description Usage Arguments Value Examples

Description

rtMoveReflectNoGo moves proportion of popn in each cell to the 4 neighbouring cells. 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
rtMoveReflectNoGo(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)),
  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

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
rtMoveReflectNoGo(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
rtMoveReflectNoGo(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
rtMoveReflectNoGo(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
rtMoveReflectNoGo(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.