matrix.Matrix.add_continuous_criterion

Matrix.add_continuous_criterion(criterion: str, *, weight: float)

Add a continuous criterion into the matrix to evaluate each choice against.

Parameters

criterion (str) – Name of the criterion to add.

Keyword Arguments

weight (float) – How important this criterion is (usually on a 0-10 scale).

Raises

ValueError – If a weight value is zero.

Examples

>>> import matrix
>>> m = matrix.Matrix()
>>> m.add_continuous_criterion('price', weight=7)
>>> m
|        |   price |
|:-------|--------:|
| Weight |       7 |
>>> m.continuous_criteria
['price']