Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4af4df9
commit dde73a4
Showing
17 changed files
with
814 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
- ADDED mp.R: mp() | ||
|
||
- ADDED dispatch.R: flsval(), flival(), flpval(), flfval(), flqval() | ||
- RENAMED a4ampDispatch() to mpDispatch() | ||
|
||
- ADDED oem.R: sampling.eom(), perfect.oem() | ||
|
||
- ADDED sa.R: perfect.sa() | ||
|
||
- ADDED hcr.R: ices.hcr(), fixedF.hcr(), movingF.hcr() | ||
|
||
- ADDED iem.R: noise.iem() | ||
|
||
- ADDED is.R: tac.is(), effort.is() | ||
|
||
- ADDED tm.R: map.tm() | ||
|
||
- ADDED phcr.R: movingF.hcr() | ||
|
||
# TODO | ||
|
||
- Move xsa.sa to FLXSA. | ||
- FIX noise.iem for FLasher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# dispatch.R - DESC | ||
# mse/R/dispatch.R | ||
|
||
# Copyright European Union, 2018 | ||
# Author: Ernesto Jardim (EC JRC) <ernesto.jardim@ec.europa.eu> | ||
# Iago Mosqueira (EC JRC) <iago.mosqueira@ec.europa.eu> | ||
# | ||
# Distributed under the terms of the European Union Public Licence (EUPL) V.1.1. | ||
|
||
# dispatching | ||
|
||
flsval <- list(object="stk", test="!is(object, \"FLS\")", msg="\"stk must be of class FLStock\"") | ||
|
||
flival <- list(object="idx", test= "!is(object, \"FLIndices\")", msg="\"idx must be of class FLIndices\"") | ||
|
||
flpval <- list(object="hcrpars", test= "!is(object, \"FLPar\")", msg="\"hcrpars must be of class FLPar\"") | ||
|
||
flfval <- list(object="ctrl", test= "!is(object, \"fwdControl\")", msg="\"ctrl must be of class fwdControl\"") | ||
|
||
flqval <- list(object="flq", test= "!is(object, \"FLQuant\")", msg="\"flq must be of class FLQuant\"") | ||
|
||
# mpDispatch {{{ | ||
mpDispatch <- function(ioval, ...){ | ||
args <- list(...) | ||
method <- args$method | ||
args$method <- NULL | ||
# checks in | ||
for(i in ioval$iv){ | ||
object <- args[i$object] | ||
str <- paste("if(", i$test, ")", i$msg, sep=" ") | ||
eval(parse(text=str)) | ||
} | ||
# dispatch | ||
out <- do.call(method, args) | ||
# checks out | ||
for(i in ioval$ov){ | ||
object <- out[i$object] | ||
str <- paste("if(", i$test, ")", i$msg, sep=" ") | ||
eval(parse(text=str)) | ||
} | ||
out | ||
} # }}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# fb.R - DESC | ||
# mse/R/fb.R | ||
|
||
# Copyright European Union, 2018 | ||
# Author: Ernesto Jardim (EC JRC) <ernesto.jardim@ec.europa.eu> | ||
# Iago Mosqueira (EC JRC) <iago.mosqueira@ec.europa.eu> | ||
# | ||
# Distributed under the terms of the European Union Public Licence (EUPL) V.1.1. | ||
|
||
# hyperstability.fb {{{ | ||
hyperstability.fb <- function(ctrl, beta=1, maxF=2, alpha=maxF^(1-beta), tracking) { | ||
|
||
# Only operates on F targets - so nothing happens to TAC | ||
# This function creates a control file to be later used in the fwd() | ||
# function where two optional relations are established between | ||
# fishing effort and fishing mortality | ||
|
||
# Beta is in this MSE either 1 for a 1:1 linear relationship between | ||
# F and effort, if beta = 0.7, the relation is not linear and it can | ||
# mimick a hyperstability scenario. | ||
# alpha = maxF^(1-beta) # linear meets curve at maxF | ||
|
||
ctrl@trgtArray[ctrl@target[,"quantity"]=="f",,] <- alpha * ctrl@trgtArray[ctrl@target[,"quantity"]=="f",,]^beta | ||
list(ctrl=ctrl, tracking=tracking) | ||
|
||
} # }}} |
Oops, something went wrong.