R/ibm-predation.R

Defines functions localPredationInteractions

localPredationInteractions = function(pop, R, N=NULL, P=NULL) {
  pred = localIntegration(x=.getMatrix(x=pop$N, size=N), 
                          y=.getMatrix(x=pop$P, size=P), 
                          R1=R$N, R2=R$P)
  NP = pred$x 	# number of predators near to each prey
  PN = pred$y		# number of preys near to each predator
  return(list(NP=NP, PN=PN))
}

Try the ibm package in your browser

Any scripts or data that you put into this service are public.

ibm documentation built on May 29, 2024, 6:33 a.m.