probs = c(.1,.6,.3)
vals = c(1,2,3)
arrPois = c(7,4,2)
tiers= c(1.1,1,.75)
nreps =100
fish = data.frame(matrix(ncol=3,nrow=0))
colnames(fish)=c("Total","Bluefin","Yellowfin")
for (i in 1:nreps) {
i = sample(x=vals,size=1,replace=TRUE,prob=probs)
lam=arrPois[i]
numfish= rpois(n=1,lambda=lam)
yprobs=c(.25,.5,.25)
yvals = c(0,.25,.35)
ypor= sample(x=yvals,size=1,replace=TRUE, prob=yprobs)
b= round(numfish - (1-ypor))
y= numfish - b
yweigh=rnorm(n=y,30,18)
yweigh=yweigh[yweigh>20]
sy=sum(yweigh)
bweigh=rnorm(n=b,35,18)
bweigh=bweigh[bweigh>20]
sb=sum(bweigh)
m=tiers[i]
EYy=msy
EYb=msb
total= EYy+EYb
fish[nrow(fish)+1,]=c(total,EYb,EYy)
}