3 changed files with 52 additions and 8 deletions
			
			
		- 
					57src/storm/builder/BuilderType.cpp
- 
					1src/storm/builder/BuilderType.h
- 
					2src/storm/utility/Engine.cpp
| @ -1,23 +1,66 @@ | |||||
| #include "storm/builder/BuilderType.h"
 | #include "storm/builder/BuilderType.h"
 | ||||
| 
 | 
 | ||||
|  | #include "storm/storage/dd/DdType.h"
 | ||||
|  | 
 | ||||
| #include "storm/storage/jani/ModelFeatures.h"
 | #include "storm/storage/jani/ModelFeatures.h"
 | ||||
|  | #include "storm/generator/JaniNextStateGenerator.h"
 | ||||
|  | #include "storm/generator/PrismNextStateGenerator.h"
 | ||||
|  | #include "storm/builder/DdJaniModelBuilder.h"
 | ||||
|  | #include "storm/builder/DdPrismModelBuilder.h"
 | ||||
|  | #include "storm/builder/jit/ExplicitJitJaniModelBuilder.h"
 | ||||
|  | 
 | ||||
|  | #include "storm/utility/macros.h"
 | ||||
|  | #include "storm/exceptions/UnexpectedException.h"
 | ||||
| 
 | 
 | ||||
| namespace storm { | namespace storm { | ||||
|     namespace builder { |     namespace builder { | ||||
|          |          | ||||
|         storm::jani::ModelFeatures getSupportedJaniFeatures(BuilderType const& builderType) { |         storm::jani::ModelFeatures getSupportedJaniFeatures(BuilderType const& builderType) { | ||||
|             storm::jani::ModelFeatures features; |  | ||||
|             features.add(storm::jani::ModelFeature::DerivedOperators); |  | ||||
|             features.add(storm::jani::ModelFeature::StateExitRewards); |  | ||||
|             if (builderType == BuilderType::Explicit) { |  | ||||
|                 features.add(storm::jani::ModelFeature::Arrays); |  | ||||
|  |             // The supported jani features should be independent of the ValueType and Dd type. We just take sylvan and double for all.
 | ||||
|  |             storm::dd::DdType const ddType = storm::dd::DdType::Sylvan; | ||||
|  |             typedef double ValueType; | ||||
|  |             switch (builderType) { | ||||
|  |                 case BuilderType::Explicit: | ||||
|  |                     return storm::generator::JaniNextStateGenerator<ValueType>::getSupportedJaniFeatures(); | ||||
|  |                 case BuilderType::Dd: | ||||
|  |                     return storm::builder::DdJaniModelBuilder<ddType, ValueType>::getSupportedJaniFeatures(); | ||||
|  |                 case BuilderType::Jit: | ||||
|  |                     return storm::builder::jit::ExplicitJitJaniModelBuilder<ValueType>::getSupportedJaniFeatures(); | ||||
|  |                  | ||||
|             } |             } | ||||
|             return features; |  | ||||
|  |             STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Unexpected builder type."); | ||||
|         } |         } | ||||
|          |          | ||||
|  |         template <typename ValueType> | ||||
|         bool canHandle(BuilderType const& builderType, storm::storage::SymbolicModelDescription const& modelDescription) { |         bool canHandle(BuilderType const& builderType, storm::storage::SymbolicModelDescription const& modelDescription) { | ||||
|             return true; |  | ||||
|  |             storm::dd::DdType const ddType = storm::dd::DdType::Sylvan; | ||||
|  |             if (!modelDescription.hasModel()) { | ||||
|  |                 // If there is no model to be build, we assume that the task of obtaining a model is either not required or can be accomplished somehow.
 | ||||
|  |                 return true; | ||||
|  |             } | ||||
|  |             STORM_LOG_THROW(modelDescription.isPrismProgram() || modelDescription.isJaniModel(), storm::exceptions::UnexpectedException, "The model is neither PRISM nor Jani which is not expected."); | ||||
|  |             switch (builderType) { | ||||
|  |                 case BuilderType::Explicit: | ||||
|  |                     if (modelDescription.isPrismProgram()) { | ||||
|  |                         return storm::generator::PrismNextStateGenerator<ValueType>::canHandle(modelDescription.asPrismProgram()); | ||||
|  |                     } else { | ||||
|  |                         return storm::generator::JaniNextStateGenerator<ValueType>::canHandle(modelDescription.asJaniModel()); | ||||
|  |                     } | ||||
|  |                 case BuilderType::Dd: | ||||
|  |                     if (modelDescription.isPrismProgram()) { | ||||
|  |                         return storm::builder::DdPrismModelBuilder<ddType, ValueType>::canHandle(modelDescription.asPrismProgram()); | ||||
|  |                     } else { | ||||
|  |                         return storm::builder::DdJaniModelBuilder<ddType, ValueType>::canHandle(modelDescription.asJaniModel()); | ||||
|  |                     } | ||||
|  |                 case BuilderType::Jit: | ||||
|  |                     return storm::builder::jit::ExplicitJitJaniModelBuilder<ValueType>::canHandle(modelDescription.asJaniModel()); | ||||
|  |             } | ||||
|         } |         } | ||||
|          |          | ||||
|  | 
 | ||||
|  |          | ||||
|  |         template bool canHandle<double>(BuilderType const& builderType, storm::storage::SymbolicModelDescription const& modelDescription); | ||||
|  |         template bool canHandle<storm::RationalNumber>(BuilderType const& builderType, storm::storage::SymbolicModelDescription const& modelDescription); | ||||
|  |          | ||||
|     } |     } | ||||
| } | } | ||||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue