poseidon-fisheries / POSEIDON

A model of fish, fishers and fisheries
GNU General Public License v3.0
13 stars 7 forks source link

make sure SpecificProtectedAreas are initialized correctly #82

Closed nicolaspayette closed 2 years ago

nicolaspayette commented 2 years ago

The main change is that those regulations don't rely on the SeaTile having a reference to the MPA's geometry object anymore. Every protected area has an inArea array, indexed by grid coordinates, and that's all that matters. That makes it easy to share areas between simulations and saves us from having to call recomputeTilesMPA on the map when they're initialized.

The main downside is that we don't see areas as grey zones in the GUI anymore, but that's fixable, albeit low-priority.

I also added a pair of test that checks, for a set of points including one in each EEZ, that regulations are applied correctly. That made me realize that GeoMason was reading only the first polygon in multipolygon shapes. I fixed that upstream (in https://github.com/poseidon-fisheries/tuna/commit/e9fdbe26ced2f28d72b1615c882bcfa4200c41d7) by taking only the largest polygon in each EEZ.

codecov-commenter commented 2 years ago

Codecov Report

Merging #82 (9cf7489) into master (e94b41a) will decrease coverage by 0.03%. The diff coverage is 47.58%.

@@             Coverage Diff              @@
##             master      #82      +/-   ##
============================================
- Coverage     39.23%   39.19%   -0.04%     
- Complexity     8077     8085       +8     
============================================
  Files          1565     1567       +2     
  Lines         60404    60485      +81     
  Branches       6210     6216       +6     
============================================
+ Hits          23699    23710      +11     
- Misses        34973    35041      +68     
- Partials       1732     1734       +2     
Impacted Files Coverage Δ
...ish/experiments/tuna/abundance/ExclusionCheck.java 0.00% <0.00%> (ø)
...ox/oxfish/fisher/purseseiner/fads/AbstractFad.java 81.81% <ø> (ø)
...eseiner/fads/LinearClorophillAttractorFactory.java 0.00% <0.00%> (ø)
...habilitySelectivityClorophillAttractorFactory.java 0.00% <0.00%> (ø)
...iner/planner/DrawThenCheapestInsertionPlanner.java 77.84% <ø> (ø)
...ox/oxfish/geography/fads/FadTemperatureHazard.java 0.00% <0.00%> (ø)
...sh/geography/fads/FadTemperatureHazardFactory.java 0.00% <0.00%> (ø)
...va/uk/ac/ox/oxfish/maximization/TunaEvaluator.java 0.00% <0.00%> (ø)
.../ox/oxfish/model/plugins/ClorophillMapFactory.java 0.00% <0.00%> (ø)
.../main/java/uk/ac/ox/oxfish/utility/GISReaders.java 54.76% <ø> (ø)
... and 16 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.