matrix.Matrix.add_continuous_criteria

Matrix.add_continuous_criteria(*criteria, weights: tuple[float])

Add multiple continuous criteria into the matrix to evaluate each choice against.

Parameters

*criteria (str) – Names of the criteria to add.

Keyword Arguments

weights (tuple[float]) – How important the criteria are (usually on a 0-10 scale), in order of declaration.

Raises

ValueError – If any given weight value is zero.

Examples

>>> import matrix
>>> m = matrix.Matrix()
>>> m.add_continuous_criteria('price', 'size', weights=(5, 2))
>>> m
|        |   price |   size |
|:-------|--------:|-------:|
| Weight |       5 |      2 |
>>> m.continuous_criteria
['price', 'size']