@ -57,15 +57,15 @@ namespace storage {
BEColourClass ( ) = default ;
BEColourClass ( storm : : storage : : DFTElement Type t , ValueType a , ValueType p , size_t h ) : type ( t ) , hash ( h ) , aRate ( a ) , pRate ( p ) {
STORM_LOG_ASSERT ( t = = storm : : storage : : DFTElement Type: : BE_ EXP, " Expected type BE_ EXP but got type " < < t ) ;
BEColourClass ( storm : : storage : : BE Type t , ValueType a , ValueType p , size_t h ) : type ( t ) , hash ( h ) , aRate ( a ) , pRate ( p ) {
STORM_LOG_ASSERT ( t = = storm : : storage : : BE Type: : EXPONENTIAL , " Expected type EXPONENTIAL but got type " < < t ) ;
}
BEColourClass ( storm : : storage : : DFTElement Type t , bool fail , size_t h ) : type ( t ) , hash ( h ) , failed ( fail ) {
STORM_LOG_ASSERT ( t = = storm : : storage : : DFTElement Type: : BE_ CONST, " Expected type BE_ CONST but got type " < < t ) ;
BEColourClass ( storm : : storage : : BE Type t , bool fail , size_t h ) : type ( t ) , hash ( h ) , failed ( fail ) {
STORM_LOG_ASSERT ( t = = storm : : storage : : BE Type: : CONSTAN T , " Expected type CONSTAN T but got type " < < t ) ;
}
storm : : storage : : DFTElement Type type ;
storm : : storage : : BE Type type ;
size_t hash ;
ValueType aRate ;
ValueType pRate ;
@ -79,9 +79,9 @@ namespace storage {
return false ;
}
switch ( lhs . type ) {
case storm : : storage : : DFTElement Type: : BE_ EXP:
case storm : : storage : : BE Type: : EXPONENTIAL :
return lhs . hash = = rhs . hash & & lhs . aRate = = rhs . aRate & & lhs . pRate = = rhs . pRate ;
case storm : : storage : : DFTElement Type: : BE_ CONST:
case storm : : storage : : BE Type: : CONSTAN T :
return lhs . hash = = rhs . hash & & lhs . failed = = rhs . failed ;
default :
STORM_LOG_THROW ( false , storm : : exceptions : : InvalidArgumentException , " BE of type ' " < < lhs . type < < " ' is not known. " ) ;
@ -271,21 +271,21 @@ namespace storage {
protected :
void colourize ( std : : shared_ptr < const DFTBE < ValueType > > const & be ) {
switch ( be - > t ype( ) ) {
case storm : : storage : : DFTElementType : : BE_EXP :
switch ( be - > beT ype( ) ) {
case storm : : storage : : BEType : : CONSTANT :
{
auto beExp = std : : static_pointer_cast < BEExponential < ValueType > const > ( be ) ;
beColour [ beExp - > id ( ) ] = BEColourClass < ValueType > ( beExp - > t ype ( ) , beExp - > activeFailureRate ( ) , beExp - > passiveFailureRate ( ) , beExp - > nrParents ( ) ) ;
auto beConst = std : : static_pointer_cast < BEConst < ValueType > const > ( be ) ;
beColour [ beConst - > id ( ) ] = BEColourClass < ValueType > ( beConst - > beT ype ( ) , beConst - > failed ( ) , beConst - > nrParents ( ) ) ;
break ;
}
case storm : : storage : : DFTElementType : : BE_CONST :
case storm : : storage : : BEType : : EXPONENTIAL :
{
auto beConst = std : : static_pointer_cast < BEConst < ValueType > const > ( be ) ;
beColour [ beConst - > id ( ) ] = BEColourClass < ValueType > ( beConst - > t ype ( ) , beConst - > failed ( ) , beConst - > nrParents ( ) ) ;
auto beExp = std : : static_pointer_cast < BEExponential < ValueType > const > ( be ) ;
beColour [ beExp - > id ( ) ] = BEColourClass < ValueType > ( beExp - > beT ype ( ) , beExp - > activeFailureRate ( ) , beExp - > passiveFailureRate ( ) , beExp - > nrParents ( ) ) ;
break ;
}
default :
STORM_LOG_THROW ( false , storm : : exceptions : : InvalidArgumentException , " BE of type ' " < < be - > t ype( ) < < " ' is not known. " ) ;
STORM_LOG_THROW ( false , storm : : exceptions : : InvalidArgumentException , " BE of type ' " < < be - > beT ype( ) < < " ' is not known. " ) ;
break ;
}
}
@ -299,21 +299,21 @@ namespace storage {
void colourize ( std : : shared_ptr < const DFTDependency < ValueType > > const & dep ) {
/ / TODO this can be improved for n - ary dependencies .
std : : shared_ptr < DFTBE < ValueType > const > be = dep - > dependentEvents ( ) [ 0 ] ;
switch ( be - > t ype( ) ) {
case storm : : storage : : DFTElementType : : BE_EXP :
switch ( be - > beT ype( ) ) {
case storm : : storage : : BEType : : CONSTANT :
{
auto beExp = std : : static_pointer_cast < BEExponential < ValueType > const > ( be ) ;
depColour [ dep - > id ( ) ] = std : : pair < ValueType , ValueType > ( dep - > probability ( ) , beExp - > activeFailureRate ( ) ) ;
auto beConst = std : : static_pointer_cast < BEConst < ValueType > const > ( be ) ;
depColour [ dep - > id ( ) ] = std : : pair < ValueType , ValueType > ( dep - > probability ( ) , beConst - > failed ( ) ? storm : : utility : : one < ValueType > ( ) : storm : : utility : : zero < ValueType > ( ) ) ;
break ;
}
case storm : : storage : : DFTElementType : : BE_CONST :
case storm : : storage : : BEType : : EXPONENTIAL :
{
auto beConst = std : : static_pointer_cast < BEConst < ValueType > const > ( be ) ;
depColour [ dep - > id ( ) ] = std : : pair < ValueType , ValueType > ( dep - > probability ( ) , beConst - > failed ( ) ? storm : : utility : : one < ValueType > ( ) : storm : : utility : : zero < ValueType > ( ) ) ;
auto beExp = std : : static_pointer_cast < BEExponential < ValueType > const > ( be ) ;
depColour [ dep - > id ( ) ] = std : : pair < ValueType , ValueType > ( dep - > probability ( ) , beExp - > activeFailureRate ( ) ) ;
break ;
}
default :
STORM_LOG_THROW ( false , storm : : exceptions : : InvalidArgumentException , " BE of type ' " < < be - > t ype( ) < < " ' is not known. " ) ;
STORM_LOG_THROW ( false , storm : : exceptions : : InvalidArgumentException , " BE of type ' " < < be - > beT ype( ) < < " ' is not known. " ) ;
break ;
}
}
@ -706,10 +706,10 @@ namespace std {
groupHash | = ( static_cast < uint_fast64_t > ( bcc . type ) & fivebitmask ) < < ( 62 - 5 ) ;
switch ( bcc . type ) {
case storm : : storage : : DFTElementType : : BE_EXP :
return ( hasher ( bcc . aRate ) ^ hasher ( bcc . pRate ) < < 8 ) ;
case storm : : storage : : DFTElementType : : BE_CONST :
case storm : : storage : : BEType : : CONSTANT :
return ( bcc . failed < < 8 ) ;
case storm : : storage : : BEType : : EXPONENTIAL :
return ( hasher ( bcc . aRate ) ^ hasher ( bcc . pRate ) < < 8 ) ;
default :
STORM_LOG_THROW ( false , storm : : exceptions : : InvalidArgumentException , " BE of type ' " < < bcc . type < < " ' is not known. " ) ;
break ;