Matrix.
update_weight
Update the weight of a given criterion
criterion (str) – The name of the criterion.
weight (float) – The new value for the weight.
Examples
>>> import matrix >>> m = matrix.Matrix( ... choices=('apple', 'orange'), ... criteria=('taste', 'color'), ... weights=(7, 3) ... ) >>> m.rate_choice('apple', taste=1, color=2) >>> m.rate_choice('orange', taste=3, color=4) >>> m.update_weight('color', 9) >>> m | | taste | color | Percentage | |:-------|--------:|--------:|:-------------| | Weight | 7 | 9 | | | apple | 1 | 2 | 15.625 | | orange | 3 | 4 | 35.625 |