Browse Source

Added a new enum that describes the model representation (sparse, dd with sylvan, dd with cudd).

tempestpy_adaptions
Tim Quatmann 4 years ago
parent
commit
cf20e340de
  1. 26
      src/storm/models/ModelRepresentation.cpp
  2. 42
      src/storm/models/ModelRepresentation.h

26
src/storm/models/ModelRepresentation.cpp

@ -0,0 +1,26 @@
#include "storm/models/ModelRepresentation.h"
#include "storm/exceptions/InvalidTypeException.h"
#include "storm/utility/macros.h"
namespace storm {
namespace models {
std::ostream& operator<<(std::ostream& os, ModelRepresentation const& representation) {
switch (representation) {
case ModelRepresentation::Sparse:
os << "sparse";
break;
case ModelRepresentation::DdCudd:
os << "DD (Cudd)";
break;
case ModelRepresentation::DdSylvan:
os << "DD (Sylvan)";
break;
default:
STORM_LOG_THROW(false, storm::exceptions::InvalidTypeException, "Unknown model representation.");
}
return os;
}
}
}

42
src/storm/models/ModelRepresentation.h

@ -0,0 +1,42 @@
#pragma once
#include <ostream>
#include "storm/storage/dd/DdType.h"
namespace storm {
namespace models {
enum class ModelRepresentation {
Sparse, DdCudd, DdSylvan
};
std::ostream& operator<<(std::ostream& os, ModelRepresentation const& representation);
template<storm::dd::DdType ddType>
struct GetModelRepresentation;
template<>
struct GetModelRepresentation<storm::dd::DdType::CUDD> {
static const ModelRepresentation representation = ModelRepresentation::DdCudd;
};
template<>
struct GetModelRepresentation<storm::dd::DdType::Sylvan> {
static const ModelRepresentation representation = ModelRepresentation::DdSylvan;
};
template<ModelRepresentation representation>
struct GetDdType;
template<>
struct GetDdType<ModelRepresentation::Sparse> {
static const storm::dd::DdType ddType = storm::dd::DdType::Sylvan;
};
template<>
struct GetDdType<ModelRepresentation::DdCudd> {
static const storm::dd::DdType ddType = storm::dd::DdType::CUDD;
};
template<>
struct GetDdType<ModelRepresentation::DdSylvan> {
static const storm::dd::DdType ddType = storm::dd::DdType::Sylvan;
};
}
}
Loading…
Cancel
Save