#include "src/models/sparse/DeterministicModel.h" #include "src/utility/constants.h" #include "src/adapters/CarlAdapter.h" namespace storm { namespace models { namespace sparse { template DeterministicModel::DeterministicModel(storm::models::ModelType const& modelType, storm::storage::SparseMatrix const& transitionMatrix, storm::models::sparse::StateLabeling const& stateLabeling, std::unordered_map const& rewardModels, boost::optional> const& optionalChoiceLabeling) : Model(modelType, transitionMatrix, stateLabeling, rewardModels, optionalChoiceLabeling) { // Intentionally left empty. } template DeterministicModel::DeterministicModel(storm::models::ModelType const& modelType, storm::storage::SparseMatrix&& transitionMatrix, storm::models::sparse::StateLabeling&& stateLabeling, std::unordered_map&& rewardModels, boost::optional>&& optionalChoiceLabeling) : Model(modelType, std::move(transitionMatrix), std::move(stateLabeling), std::move(rewardModels), std::move(optionalChoiceLabeling)) { // Intentionally left empty. } template void DeterministicModel::writeDotToStream(std::ostream& outStream, bool includeLabeling, storm::storage::BitVector const* subsystem, std::vector const* firstValue, std::vector const* secondValue, std::vector const* stateColoring, std::vector const* colors, std::vector* scheduler, bool finalizeOutput) const { Model::writeDotToStream(outStream, includeLabeling, subsystem, firstValue, secondValue, stateColoring, colors, scheduler, false); // Simply iterate over all transitions and draw the arrows with probability information attached. auto rowIt = this->getTransitionMatrix().begin(); for (uint_fast64_t i = 0; i < this->getTransitionMatrix().getRowCount(); ++i, ++rowIt) { typename storm::storage::SparseMatrix::const_rows row = this->getTransitionMatrix().getRow(i); for (auto const& transition : row) { if (transition.getValue() != storm::utility::zero()) { if (subsystem == nullptr || subsystem->get(transition.getColumn())) { outStream << "\t" << i << " -> " << transition.getColumn() << " [ label= \"" << transition.getValue() << "\" ];" << std::endl; } } } } if (finalizeOutput) { outStream << "}" << std::endl; } } template void DeterministicModel::reduceToStateBasedRewards() { for (auto& rewardModel : this->getRewardModels()) { rewardModel.second.reduceToStateBasedRewards(this->getTransitionMatrix(), true); } } template class DeterministicModel; template class DeterministicModel; #ifdef STORM_HAVE_CARL template class DeterministicModel; #endif } // namespace sparse } // namespace models } // namespace storm