@ -4,6 +4,10 @@
# include "src/models/sparse/Dtmc.h"
# include "src/models/sparse/Dtmc.h"
# include "src/models/sparse/StandardRewardModel.h"
# include "src/models/sparse/StandardRewardModel.h"
# include "src/settings/SettingsManager.h"
# include "src/settings/modules/CoreSettings.h"
# include "src/exceptions/WrongFormatException.h"
# include "src/utility/macros.h"
# include "src/utility/macros.h"
namespace storm {
namespace storm {
@ -12,7 +16,8 @@ namespace storm {
template < typename IndexType , typename ValueType >
template < typename IndexType , typename ValueType >
ModelComponentsBuilder < IndexType , ValueType > : : ModelComponentsBuilder ( storm : : jani : : ModelType const & modelType ) : modelType ( modelType ) , isDeterministicModel ( storm : : jani : : isDeterministicModel ( modelType ) ) , isDiscreteTimeModel ( storm : : jani : : isDiscreteTimeModel ( modelType ) ) , currentRowGroup ( 0 ) , currentRow ( 0 ) , transitionMatrixBuilder ( std : : make_unique < storm : : storage : : SparseMatrixBuilder < ValueType > > ( 0 , 0 , 0 , true , ! isDeterministicModel ) ) {
ModelComponentsBuilder < IndexType , ValueType > : : ModelComponentsBuilder ( storm : : jani : : ModelType const & modelType ) : modelType ( modelType ) , isDeterministicModel ( storm : : jani : : isDeterministicModel ( modelType ) ) , isDiscreteTimeModel ( storm : : jani : : isDiscreteTimeModel ( modelType ) ) , currentRowGroup ( 0 ) , currentRow ( 0 ) , transitionMatrixBuilder ( std : : make_unique < storm : : storage : : SparseMatrixBuilder < ValueType > > ( 0 , 0 , 0 , true , ! isDeterministicModel ) ) {
// Intentionally left empty.
dontFixDeadlocks = storm : : settings : : getModule < storm : : settings : : modules : : CoreSettings > ( ) . isDontFixDeadlocksSet ( ) ;
}
}
template < typename IndexType , typename ValueType >
template < typename IndexType , typename ValueType >
@ -30,6 +35,7 @@ namespace storm {
if ( ! isDeterministicModel ) {
if ( ! isDeterministicModel ) {
transitionMatrixBuilder - > newRowGroup ( currentRow ) ;
transitionMatrixBuilder - > newRowGroup ( currentRow ) ;
}
}
if ( ! behaviour . empty ( ) ) {
for ( auto const & choice : behaviour . getChoices ( ) ) {
for ( auto const & choice : behaviour . getChoices ( ) ) {
// Add the elements to the transition matrix.
// Add the elements to the transition matrix.
for ( auto const & element : choice . getDistribution ( ) ) {
for ( auto const & element : choice . getDistribution ( ) ) {
@ -39,6 +45,13 @@ namespace storm {
// Proceed to next row.
// Proceed to next row.
+ + currentRow ;
+ + currentRow ;
}
}
} else {
if ( behaviour . isExpanded ( ) & & dontFixDeadlocks ) {
STORM_LOG_THROW ( false , storm : : exceptions : : WrongFormatException , " Error while creating sparse matrix from JANI model: found deadlock state and fixing deadlocks was explicitly disabled. " ) ;
} else {
// FIXME: fix deadlock
}
}
+ + currentRowGroup ;
+ + currentRowGroup ;
}
}