Skip to content

packages/engine/scram-node/src/mocus.h

Fault tree analysis with the MOCUS algorithm. More...

Namespaces

Name
scram
scram::core

Classes

Name
classscram::core::Mocus <br>This class analyzes normalized, preprocessed, and indexed fault trees to generate minimal cut sets with the MOCUS algorithm.

Detailed Description

Fault tree analysis with the MOCUS algorithm.

This algorithm requires a fault tree in negation normal form. The fault tree must only contain AND and OR gates. All gates must be positive. That is, negations must be pushed down to leaves, basic events. The fault tree should not contain constants or house events.

Source code

cpp
/*
 * Copyright (C) 2014-2018 Olzhas Rakhimov
 * Copyright (C) 2023 OpenPRA ORG Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#pragma once

#include <unordered_map>
#include <vector>

#include <boost/noncopyable.hpp>

#include "pdag.h"
#include "settings.h"
#include "zbdd.h"

namespace scram::core {

class Mocus : private boost::noncopyable {
 public:
  Mocus(const Pdag* graph, const Settings& settings);

  void Analyze(const Pdag* graph = nullptr) noexcept;

  const Zbdd& products() const {
    assert(zbdd_ && "Analysis is not done.");
    return *zbdd_;
  }

 private:
  std::unique_ptr<zbdd::CutSetContainer>
  AnalyzeModule(const Gate& gate, const Settings& settings) noexcept;

  const Pdag* graph_;  
  const Settings kSettings_;  
  std::unique_ptr<Zbdd> zbdd_;  
};

}  // namespace scram::core

Updated on 2025-11-11 at 16:51:08 +0000