open-AIMS / ADRIA.jl

ADRIA: Adaptive Dynamic Reef Intervention Algorithms. A multi-criteria decision support platform for informing reef restoration and adaptation interventions.
MIT License
18 stars 6 forks source link

`run_site_selection()` errors out #308

Closed ConnectedSystems closed 1 year ago

ConnectedSystems commented 1 year ago

Example script I am using

using Revise, Infiltrator
using ADRIA

dom = ADRIA.load_domain("path to Moore dataset")
scens = ADRIA.sample_site_selection(dom, 8)

area_to_seed = 1.5 * 10^-6  # area of seeded corals in km^2
ts = 5  # time step to perform site selection at

# initial coral cover matching number of criteria samples (size = (no. criteria scens, no. of sites))
sum_cover = repeat(sum(dom.init_coral_cover, dims=2)', size(scens, 1))

ranks = ADRIA.run_site_selection(dom, scens, sum_cover, area_to_seed, ts)

Errors out with a BoundsError: attempt to access Tuple{Symbol, Symbol} at index [3] Seems it is trying to index a non-existent third dimension for sum_cover? Once I correct for that, it runs into another error where it seems to be trying to select all sites from sum_cover (L 428 in guided_site_selection())

Is there a way of performing site selection using available data across time, rather than specifying a specific time step? This would be the preferred approach for a "set and forget" scenario I think (i.e., select sites based on available long-term projections rather than what's forecasted for the year).

The example needs to be updated and moved into the documentation as well.

Rosejoycrocker commented 1 year ago

I think I've amended the cause of the error in the PR I just sent- somehow I had mistakenly used nsiteint instead of nsites for the size of storage for ranks and it wasn't picked up by tests because the number of filtered sites in the example dataset is the same as nsiteint (5).

We can definitely adjust run_site_scenario to be across time by adding a time loop. Unfortunately with the way site selection is set up it couldn't be done using vectorisation, it would have to be a loop. It may be possible to change this with the changes proposed for making the mcda more generic, perhaps a topic for discussion on Wednesday...

ConnectedSystems commented 1 year ago

We can definitely adjust run_site_scenario to be across time by adding a time loop

What I had in mind was use some summary stat for each layer to make the first (and only) deployment decision. No looping over time.

Rosejoycrocker commented 1 year ago

I see, we can chat about this on wednesday also- maybe we can have the stat to use specified as an input.