TimQu
6 years ago
7 changed files with 127 additions and 10 deletions
-
11src/storm-parsers/parser/JaniParser.cpp
-
12src/storm/storage/jani/JSONExporter.cpp
-
7src/storm/storage/jani/JSONExporter.h
-
8src/storm/storage/jani/Model.cpp
-
14src/storm/storage/jani/Model.h
-
56src/storm/storage/jani/ModelFeatures.cpp
-
29src/storm/storage/jani/ModelFeatures.h
@ -0,0 +1,56 @@ |
|||
#include "storm/storage/jani/ModelFeatures.h"
|
|||
|
|||
#include "storm/utility/macros.h"
|
|||
|
|||
namespace storm { |
|||
namespace jani { |
|||
|
|||
std::string toString(ModelFeature const& modelFeature) { |
|||
switch(modelFeature) { |
|||
case ModelFeature::Arrays: |
|||
return "arrays"; |
|||
case ModelFeature::DerivedOperators: |
|||
return "derived-operators"; |
|||
case ModelFeature::StateExitRewards: |
|||
return "state-exit-rewards"; |
|||
} |
|||
STORM_LOG_ASSERT(false, "Unhandled model feature"); |
|||
return "Unhandled-feature"; |
|||
} |
|||
|
|||
std::string ModelFeatures::toString() const { |
|||
std::string res = "["; |
|||
bool first = true; |
|||
for (auto const& f : features) { |
|||
if (!first) { |
|||
res += ", "; |
|||
} |
|||
res += storm::jani::toString(f); |
|||
first = false; |
|||
} |
|||
res += "]"; |
|||
return res; |
|||
} |
|||
|
|||
bool ModelFeatures::hasArrays() const { |
|||
return features.count(ModelFeature::Arrays) > 0; |
|||
} |
|||
|
|||
bool ModelFeatures::hasDerivedOperators() const { |
|||
return features.count(ModelFeature::DerivedOperators) > 0; |
|||
} |
|||
|
|||
bool ModelFeatures::hasStateExitRewards() const { |
|||
return features.count(ModelFeature::StateExitRewards) > 0; |
|||
} |
|||
|
|||
void ModelFeatures::add(ModelFeature const& modelFeature) { |
|||
features.insert(modelFeature); |
|||
} |
|||
|
|||
void ModelFeatures::remove(ModelFeature const& modelFeature) { |
|||
features.erase(modelFeature); |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
#pragma once |
|||
|
|||
#include <string> |
|||
#include <set> |
|||
|
|||
namespace storm { |
|||
namespace jani { |
|||
|
|||
enum class ModelFeature {Arrays, DerivedOperators, StateExitRewards}; |
|||
|
|||
std::string toString(ModelFeature const& modelFeature); |
|||
|
|||
class ModelFeatures { |
|||
|
|||
public: |
|||
std::string toString() const; |
|||
|
|||
bool hasArrays() const; |
|||
bool hasDerivedOperators() const; |
|||
bool hasStateExitRewards() const; |
|||
|
|||
void add(ModelFeature const& modelFeature); |
|||
void remove(ModelFeature const& modelFeature); |
|||
|
|||
private: |
|||
std::set<ModelFeature> features; |
|||
}; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue