We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
$ ./cost_speed.py Target weights {'f150': 0.7785, 'ferrari': 0.1799, 'honda': 0.0416} Local weights {'cost': 0.5, 'speed': 0.5}
The node library (I pick out only the relevant lines):
... criteriaRankMetaMap: { ci: 0, ri: 0, cr: 0, weightedVector: [ 0.5, 0.5 ] }, ... rankedScoreMap: { ferrari: 0.22116480011216855, honda: 0.05150989361515677, f150: 0.7273253062726747 }, ...
Your library (cost_speed.py):
#!/usr/bin/env python import ahpy cost_comparisons = {('ferrari', 'honda'): 9, ('f150', 'honda'): 9, ('f150', 'ferrari'): 9} speed_comparisons = {('ferrari', 'honda'): 9, ('f150', 'honda'): 9, ('f150', 'ferrari'): 9} criteria_comparisons = {('cost', 'speed'): 1} cost = ahpy.Compare('cost', cost_comparisons) speed = ahpy.Compare('speed', speed_comparisons) criteria = ahpy.Compare('criteria', criteria_comparisons) criteria.add_children([cost, speed]) print('Target weights', criteria.target_weights)
Node library (cost_speed.js):
#!/usr/bin/env node const AHP = require('ahp'); var ahpContext = new AHP(); ahpContext.addItems(['ferrari', 'honda', 'f150']); ahpContext.addCriteria(['cost', 'speed']); ahpContext.rankCriteriaItem('cost', [ ['ferrari', 'honda', 9], ['f150', 'honda', 9], ['f150', 'ferrari', 9] ]); ahpContext.rankCriteriaItem('speed', [ ['ferrari', 'honda', 9], ['f150', 'honda', 9], ['f150', 'ferrari', 9] ]); ahpContext.rankCriteria([ ['cost', 'speed', 1], ]); let output = ahpContext.run(); console.log(output);
The text was updated successfully, but these errors were encountered:
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)
Sorry, something went wrong.
Hello please i need help on how to used AHPY for COST-RELATED FACTORS
No branches or pull requests
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):
The text was updated successfully, but these errors were encountered: