Open dfrankow opened 2 years ago
Here is a medium post that does agree with your results, and also references the eigenvalue method.
The post has two examples of results:
And your code:
$ ./medium_example.py
Example 1
Target weights {'safety': 0.6, 'style': 0.3, 'comfort': 0.1}
Local weights {'safety': 0.6, 'style': 0.3, 'comfort': 0.1}
Example 2
Target weights {'safety': 0.5584, 'style': 0.3196, 'comfort': 0.122}
Local weights {'safety': 0.5584, 'style': 0.3196, 'comfort': 0.122}
code (medium_example.py):
#!/usr/bin/env python
import ahpy
sss_comparisons = {
('safety', 'style'): 2,
('safety', 'comfort'): 6,
('style', 'comfort'): 3}
compare = ahpy.Compare('sss', sss_comparisons)
print('Example 1')
print('Target weights', compare.target_weights)
print('Local weights', compare.local_weights)
sss_comparisons = {
('safety', 'style'): 2,
('safety', 'comfort'): 4,
('style', 'comfort'): 3}
compare = ahpy.Compare('sss', sss_comparisons)
print('Example 2')
print('Target weights', compare.target_weights)
print('Local weights', compare.local_weights)
Hello please i need help on how to used AHPY for COST-RELATED FACTORS
Node has an AHP library, found at https://github.com/airicyu/ahp.
This library and that one do not agree on results. I put code samples below.
I don't know that this is a bug. You may have just chosen different calculation methods.
However, I'd be interested if you had any thoughts on this.
Your library:
The node library (I pick out only the relevant lines):
Your library (cost_speed.py):
Node library (cost_speed.js):