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

Adjust MCDA functions to be more generic #177

Closed ConnectedSystems closed 1 year ago

ConnectedSystems commented 2 years ago

Currently adjustments to the MCDA (and related) functions require manual adjustments where criteria and their weights are added/removed.

Manually adjusting number of arguments and their index positions can lead to hard-to-debug issues due to the risk of human error, and a more than necessary time-sink as changes are required across a number of files (and those changes to be validated/tested).

We should instead move towards a more generic implementation of the MCDA functions.

One way would be to use ~NamedArrays~ NamedDims+AxisKeys to avoid the need for numeric indices, auto-generate the mapping between the column positions and the criteria they represent, and/or making the functions accept an arbitrary number of criteria/weights.

If it is necessary to continually add criteria as explicit arguments, the function could be made to accept an arbitrary number of arguments:

Notes:

Rosejoycrocker commented 1 year ago

Is this a separate issue from #252 ?

ConnectedSystems commented 1 year ago

Wow, yes, it does seem like #252 is a duplicate. I did do a quick search before I opened it but obviously I'm blind (or used the wrong keywords).

Let's close this one in favour of that #252 then.