Skip to content

Commit cd3fdb6

Browse files
Dev: adjust search to ignore SS missfit
Adjust search to adapt to SS not achieving specified fixed F inputs.
1 parent f0d53e9 commit cd3fdb6

1 file changed

Lines changed: 19 additions & 18 deletions

File tree

Allocation_forecasting.R

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -798,20 +798,21 @@ run.projections<-function(Assessment_dir, #Here you set the location of a previo
798798
loop <- loop - 1
799799
}else{
800800

801-
if(max(abs(achieved.report[,'F']-forecast_F[,"Catch or F"])[adjusted_F_OFL])>0.1){
802-
if(fitting_Fixed_Catch==TRUE){
803-
if(Catch_trunc >= (forecast$Nforecastyrs - 20)){
804-
Catch_trunc <- Catch_trunc + 1
805-
}else{
806-
Catch_trunc <- Catch_trunc + 5
807-
}
808-
Catch_Target[(forecast$Nforecastyrs-c((Catch_trunc-1):0))] <- 0
809-
forecast_F[(length(forecast_F[,1])-c((Catch_trunc*length(seasons)*length(F_cols)-1):0)),4] <- 0
810-
}
811-
F_maxed <- max(achieved.report[,'F'])
812-
forecast_F[,4] <- achieved.report[,'F']
813-
loop <- loop - 1
814-
}else {
801+
# if(max(abs(achieved.report[,'F']-forecast_F[,"Catch or F"])[adjusted_F_OFL])>0.1){
802+
# if(fitting_Fixed_Catch==TRUE){
803+
# if(Catch_trunc >= (forecast$Nforecastyrs - 20)){
804+
# Catch_trunc <- Catch_trunc + 1
805+
# }else{
806+
# Catch_trunc <- Catch_trunc + 5
807+
# }
808+
# Catch_Target[(forecast$Nforecastyrs-c((Catch_trunc-1):0))] <- 0
809+
# forecast_F[(length(forecast_F[,1])-c((Catch_trunc*length(seasons)*length(F_cols)-1):0)),4] <- 0
810+
# }
811+
# F_maxed <- max(achieved.report[,'F'])
812+
# forecast_F[,4] <- achieved.report[,'F']
813+
# loop <- loop - 1
814+
# }else
815+
{
815816
if(fitting_Benchmark==TRUE){
816817

817818
#Calculate the average F at equilibrium that all F's will be scaled to in order
@@ -1362,11 +1363,11 @@ run.projections<-function(Assessment_dir, #Here you set the location of a previo
13621363
zero_Fs <- which(forecast_F[,4]==0)
13631364
increase_Fs <- which(Comb_Mult>1)
13641365
if(length(zero_Fs)>0 & length(increase_Fs)>0){
1365-
mod_Fs <- zero_Fs[is.element(zero_Fs,increase_Fs)]
1366+
mod_Fs <- zero_Fs[which(is.element(zero_Fs,increase_Fs))]
13661367
if(length(mod_Fs)>0){
1367-
message("F value being reset from 0 to 0.0005 this shouldn't happen so check results")
1368-
forecast_F[mod_Fs,4] <- 0.0005
1369-
Comb_Mult[mod_Fs] <- 1.01
1368+
message("F values being reset from 0 to initial average this shouldn't happen so check results")
1369+
forecast_F[mod_Fs,4] <- Forecast_catch_setup[mod_Fs,4]
1370+
Comb_Mult[mod_Fs] <- runif(length(mod_Fs),0.95,1.05)
13701371
}
13711372
}
13721373
forecast_F[,4] <- forecast_F[,4]*Comb_Mult

0 commit comments

Comments
 (0)