{"id":21177986,"url":"https://github.com/hexedpackets/fault_tree","last_synced_at":"2025-07-09T22:31:06.507Z","repository":{"id":57501286,"uuid":"186893413","full_name":"hexedpackets/fault_tree","owner":"hexedpackets","description":"Fault Tree Analysis built in Elixir","archived":false,"fork":false,"pushed_at":"2019-06-06T13:34:46.000Z","size":56,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T06:47:22.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hexedpackets.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}},"created_at":"2019-05-15T19:52:33.000Z","updated_at":"2020-08-10T00:33:05.000Z","dependencies_parsed_at":"2022-09-14T19:41:19.657Z","dependency_job_id":null,"html_url":"https://github.com/hexedpackets/fault_tree","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hexedpackets/fault_tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexedpackets%2Ffault_tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexedpackets%2Ffault_tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexedpackets%2Ffault_tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexedpackets%2Ffault_tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexedpackets","download_url":"https://codeload.github.com/hexedpackets/fault_tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexedpackets%2Ffault_tree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264504578,"owners_count":23618825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-20T17:19:17.330Z","updated_at":"2025-07-09T22:31:06.254Z","avatar_url":"https://github.com/hexedpackets.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FaultTree\n\nFaultTree is a library for performing [fault tree analysis](https://en.wikipedia.org/wiki/Fault_tree_analysis). It includes a small HTTP server capable of graphing the resulting FTA, or returning it as JSON.\n\n## Installation\n\nThe FaultTree package can be installed from Hex\nby adding `fault_tree` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:fault_tree, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\nDocumentation can be found at [https://hexdocs.pm/fault_tree](https://hexdocs.pm/fault_tree).\n\n## Running\n\nRun the server with `mix trot.server`, or `iex -S mix` for an interactive shell. The analysis can be run by uploading XML at http://localhost:4000/.\n\n\n## Input format\n\nThe expected input is an XML document matching the [SCRAM/openpsa format](https://github.com/rakhimov/scram/blob/master/share/input.rng). Alternatively, the fault tree can be created using Elixir code. Example:\n\n\n```elixir\nFaultTree.create(:or)\n|\u003e FaultTree.add_basic(\"root\", \"0.01\", \"foo\")\n|\u003e FaultTree.add_basic(\"root\", \"0.01\", \"bar\")\n|\u003e FaultTree.build()\n```\n\nWill build the following tree:\n\n```elixir\n%FaultTree.Node{\n  atleast: nil,\n  children: [\n    %FaultTree.Node{\n      atleast: nil,\n      children: [],\n      description: nil,\n      id: 2,\n      name: \"bar\",\n      parent: \"root\",\n      probability: #Decimal\u003c0.01\u003e,\n      source: nil,\n      type: :basic\n    },\n    %FaultTree.Node{\n      atleast: nil,\n      children: [],\n      description: nil,\n      id: 1,\n      name: \"foo\",\n      parent: \"root\",\n      probability: #Decimal\u003c0.01\u003e,\n      source: nil,\n      type: :basic\n    }\n  ],\n  description: nil,\n  id: 0,\n  name: \"root\",\n  parent: nil,\n  probability: #Decimal\u003c0.0199\u003e,\n  source: nil,\n  type: :or\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexedpackets%2Ffault_tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexedpackets%2Ffault_tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexedpackets%2Ffault_tree/lists"}