{"id":16068004,"url":"https://github.com/rakhimov/scram","last_synced_at":"2025-05-11T17:52:38.796Z","repository":{"id":15235447,"uuid":"17964226","full_name":"rakhimov/scram","owner":"rakhimov","description":"Probabilistic Risk Analysis Tool (fault tree analysis, event tree analysis, etc.)","archived":false,"fork":false,"pushed_at":"2023-09-19T15:47:48.000Z","size":20966,"stargazers_count":147,"open_issues_count":50,"forks_count":55,"subscribers_count":22,"default_branch":"develop","last_synced_at":"2025-05-11T11:41:40.826Z","etag":null,"topics":["bdd","c-plus-plus","cpp17","event-tree","fault-tree","fta","pra","psa","python","qt5","reliability-engineering","risk-analysis","zbdd"],"latest_commit_sha":null,"homepage":"https://scram-pra.org","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rakhimov.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-03-21T01:19:49.000Z","updated_at":"2025-04-15T11:14:51.000Z","dependencies_parsed_at":"2022-08-04T02:45:20.876Z","dependency_job_id":"9b893c5d-a777-44ae-9b3e-67cebcb767fa","html_url":"https://github.com/rakhimov/scram","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakhimov%2Fscram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakhimov%2Fscram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakhimov%2Fscram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakhimov%2Fscram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rakhimov","download_url":"https://codeload.github.com/rakhimov/scram/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253561094,"owners_count":21927762,"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":["bdd","c-plus-plus","cpp17","event-tree","fault-tree","fta","pra","psa","python","qt5","reliability-engineering","risk-analysis","zbdd"],"created_at":"2024-10-09T06:07:47.773Z","updated_at":"2025-05-11T17:52:38.777Z","avatar_url":"https://github.com/rakhimov.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#####\nSCRAM\n#####\n\n.. image:: https://travis-ci.org/rakhimov/scram.svg?branch=develop\n    :target: https://travis-ci.org/rakhimov/scram\n.. image:: https://ci.appveyor.com/api/projects/status/d36yu2w3t8hy4ito/branch/develop?svg=true\n    :target: https://ci.appveyor.com/project/rakhimov/scram/branch/develop\n    :alt: 'Build status'\n.. image:: https://codecov.io/github/rakhimov/scram/coverage.svg?branch=develop\n    :target: https://codecov.io/github/rakhimov/scram?branch=develop\n.. image:: https://scan.coverity.com/projects/2555/badge.svg\n    :target: https://scan.coverity.com/projects/2555\n.. image:: https://api.codacy.com/project/badge/Grade/7067af3e78774325bb33894deac23b9c\n    :target: https://www.codacy.com/app/rakhimov/scram?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=rakhimov/scram\u0026amp;utm_campaign=Badge_Grade\n\n|\n\n**SCRAM** is a **C**\\ommand-line **R**\\isk **A**\\nalysis **M**\\ulti-tool.\n\nThis project aims to build a command line tool for probabilistic risk analysis.\nSCRAM is capable of performing event tree analysis, static fault tree analysis,\nanalysis with common cause failure models,\nprobability calculations with importance analysis,\nand uncertainty analysis with Monte Carlo simulations.\nThis tool can handle non-coherent fault trees, containing NOT logic.\n\nSCRAM input and report files are based on the Open-PSA_ `Model Exchange Format`_.\nFor the current status of the Open-PSA MEF features in SCRAM,\nplease see the `MEF Support`_ documentation.\n\nA complementary GUI front-end is under development\nfor visualization and manipulation of risk analysis models and reports.\n\nTo explore the performance of SCRAM or research fault trees,\na fault tree generator script is provided,\nwhich can create hard-to-analyze fault trees in a short time.\n\nThe documentation_ contains a full description of SCRAM,\nits current capabilities, and future additions.\nThe latest stable release is packaged for `quick installation`_ on various platforms.\n\n.. _Open-PSA: http://open-psa.org\n.. _Model Exchange Format: http://open-psa.github.io/mef\n.. _MEF Support: https://scram-pra.org/doc/opsa_support.html\n.. _documentation: https://scram-pra.org\n.. _quick installation: https://scram-pra.org/doc/installation.html\n\n.. contents:: **Table of Contents**\n\n\n***********************\nBuilding and Installing\n***********************\n\nGit Submodules\n==============\n\nSome dependencies are provided with git submodules (e.g., Catch2).\nIn order to initialize all the submodules,\nthis repository must be cloned recursively with ``git clone --recursive``,\nor the following commands must be executed after a normal clone.\n\n.. code-block:: bash\n\n    git submodule update --init --recursive\n\n\nDependencies\n============\n\n====================   ===============\nPackage                Minimum Version\n====================   ===============\nCMake                  3.8\nboost                  1.61\nlibxml2                2.9.1\nPython                 3.4\nQt                     5.9.1\n====================   ===============\n\n\nOptional Dependencies\n---------------------\n\n====================   ===============\nPackage                Minimum Version\n====================   ===============\nTCMalloc               1.7\nJEMalloc               3.6\nHumanity Icons         0.6.13\n====================   ===============\n\n\nCompilers\n---------\n\n====================   ===============\nPackage                Minimum Version\n====================   ===============\nGCC/G++                7.1\nClang/LLVM             5.0\nIntel                  18.0.1\n====================   ===============\n\n\nInstalling Dependencies\n=======================\n\nUbuntu\n------\n\nPython and GCC/G++ compiler are assumed to be available on the system.\nThe process is tested on Ubuntu 17.10 using ``apt-get`` as the package manager:\n\n.. code-block:: bash\n\n    sudo apt-get install -y cmake lib{boost-all,xml2,google-perftools,qt5{svg,opengl}5}-dev qt{base,tools}5-dev{,-tools} humanity-icon-theme\n\n\nmacOS\n-----\n\nIf on a Mac system, homebrew_ is a good package manager to use.\nIt is assumed that some dependencies are provided by Xcode (e.g., Python, llvm/clang, make).\nThe following instructions are tested on OS X 10.12:\n\n.. code-block:: bash\n\n    brew install cmake boost libxml2 gperftools qt5\n\n.. _homebrew: http://brew.sh/\n\n\nWindows\n-------\n\nMSYS2_/Mingw-w64_ is the recommended platform to work on Windows.\nAssuming MSYS2 is installed on the system,\nthe following instructions will install SCRAM dependencies:\n\n.. code-block:: bash\n\n    pacman --noconfirm -S mingw-w64-x86_64-{gcc,make,cmake,boost,libxml2,qt5}\n\nSCRAM installation and executables must be run inside of the MSYS2 shell.\n\n.. _MSYS2: https://sourceforge.net/projects/msys2/\n.. _Mingw-w64: http://mingw-w64.sourceforge.net/\n\n\nInstalling SCRAM\n================\n\nThe project is configured with CMake_ scripts.\nCMake generates native \"makefiles\" or build system configurations\nto be used in your compiler environment.\nIf there are dependency issues, CMake output should guide with errors.\nThe configuration and build must happen out-of-source (e.g., in ``build`` sub-directory).\n\n.. code-block:: bash\n\n    .../scram/build$ cmake .. -DCMAKE_INSTALL_PREFIX=path/to/installation/directory -DCMAKE_BUILD_TYPE=Release\n\nFor Mingw-w64_ on Windows, specify ``-G \"MSYS Makefiles\"`` generator flag.\nTo build tests, specify ``-DBUILD_TESTING=ON`` option.\n\nVarious other project configurations can be explored with CMake or its front-ends.\nFor example:\n\n.. code-block:: bash\n\n    .../scram/build$ cmake -L\n\n    .../scram/build$ ccmake .\n\n    .../scram/build$ cmake-gui .\n\nAn example build/install instruction with the CMake generated Makefiles:\n\n.. code-block:: bash\n\n    .../scram/build$ make install\n\nThe main and test binaries are installed in ``installation/directory/bin``.\nThe input files and schema are copied in ``installation/directory/share/scram/``.\n\nOther tools, such as the **fault tree generator**,\ncan be found in the ``scripts`` directory.\nThese tools do not require compilation or installation.\n\n.. _CMake: https://cmake.org\n\n\n***********************\nRunning SCRAM and Tests\n***********************\n\nThis guide assumes\nthat SCRAM *installation* directories are in the global path.\nIf this is not the case,\n``path/to/installation/directory/bin/`` must be prepended to the command-line calls.\nHowever, if SCRAM executables are not in the path,\nsome system tests and scripts cannot be initiated.\n\n\nTo run SCRAM\n============\n\nExample configuration and input files are provided in the ``input`` directory.\n\n.. code-block:: bash\n\n    scram path/to/input/files\n\n\nOn command line, run help to get more detailed information:\n\n.. code-block:: bash\n\n    scram --help\n\nVarious other useful tools and helper scripts,\nsuch as the **fault tree generator**,\ncan be found in the ``scripts`` directory.\nHelp prompts and the documentation have more details how to use these tools.\n\n\nTo launch the GUI\n=================\n\nTo launch the GUI front-end from the command-line:\n\n.. code-block:: bash\n\n    scram-gui\n\nThe command can also take project configuration and/or input files:\n\n.. code-block:: bash\n\n    scram-gui path/to/input/files\n\n    scram-gui --project path/to/project/file\n\n    scram-gui path/to/input/files --project path/to/project/file\n\n\nTo run tests\n============\n\nTo run the unit and benchmark tests:\n\n.. code-block:: bash\n\n    scram_tests\n\nTo test the tools in the ``scripts`` directory:\n\n.. code-block:: bash\n\n    .../scram/scripts$ python -m pytest test/\n\nTo test the command-line call of SCRAM:\n\n.. code-block:: bash\n\n    .../scram/tests$ python -m pytest test_scram_call.py\n\n\nTo run performance tests\n========================\n\nA set of performance tests is provided\nto evaluate the running times on the host machine\nand to help developers check for regressions.\nMore details can be found in performance test source files.\n\nTo run all performance tests (may take considerable time):\n\n.. code-block:: bash\n\n    scram_tests [.perf]\n\n\nTo run GUI tests\n================\n\nUnfortunately, Qt Test does not automatically register or manage all its test cases,\nnor does it provide a single test driver.\nEach test case is a separate binary with its own commands and reports.\nTake a look at ``path/to/installation/directory/bin`` directory\nfor the compiled ``scramgui_test${CASE_NAME}`` binaries to run.\n\nAll Qt Tests are also manually registered with CTest\nso that it is possible to run all the GUI tests at once:\n\n.. code-block:: bash\n\n    .../scram/build$ ctest --verbose\n\n\nTo run fuzz testing\n===================\n\nThe main goal of SCRAM fuzz testing\nis to discover defects in its analysis code.\nIt is recommended to build SCRAM\nwith assertions preserved\nand sanitizers enabled, for example,\naddress sanitizer in GCC and Clang ``-fsanitize=address``.\n\nIn order to speed up the fuzz testing,\nSCRAM may be built with optimizations but ``NDEBUG`` undefined.\nAdditionally, multiple SCRAM instances can be run at once.\n\nAn example command to run SCRAM 1000 times with 4 parallel instances:\n\n.. code-block:: bash\n\n    fuzz_tester.py -n 1000 -j 4\n\nThe fuzz tester can be guided with options listed in its help prompt.\nSome options can be combined,\nand some are mutually exclusive.\nThe priorities of mutually exclusive options and combinations are hard-coded in the script,\nand no error messages are produced;\nhowever, information messages are given to indicate the interpretation.\n\n.. code-block:: bash\n\n    fuzz_tester.py --help\n\nFuzzing inputs and configurations are auto-generated.\nThe fuzz tester collects run configurations, failures, and logs.\nThe auto-generated inputs are preserved for failed runs.\n\n\nCross Validation\n----------------\n\nThe Fuzz tester can check\nthe results of qualitative analysis algorithms implemented in SCRAM.\nIf there is any disagreement between various algorithms,\nthe run is reported as failure.\n\n.. code-block:: bash\n\n    fuzz_tester.py --cross-validate\n\n\n**********************\nDocumentation Building\n**********************\n\nDocumentation is generated with the configurations on the gh-source_ branch.\nThe raw documentation files are in the ``doc`` directory.\n\n.. _gh-source: https://github.com/rakhimov/scram/tree/gh-source\n\n\n**************\nNote to a User\n**************\n\nThe development may follow\nthe Documentation Driven Development paradigm for some new features.\nTherefore, some documentation may be ahead of the actual development\nand describe features under current development or consideration.\n\nFor any questions, don't hesitate to ask the user support mailing list\n(https://groups.google.com/forum/#!forum/scram-users, scram-users@googlegroups.com).\n\nFor latest releases and information about SCRAM,\nfeel free to subscribe to the announcements\n(https://groups.google.com/forum/#!forum/scram-announce,\nscram-announce+subscribe@googlegroups.com).\n\n\n*****************\nHow to Contribute\n*****************\n\nPlease follow the instructions in `CONTRIBUTING.md`_.\n\n.. _CONTRIBUTING.md:\n    https://github.com/rakhimov/scram/blob/develop/CONTRIBUTING.md\n\n\n.. image:: https://bestpractices.coreinfrastructure.org/projects/356/badge\n    :target: https://bestpractices.coreinfrastructure.org/projects/356\n    :alt: CII Best Practices\n.. image:: https://www.openhub.net/p/scram/widgets/project_thin_badge.gif\n    :target: https://www.openhub.net/p/scram\n    :alt: Open HUB Metrics\n.. image:: https://d322cqt584bo4o.cloudfront.net/scram/localized.svg\n    :target: https://crowdin.com/project/scram\n    :alt: Crowdin\n.. image:: https://zenodo.org/badge/17964226.svg\n    :target: https://zenodo.org/badge/latestdoi/17964226\n    :alt: Zenodo DOI\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakhimov%2Fscram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frakhimov%2Fscram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakhimov%2Fscram/lists"}