Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Slow Fault Tree Analyser (SFTA): fault tree analysis for coherent fault trees

License

NotificationsYou must be signed in to change notification settings

yawnoc/sfta

Repository files navigation

A slow (also shitty) fault tree analyser inspired by the idea presented in:

Text-driven

SFTA reads a textual representation of a fault tree. For example:

- time_unit: yrGate: FB- label: Conway causeth floor to be buttered- type: OR- inputs: BF, TFBSDEvent: BF- label: Conway knocketh butter onto floor- rate: 0.1Gate: TFBSD- label: Conway knocketh toast onto floor butter side down- type: AND- inputs: TF, TB, BSDEvent: TF- label: Conway knocketh toast onto floor- rate: 0.2Event: TB- label: Falling toast is buttered- probability: 0.75Event: BSD- label: Buttered toast landeth butter side down- probability: 0.9

This allows for sensible diffing between two versions of a fault tree.

Output

Output consists of:

  • an events summary,
  • a gates summary,
  • cut set listings, and
  • SVGs for all top gates and paged gates.

For the example above, we get the following SVG for the top gateFB:

Nice looking SVG showing the example fault tree.

Limitations

  • Only supports coherent fault trees, which have only AND gates and OR gates.

  • Enforces the naive "initiator-equals-rate" paradigm. Specifically:

    • For an AND gate, the first input may be a probability or a rate,but all subsequent inputs must be probabilities.
    • For an OR gate, all inputs must be the same type(all probability or all rate).
  • The probability or rate for a gate is approximated by simply summing thecontributions from each minimal cut set (rare event approximation).The higher-order terms (subtraction of pairwise intersections, addition oftriplet-wise intersections, etc.) have been neglected. This is conservative,as the first-order sum is an upper bound for the actual probability or rate.

Installation

$ pip3 install sfta
  • If simply using as a command line tool, dopipx instead ofpip3to avoid having to set up a virtual environment.
  • If using Windows, dopip instead ofpip3.

Usage (command line)

$ sfta [-h] [-v] ft.txtPerform a slow fault tree analysis.positional arguments:  ft.txt         name of fault tree text file; output is written unto the                 directory`{ft.txt}.out/`optional arguments:  -h, --help     show thishelp message andexit  -v, --version  show program's version number and exit

Usage (scripting example)

fromsfta.coreimportFaultTree,Gatefault_tree=FaultTree('''Event: A- rate: 0.9Event: B- probability: 0.7Event: C- rate: 1e-4Gate: AB- label: This be an AND gate.- type: AND- inputs: A, BGate: AB_C- label: This be an OR gate.- type: OR- inputs: AB, C''')fault_tree.gate_from_id['AB'].quantity_value# 0.63fault_tree.gate_from_id['AB_C'].quantity_value# 0.6301fault_tree.gate_from_id['AB_C'].input_ids# ['AB', 'C']fault_tree.gate_from_id['AB_C'].type_==Gate.TYPE_OR# True

License

Copyright 2022–2024 Conway
Licensed under the GNU General Public License v3.0 (GPL-3.0-only).
This is free software with NO WARRANTY etc. etc., see LICENSE.


[8]ページ先頭

©2009-2025 Movatter.jp