DanOvando / marlin

A package for simulating 2-D populations of fauna, fisheries, and marine protected areas
https://danovando.github.io/marlin
Mozilla Public License 2.0
3 stars 3 forks source link

Optimize MPA vignette - Questionable result? #82

Closed echelleburns closed 5 months ago

echelleburns commented 1 year ago

There is a result in the Open Access and MPAs section that I feel does not make sense with the commentary in this vignette. In chunk 4:

set.seed(42)
#specify some MPA locations
mpa_locations <- expand_grid(x = 1:resolution, y = 1:resolution) %>%
mutate(mpa = x > 4 & y < 6)

with_mpa <- simmar(fauna = fauna,
                  fleets = fleets,
                  years = years,
                  manager = list(mpas = list(locations = mpa_locations,
              mpa_year = floor(years * .5))))

proc_mpa_sim <- process_marlin(with_mpa)

proc_mpa_sim$fleets %>% 
  pivot_longer(contains("_effort"), names_to = "fleet2", values_to = "effort") %>% 
  group_by(step, fleet2) %>%
  summarise(effort = sum(effort)) %>% 
  ggplot(aes(step * time_step, effort, color = fleet2)) + 
  geom_line() + 
  scale_x_continuous(name = "year")

My plot output looks like below. Is that correct? image

DanOvando commented 1 year ago

Huh are you talking about this figure here? Is the flat line what you're seeing when you run it locally?

https://danovando.github.io/marlin/articles/fleet-management_files/figure-html/unnamed-chunk-4-1.png