mirror of
git://git.proxmox.com/git/proxmox-resource-scheduling.git
synced 2025-01-18 06:03:42 +03:00
06484e0ef9
Implement the TOPSIS[0] algorithm to score multi-valued alternatives according to a given set of weighted criteria. The number of alternatives cannot be known at compile time, but the number of criteria should be (a given module using the topsis module should have one (or more) fixed sets of criteria). Therefore, the TopsisMatrix is implemented as a Vec of N_CRITERIA-sized arrays. Compared to the description in [0] the weighing of the matrix according to the weights of the criteria only happens during distance calculation to the idealized alternatives. It turned out more natural like that, because the matrix doesn't need to be mutable. [0]: https://en.wikipedia.org/wiki/TOPSIS Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>