return to the previous page

library(FLIsis)
data(hkneph)

# run a simulation (baseline sce. with default settings)
flisis <- FLIsis(namesim='70mmNoMPA' ,  set.paths= list(my.path.output="C:"),
            set.general= list(nbyears=10), set.rules= list(), set.stochast= list(nbiter=1))
flisis <- init(flisis)
simul(flisis)

# run a simulation (with a management rule e.g. MPA)
flisis <- FLIsis(namesim='70mmMPA' , 
           set.paths= list(my.path.output="C:"),
            set.general= list(nbyears=10),
             set.rules= list(closure.f=TRUE, closure.metiers= "all",closure.areas = c("23E6", "22E6", "22E7", "23E7", "20E8", "19E8"), 
               closure.seasons = c("feb", "mar", "apr", "may", "jun"), closure.years=c(2:10)),
                set.stochast= list(nbiter=1))
flisis <- init(flisis)
simul(flisis)

# run a simulation (with a management rule e.g. 130mm in mesh size )
flisis <- FLIsis(namesim='130mmNoMPA' , 
           set.paths= list(my.path.output="C:"),
            set.general= list(nbyears=10),
             set.rules= list(selectivity.f=TRUE, selectivity.values=c(130), selectivity.gears=c("OTBLN","TTBLN")),
                set.stochast= list(nbiter=1))
flisis <- init(flisis)
simul(flisis)

# run a simulation (with a combination of management rules e.g. 130mm in mesh size / MPA)
flisis <- FLIsis(namesim='130mmMPA' , 
           set.paths= list(my.path.output="C:"),
            set.general= list(nbyears=10),
             set.rules= list(selectivity.f=TRUE, selectivity.values=c(130), selectivity.gears=c("OTBLN","TTBLN"),
              closure.f=TRUE, closure.metiers= "all",closure.areas = c("23E6", "22E6", "22E7", "23E7", "20E8", "19E8"), 
               closure.seasons = c("feb", "mar", "apr", "may", "jun"), closure.years=c(2:10)),
                set.stochast= list(nbiter=1))
flisis <- init(flisis)
simul(flisis)


### per fleet-segment
FrenchTrawlers <- c("BenthicIntermediate","BenthicLarge","HakeIntermediate","HakeLarge","NephropsIntermediate","NephropsLarge")
FrenchNetters <- names(fleets) [grep("Net",names(fleets))]
SpanishTrawlers <- c(names(fleets) [grep("2029",names(fleets))], names(fleets) [grep("3039",names(fleets))])

#  IN the mpa
per.season <- TRUE
if(per.season==FALSE) ylimits <- list(nephrops=c(0,0.4),hake=c(0,4))
if(per.season==TRUE)  ylimits <- list(nephrops=c(0,0.2),hake=c(0,0.20))
par(mfrow=c(2,2))
par(mar=c(4,4,0.3,0.3)) # margin
par(mgp=c(2, 0.7, 0))  # margin line (labels)
for (spp in flisis@inputdata$STOCK.NAMES){
  for(typedata in c("Landings","Discards")){
  # 1. landings and discards in MPA region - MPA sce/no MPA sce
  plots (fleets.1, type.data= typedata, spp= spp, set.of.fleet.names= list(FrenchTrawlers,FrenchNetters,SpanishTrawlers),
        all.fleet.names= names(fleets.1), ylimits=ylimits[[spp]], leg.labels= c("FrenchTrawlers","FrenchNetters","SpanishTrawlers"),
         a.region= flisis@rules$closure.areas, exclude.region=FALSE, per.season= per.season)
  plots (fleets.2, type.data= typedata, spp= spp, set.of.fleet.names= list(FrenchTrawlers,FrenchNetters,SpanishTrawlers),
        all.fleet.names= names(fleets.2), ylimits=ylimits[[spp]], leg.labels= c("FrenchTrawlers","FrenchNetters","SpanishTrawlers"),
         a.region= flisis@rules$closure.areas, exclude.region=FALSE, add=TRUE, per.season= per.season)
title(spp)
}}

#  OUT the mpa i.e. set exclude.region to TRUE
per.season <- TRUE
if(per.season==FALSE) ylimits <- list(nephrops=c(0,0.4),hake=c(0,4))
if(per.season==TRUE)  ylimits <- list(nephrops=c(0,0.2),hake=c(0,0.20))
par(mfrow=c(2,2))
par(mar=c(4,4,0.3,0.3)) # margin
par(mgp=c(2, 0.7, 0))  # margin line (labels)
for (spp in flisis@inputdata$STOCK.NAMES){
  for(typedata in c("Landings","Discards")){
  # 1. landings and discards in MPA region - MPA sce/no MPA sce
  plots (fleets.1, type.data= typedata, spp= spp, set.of.fleet.names= list(FrenchTrawlers,FrenchNetters,SpanishTrawlers),
        all.fleet.names= names(fleets.1), ylimits=ylimits[[spp]], leg.labels= c("FrenchTrawlers","FrenchNetters","SpanishTrawlers"),
         a.region= flisis@rules$closure.areas, exclude.region=TRUE, per.season= per.season)
  plots (fleets.2, type.data= typedata, spp= spp, set.of.fleet.names= list(FrenchTrawlers,FrenchNetters,SpanishTrawlers),
        all.fleet.names= names(fleets.2), ylimits=ylimits[[spp]], leg.labels= c("FrenchTrawlers","FrenchNetters","SpanishTrawlers"),
         a.region= flisis@rules$closure.areas, exclude.region=TRUE, add=TRUE, per.season= per.season)
title(spp)
}}


 
efimas1/wp4/cs6/appr2/main/code.txt · Last modified: 2008/07/16 12:51 by fb
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki