library(stockassessment)
load("run/model.RData")
FC<-list()

Ry<-2020:2024     # latest 5 years as recommended from ADGdeep 2022 (wgdeep2023) 
Fsq<-0.798       # F2025 - latest value from SAM  
Blim<-9340		# Blim reference point
Bpa<-11627		# Bpa, MSYBtrigger reference point
yearbase<- 2025   # assessment year-1
Fslide<-0.16   # Fmsy*SSB2027/MSYBtrigger
Fmsy<- 0.23     # Fmsy refeence point

 
set.seed(12345)
FC[[length(FC)+1]]  <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA, NA,Fslide, Fmsy, Fmsy, Fmsy), catchval=c(6709,5707,NA,NA,NA,NA),  rec.years=Ry, label="Fmsy*SSB2027/MSY Btrigger", processNoise=FALSE,addTSB=TRUE, year.base=yearbase, savesim=TRUE)
set.seed(12345)
FC[[length(FC)+1]]  <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA, NA,Fsq,Fsq,Fsq,Fsq),catchval=c(6709,5707,NA,NA,NA,NA), rec.years=Ry, label="Fsq all years", processNoise=FALSE,addTSB=TRUE, year.base=yearbase, savesim=TRUE) 
set.seed(12345)
FC[[length(FC)+1]] <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA,NA,NA,NA,NA,NA),catchval=c(6709,5707,0,0,0,0), rec.years=Ry, label="zero catch", processNoise=FALSE, addTSB=TRUE, year.base=yearbase, savesim=TRUE)
set.seed(12345)
FC[[length(FC)+1]] <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA,NA,0.23, 0.23,0.23, 0.23),catchval=c(6709,5707,NA,NA,NA,NA), rec.years=Ry, label="Fmsy", processNoise=FALSE, addTSB=TRUE, year.base=yearbase, savesim=TRUE)
set.seed(12345)
FC[[length(FC)+1]] <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA,NA,0.60, 0.60,0.60, 0.60),catchval=c(6709,5707,NA,NA,NA,NA), rec.years=Ry, label="Fpa", processNoise=FALSE, addTSB=TRUE, year.base=yearbase, savesim=TRUE)
set.seed(12345)
FC[[length(FC)+1]]  <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA,NA,NA,Fmsy,Fmsy,Fmsy),catchval=c(6709,5707,NA,NA,NA,NA), nextssb = c(NA,NA,Blim,NA,NA,NA),label = "SSB2028=Blim", rec.years=Ry, processNoise=FALSE, addTSB=TRUE, year.base=yearbase, savesim=TRUE)
#set.seed(12345)
#FC[[length(FC)+1]]  <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA,NA,NA,Fmsy,Fmsy,Fmsy), catchval=c(6709,5707,NA,NA,NA,NA), nextssb = c(NA,NA,Bpa,NA,NA,NA), label = "SSB2028=Bpa", rec.years=Ry,  #processNoise=FALSE, addTSB=TRUE, year.base=yearbase, savesim=TRUE)
set.seed(12345)
FC[[length(FC)+1]]  <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA,NA,NA,Fmsy,Fmsy,Fmsy), catchval=c(6709,5707,NA,NA,NA,NA), nextssb = c(NA,NA,7053,NA,NA,NA), label = "SSB2028=SSB2027", rec.years=Ry,  processNoise=FALSE, addTSB=TRUE, year.base=yearbase, savesim=TRUE)
#set.seed(12345)
#FC[[length(FC)+1]]  <- forecast(fit, fscale=c(NA,NA,NA,NA,NA,NA), fval=c(NA,NA,NA,Fmsy,Fmsy,Fmsy), catchval=c(6709,5707,NA,NA,NA,NA), nextssb = c(NA,NA,11627,NA,NA,NA), label = "SSB2028=MSY Btrigger", #rec.years=Ry,  processNoise=FALSE, addTSB=TRUE, year.base=yearbase, savesim=TRUE)




save(FC, file="run/forecast.RData")

