#ifndef EXPLICITDFTMODELBUILDER_H #define EXPLICITDFTMODELBUILDER_H #include #include #include #include #include #include #include #include #include #include #include namespace storm { namespace builder { template class ExplicitDFTModelBuilder { using DFTElementPointer = std::shared_ptr>; using DFTElementCPointer = std::shared_ptr const>; using DFTGatePointer = std::shared_ptr>; using DFTStatePointer = std::shared_ptr>; using DFTRestrictionPointer = std::shared_ptr>; // A structure holding the individual components of a model. struct ModelComponents { ModelComponents(); // The transition matrix. storm::storage::SparseMatrix transitionMatrix; // The state labeling. storm::models::sparse::StateLabeling stateLabeling; // The Markovian states. storm::storage::BitVector markovianStates; // The exit rates. std::vector exitRates; // A vector that stores a labeling for each choice. boost::optional>> choiceLabeling; }; const size_t INITIAL_BUCKETSIZE = 20000; const uint_fast64_t OFFSET_PSEUDO_STATE = UINT_FAST64_MAX / 2; storm::storage::DFT const& mDft; std::shared_ptr mStateGenerationInfo; storm::storage::BitVectorHashMap mStates; std::vector mPseudoStatesMapping; size_t newIndex = 0; bool mergeFailedStates = true; size_t failedIndex = 0; size_t initialStateIndex = 0; public: struct LabelOptions { bool buildFailLabel = true; bool buildFailSafeLabel = false; std::set beLabels = {}; }; ExplicitDFTModelBuilder(storm::storage::DFT const& dft, storm::storage::DFTIndependentSymmetries const& symmetries); std::shared_ptr> buildModel(LabelOptions const& labelOpts); private: bool exploreStates(std::queue& stateQueue, storm::storage::SparseMatrixBuilder& transitionMatrixBuilder, std::vector& markovianStates, std::vector& exitRates); }; } } #endif /* EXPLICITDFTMODELBUILDER_H */