Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. M=c(1,2,3)
  2. Ti=10 #number of times run simulation
  3. c=0.2
  4. A=5
  5. d=10
  6. d0=5
  7. s=0.5
  8. e=0.1
  9. p=0.6
  10. ER=e/A
  11. C1 = c*A*exp(-d/d0) #1 to 3
  12. C2 = c*A*exp(-d*s/d0) #1 to 2
  13. C3 = c*p*A*exp(-(1-s)*(d/d0)) # 2 to 3
  14. j=c(0:1)
  15. k=c(0:1)
  16. l=c(0:1)
  17. prb=prb[j]*prb[k]*prb[l]
  18.  
  19. for(i in 1:M[3]){ #Location
  20.  
  21. for(k in 1:Ti){ #Time length
  22.  
  23. M[3]=prb #inital colonization probability
  24. if (M[3] > 0) {
  25. prb[j]=M[3]*ER #then established
  26. } else if (C1 > 0) { #if not colonized/established
  27. prb[k]=C1 #prob 1 to 3
  28. } else if (C3 > 0) {
  29. prb[l]=C3 #prob 2 to 3
  30. } else (C1+C3+M[3] < 0)
  31. (prb=0)
  32. }
  33. }
  34. prb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement