@ -43,6 +43,7 @@ import prism.OpRelOpBound;
import prism.PrismComponent ;
import prism.PrismException ;
import prism.PrismSettings ;
import prism.PrismNotSupportedException ;
import explicit.rewards.ConstructRewards ;
import explicit.rewards.MCRewards ;
import explicit.rewards.MDPRewards ;
@ -173,7 +174,7 @@ public class ProbModelChecker extends NonProbModelChecker
} else if ( s . equals ( "Backwards SOR" ) ) {
setLinEqMethod ( LinEqMethod . BACKWARDS_SOR ) ;
} else {
throw new PrismException ( "Explicit engine does not support linear equation solution method \"" + s + "\"" ) ;
throw new PrismNotSupported Exception ( "Explicit engine does not support linear equation solution method \"" + s + "\"" ) ;
}
/ / PRISM_MDP_SOLN_METHOD
s = settings . getString ( PrismSettings . PRISM_MDP_SOLN_METHOD ) ;
@ -188,7 +189,7 @@ public class ProbModelChecker extends NonProbModelChecker
} else if ( s . equals ( "Linear programming" ) ) {
setMDPSolnMethod ( MDPSolnMethod . LINEAR_PROGRAMMING ) ;
} else {
throw new PrismException ( "Explicit engine does not support MDP solution method \"" + s + "\"" ) ;
throw new PrismNotSupported Exception ( "Explicit engine does not support MDP solution method \"" + s + "\"" ) ;
}
/ / PRISM_TERM_CRIT
s = settings . getString ( PrismSettings . PRISM_TERM_CRIT ) ;
@ -197,7 +198,7 @@ public class ProbModelChecker extends NonProbModelChecker
} else if ( s . equals ( "Relative" ) ) {
setTermCrit ( TermCrit . RELATIVE ) ;
} else {
throw new PrismException ( "Unknown termination criterion \"" + s + "\"" ) ;
throw new PrismNotSupported Exception ( "Unknown termination criterion \"" + s + "\"" ) ;
}
/ / PRISM_TERM_CRIT_PARAM
setTermCritParam ( settings . getDouble ( PrismSettings . PRISM_TERM_CRIT_PARAM ) ) ;
@ -211,7 +212,7 @@ public class ProbModelChecker extends NonProbModelChecker
setProb1 ( settings . getBoolean ( PrismSettings . PRISM_PROB1 ) ) ;
/ / PRISM_FAIRNESS
if ( settings . getBoolean ( PrismSettings . PRISM_FAIRNESS ) ) {
throw new PrismException ( "The explicit engine does not support model checking MDPs under fairness" ) ;
throw new PrismNotSupported Exception ( "The explicit engine does not support model checking MDPs under fairness" ) ;
}
/ / PRISM_EXPORT_ADV
@ -477,11 +478,11 @@ public class ProbModelChecker extends NonProbModelChecker
{
/ / Only support < < > > right now , not [ [ ] ]
if ( ! expr . isThereExists ( ) )
throw new PrismException ( "The " + expr . getOperatorString ( ) + " operator is not yet supported" ) ;
throw new PrismNotSupported Exception ( "The " + expr . getOperatorString ( ) + " operator is not yet supported" ) ;
/ / Only support < < > > for MDPs right now
if ( ! ( this instanceof MDPModelChecker ) )
throw new PrismException ( "The " + expr . getOperatorString ( ) + " operator is only supported for MDPs currently" ) ;
throw new PrismNotSupported Exception ( "The " + expr . getOperatorString ( ) + " operator is only supported for MDPs currently" ) ;
/ / Extract coalition info
Coalition coalition = expr . getCoalition ( ) ;
@ -646,7 +647,7 @@ public class ProbModelChecker extends NonProbModelChecker
res = ( ( STPGModelChecker ) this ) . computeNextProbs ( ( STPG ) model , target , minMax . isMin1 ( ) , minMax . isMin2 ( ) ) ;
break ;
default :
throw new PrismException ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
throw new PrismNotSupported Exception ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
}
return StateValues . createFromDoubleArray ( res . soln , model ) ;
}
@ -723,7 +724,7 @@ public class ProbModelChecker extends NonProbModelChecker
res = ( ( STPGModelChecker ) this ) . computeBoundedUntilProbs ( ( STPG ) model , remain , target , windowSize , minMax . isMin1 ( ) , minMax . isMin2 ( ) ) ;
break ;
default :
throw new PrismException ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
throw new PrismNotSupported Exception ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
}
sv = StateValues . createFromDoubleArray ( res . soln , model ) ;
}
@ -743,9 +744,9 @@ public class ProbModelChecker extends NonProbModelChecker
break ;
case STPG :
/ / TODO ( JK ) : Figure out if we can handle lower bounds for STPG in the same way
throw new PrismException ( "Lower bounds not yet supported for STPGModelChecker" ) ;
throw new PrismNotSupported Exception ( "Lower bounds not yet supported for STPGModelChecker" ) ;
default :
throw new PrismException ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
throw new PrismNotSupported Exception ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
}
}
@ -781,7 +782,7 @@ public class ProbModelChecker extends NonProbModelChecker
res = ( ( STPGModelChecker ) this ) . computeUntilProbs ( ( STPG ) model , remain , target , minMax . isMin1 ( ) , minMax . isMin2 ( ) ) ;
break ;
default :
throw new PrismException ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
throw new PrismNotSupported Exception ( "Cannot model check " + expr + " for " + model . getModelType ( ) + "s" ) ;
}
return StateValues . createFromDoubleArray ( res . soln , model ) ;
}
@ -792,7 +793,7 @@ public class ProbModelChecker extends NonProbModelChecker
protected StateValues checkProbPathFormulaLTL ( Model model , Expression expr , boolean qual , MinMax minMax , BitSet statesOfInterest ) throws PrismException
{
/ / To be overridden by subclasses
throw new PrismException ( "Computation not implemented yet" ) ;
throw new PrismNotSupported Exception ( "Computation not implemented yet" ) ;
}
/ * *
@ -854,7 +855,7 @@ public class ProbModelChecker extends NonProbModelChecker
rewards = constructRewards . buildMDPRewardStructure ( ( MDP ) model , rewStruct , constantValues ) ;
break ;
default :
throw new PrismException ( "Cannot build rewards for " + model . getModelType ( ) + "s" ) ;
throw new PrismNotSupported Exception ( "Cannot build rewards for " + model . getModelType ( ) + "s" ) ;
}
return rewards ;
}
@ -879,7 +880,7 @@ public class ProbModelChecker extends NonProbModelChecker
rewards = checkRewardCumulative ( model , modelRewards , exprTemp , minMax ) ;
break ;
default :
throw new PrismException ( "Explicit engine does not yet handle the " + exprTemp . getOperatorSymbol ( ) + " reward operator" ) ;
throw new PrismNotSupported Exception ( "Explicit engine does not yet handle the " + exprTemp . getOperatorSymbol ( ) + " reward operator" ) ;
}
}
@ -914,7 +915,7 @@ public class ProbModelChecker extends NonProbModelChecker
res = ( ( STPGModelChecker ) this ) . computeReachRewards ( ( STPG ) model , ( STPGRewards ) modelRewards , target , minMax . isMin1 ( ) , minMax . isMin2 ( ) ) ;
break ;
default :
throw new PrismException ( "Explicit engine does not yet handle the " + expr . getOperatorSymbol ( ) + " reward operator for " + model . getModelType ( )
throw new PrismNotSupported Exception ( "Explicit engine does not yet handle the " + expr . getOperatorSymbol ( ) + " reward operator for " + model . getModelType ( )
+ "s" ) ;
}
return StateValues . createFromDoubleArray ( res . soln , model ) ;
@ -938,7 +939,7 @@ public class ProbModelChecker extends NonProbModelChecker
res = ( ( CTMCModelChecker ) this ) . computeInstantaneousRewards ( ( CTMC ) model , ( MCRewards ) modelRewards , t ) ;
break ;
default :
throw new PrismException ( "Explicit engine does not yet handle the " + expr . getOperatorSymbol ( ) + " reward operator for " + model . getModelType ( )
throw new PrismNotSupported Exception ( "Explicit engine does not yet handle the " + expr . getOperatorSymbol ( ) + " reward operator for " + model . getModelType ( )
+ "s" ) ;
}
return StateValues . createFromDoubleArray ( res . soln , model ) ;
@ -954,7 +955,7 @@ public class ProbModelChecker extends NonProbModelChecker
/ / Check that there is an upper time bound
if ( expr . getUpperBound ( ) = = null ) {
throw new PrismException ( "Cumulative reward operator without time bound (C) is only allowed for multi-objective queries" ) ;
throw new PrismNotSupported Exception ( "Cumulative reward operator without time bound (C) is only allowed for multi-objective queries" ) ;
}
/ / Get time bound
@ -989,7 +990,7 @@ public class ProbModelChecker extends NonProbModelChecker
result . setStrategy ( res . strat ) ;
break ;
default :
throw new PrismException ( "Explicit engine does not yet handle the " + expr . getOperatorSymbol ( ) + " reward operator for " + model . getModelType ( )
throw new PrismNotSupported Exception ( "Explicit engine does not yet handle the " + expr . getOperatorSymbol ( ) + " reward operator for " + model . getModelType ( )
+ "s" ) ;
}
return StateValues . createFromDoubleArray ( res . soln , model ) ;
@ -1041,7 +1042,7 @@ public class ProbModelChecker extends NonProbModelChecker
res = ( ( DTMCModelChecker ) this ) . computeSteadyStateBackwardsProbs ( ( DTMC ) model , multProbs ) ;
break ;
default :
throw new PrismException ( "Explicit engine does not yet handle the S operator for " + model . getModelType ( ) + "s" ) ;
throw new PrismNotSupported Exception ( "Explicit engine does not yet handle the S operator for " + model . getModelType ( ) + "s" ) ;
}
return StateValues . createFromDoubleArray ( res . soln , model ) ;
}