{"id":20314818,"url":"https://github.com/solar05/descisionex","last_synced_at":"2026-05-26T23:33:40.184Z","repository":{"id":57674102,"uuid":"453251574","full_name":"solar05/descisionex","owner":"solar05","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-23T22:59:49.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-24T00:24:04.743Z","etag":null,"topics":["analytic-hierarchy-process","descion-making","elixir","library"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/descisionex","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solar05.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-28T23:55:40.000Z","updated_at":"2026-05-23T22:59:53.000Z","dependencies_parsed_at":"2022-08-29T15:41:42.281Z","dependency_job_id":null,"html_url":"https://github.com/solar05/descisionex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/solar05/descisionex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solar05%2Fdescisionex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solar05%2Fdescisionex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solar05%2Fdescisionex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solar05%2Fdescisionex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solar05","download_url":"https://codeload.github.com/solar05/descisionex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solar05%2Fdescisionex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33543973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytic-hierarchy-process","descion-making","elixir","library"],"created_at":"2024-11-14T18:16:48.515Z","updated_at":"2026-05-26T23:33:40.179Z","avatar_url":"https://github.com/solar05.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Descisionex\n\nLibrary for dealing with [descision theory](https://en.wikipedia.org/wiki/Decision_theory) algorithms.\n\n## Current algorithms\n\n- [Payment matrix](https://en.wikipedia.org/wiki/Payoff_matrix)\n- [Analytic hierarchy](https://en.wikipedia.org/wiki/Analytic_hierarchy_process)\n\n## Installation\n\nPackage can be installed by adding `descisionex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:descisionex, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n\n## Usage\n\n### Payment matrix (decision under uncertainty)\n\n```elixir\nalias Descisionex\n\nmatrix = [\n  [0.221, 0.194, 0.293, 0.181, 0.227],\n  [0.074, 0.065, 0.073, 0.052, 0.091],\n  [0.221, 0.258, 0.293, 0.361, 0.273],\n  [0.441, 0.452, 0.293, 0.361, 0.364],\n  [0.044, 0.032, 0.049, 0.045, 0.045]\n]\n\n# Calculate all criteria at once\nresult =\n  Descisionex.payment_matrix(matrix)\n  |\u003e Descisionex.set_alternatives([\"s1\", \"s2\", \"s3\", \"s4\", \"s5\"])\n  |\u003e Descisionex.calculate_criteria()\n\nresult.wald_criterion      # %{criterion: 0.293, strategy_index: 3, strategy_name: \"s4\"}\nresult.maximax_criterion   # %{criterion: 0.452, strategy_index: 3, strategy_name: \"s4\"}\nresult.hurwitz_criterion   # %{criterion: 0.372, strategy_index: 3, strategy_name: \"s4\"}\nresult.savage_criterion    # %{criterion: 0.0,   strategy_index: 3, strategy_name: \"s4\"}\nresult.laplace_criterion   # %{criterion: 0.382, strategy_index: 3, strategy_name: \"s4\"}\n\n# Bayes criterion requires probabilities\nDescisionex.payment_matrix(matrix)\n|\u003e Descisionex.set_probabilities([0.2, 0.2, 0.2, 0.2, 0.2])\n|\u003e Descisionex.calculate_bayes_criterion()\n```\n\n### Analytic Hierarchy Process (AHP)\n\n```elixir\nalias Descisionex\n\n# Pairwise comparison matrix for criteria\ncomparison_matrix = [\n  [1,   3,   1,   1/2, 5],\n  [1/3, 1,   1/4, 1/7, 2],\n  [1,   4,   1,   1,   6],\n  [2,   7,   1,   1,   8],\n  [1/5, 1/2, 1/6, 1/8, 1]\n]\n\n# Pairwise comparison matrices for each criterion (alternatives vs alternatives)\n# Each must be a valid reciprocal matrix: A[i][j] * A[j][i] == 1, diagonal == 1\nalternatives_matrix = [\n  [[1, 4, 1/2], [1/4, 1, 1/5],  [2, 5, 1]],      # price    CR=0.021\n  [[1, 1/2, 3], [2, 1, 4],      [1/3, 1/4, 1]],  # size     CR=0.016\n  [[1, 1, 2],   [1, 1, 3],      [1/2, 1/3, 1]],  # rooms    CR=0.016\n  [[1, 1/4, 1/2], [4, 1, 2],    [2, 1/2, 1]],    # place    CR=0.000\n  [[1, 2, 4],   [1/2, 1, 2],    [1/4, 1/2, 1]]   # category CR=0.000\n]\n\nresult =\n  Descisionex.analytic_hierarchy(comparison_matrix)\n  |\u003e Descisionex.set_criteria([\"price\", \"size\", \"rooms\", \"place\", \"category\"])\n  |\u003e Descisionex.set_alternatives([\"apt1\", \"apt2\", \"apt3\"])\n  |\u003e Descisionex.set_alternatives_matrix(alternatives_matrix)\n  |\u003e Descisionex.calculate()\n\nresult.consistency_ratio    # 0.013 (\u003c 0.1, acceptable)\nresult.alternatives_weights # [0.286, 0.416, 0.299]\n\nDescisionex.rank_alternatives(result)\n# [\n#   %{rank: 1, alternative: \"apt2\", weight: 0.416},\n#   %{rank: 2, alternative: \"apt3\", weight: 0.299},\n#   %{rank: 3, alternative: \"apt1\", weight: 0.286}\n# ]\n```\n\n## Documentation\n\nDocumentation can be found at [https://hexdocs.pm/descisionex](https://hexdocs.pm/descisionex).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolar05%2Fdescisionex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolar05%2Fdescisionex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolar05%2Fdescisionex/lists"}