Browse Source

Disabled MinimalLabelSetGenerator test code in storm.cpp and fixed minor issue in ExplicitModelAdapter that treated constant strings incorrectly.

Former-commit-id: 11a31be820
tempestpy_adaptions
dehnert 11 years ago
parent
commit
1934bdd801
  1. 2
      src/adapters/ExplicitModelAdapter.cpp
  2. 15
      src/storm.cpp

2
src/adapters/ExplicitModelAdapter.cpp

@ -48,6 +48,7 @@ namespace storm {
} }
void ExplicitModelAdapter::defineUndefinedConstants(std::string const& constantDefinitionString) { void ExplicitModelAdapter::defineUndefinedConstants(std::string const& constantDefinitionString) {
if (!constantDefinitionString.empty()) {
// Parse the string that defines the undefined constants of the model and make sure that it contains exactly // Parse the string that defines the undefined constants of the model and make sure that it contains exactly
// one value for each undefined constant of the model. // one value for each undefined constant of the model.
std::vector<std::string> definitions; std::vector<std::string> definitions;
@ -100,6 +101,7 @@ namespace storm {
} }
} }
} }
}
void ExplicitModelAdapter::undefineUndefinedConstants() { void ExplicitModelAdapter::undefineUndefinedConstants() {
for (auto nameExpressionPair : program.getBooleanUndefinedConstantExpressionsMap()) { for (auto nameExpressionPair : program.getBooleanUndefinedConstantExpressionsMap()) {

15
src/storm.cpp

@ -336,13 +336,14 @@ int main(const int argc, const char* argv[]) {
std::shared_ptr<storm::models::AbstractModel<double>> model = adapter.getModel(constants); std::shared_ptr<storm::models::AbstractModel<double>> model = adapter.getModel(constants);
model->printModelInformationToStream(std::cout); model->printModelInformationToStream(std::cout);
if (model->getType() == storm::models::MDP) {
std::shared_ptr<storm::models::Mdp<double>> labeledMdp = model->as<storm::models::Mdp<double>>();
storm::storage::BitVector const& finishedStates = labeledMdp->getLabeledStates("finished");
storm::storage::BitVector const& allCoinsEqual1States = labeledMdp->getLabeledStates("all_coins_equal_1");
storm::storage::BitVector targetStates = finishedStates & allCoinsEqual1States;
storm::counterexamples::MinimalLabelSetGenerator<double>::getMinimalLabelSet(*labeledMdp, storm::storage::BitVector(labeledMdp->getNumberOfStates(), true), targetStates, 0.3, true, true);
}
// Enable the following lines to test the MinimalLabelSetGenerator.
// if (model->getType() == storm::models::MDP) {
// std::shared_ptr<storm::models::Mdp<double>> labeledMdp = model->as<storm::models::Mdp<double>>();
// storm::storage::BitVector const& finishedStates = labeledMdp->getLabeledStates("finished");
// storm::storage::BitVector const& allCoinsEqual1States = labeledMdp->getLabeledStates("all_coins_equal_1");
// storm::storage::BitVector targetStates = finishedStates & allCoinsEqual1States;
// storm::counterexamples::MinimalLabelSetGenerator<double>::getMinimalLabelSet(*labeledMdp, storm::storage::BitVector(labeledMdp->getNumberOfStates(), true), targetStates, 0.3, true, true);
// }
} }
// Perform clean-up and terminate. // Perform clean-up and terminate.

Loading…
Cancel
Save