|
|
|
@ -78,8 +78,15 @@ public class AccumulationTransformation<M extends ModelExplicit> implements Mode |
|
|
|
// TODO: WHILE getFirstAccumulationExpression |
|
|
|
|
|
|
|
// Get the first ExpressionAccumulation |
|
|
|
ExpressionAccumulation accexp = transformedExpression.getFirstAccumulationExpression(); |
|
|
|
boolean singleTrack = true; |
|
|
|
ExpressionAccumulation accexp = transformedExpression.getFirstAccumulationExpressionWithoutTemporal(); |
|
|
|
if(accexp == null) { |
|
|
|
singleTrack = false; |
|
|
|
accexp = transformedExpression.getFirstAccumulationExpression(); |
|
|
|
} |
|
|
|
|
|
|
|
mc.getLog().println(" [AT] for " + accexp); |
|
|
|
mc.getLog().println(" ... single track? " + singleTrack); |
|
|
|
|
|
|
|
// Rewrite it, if it is a BOX |
|
|
|
if (accexp.getSymbol().isBox()) { |
|
|
|
@ -114,24 +121,24 @@ public class AccumulationTransformation<M extends ModelExplicit> implements Mode |
|
|
|
|
|
|
|
if(isComplex || forceComplex) { |
|
|
|
mc.getLog().println(" ... using complex!"); |
|
|
|
doTransformationComplex(accexp, rewards); |
|
|
|
doTransformationComplex(accexp, rewards, singleTrack); |
|
|
|
} else { |
|
|
|
mc.getLog().println(" ... using simple!"); |
|
|
|
doTransformationSimple(accexp, rewards); |
|
|
|
doTransformationSimple(accexp, rewards, singleTrack); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
protected void doTransformationComplex(ExpressionAccumulation accexp, Vector<Rewards> rewards) throws PrismException { |
|
|
|
protected void doTransformationComplex(ExpressionAccumulation accexp, Vector<Rewards> rewards, boolean singleTrack) throws PrismException { |
|
|
|
StopWatch clock = new StopWatch(mc.getLog()); |
|
|
|
|
|
|
|
// Build the product |
|
|
|
clock.start("accumulation product construction"); |
|
|
|
|
|
|
|
if(accexp.hasRegularExpression()) { |
|
|
|
product = (AccumulationProductComplexRegular<M>) AccumulationProductComplexRegular.generate(originalModel, accexp, rewards, mc, statesOfInterest); |
|
|
|
product = (AccumulationProductComplexRegular<M>) AccumulationProductComplexRegular.generate(originalModel, accexp, rewards, singleTrack, mc, statesOfInterest); |
|
|
|
} else if (accexp.hasBoundExpression()) { |
|
|
|
product = (AccumulationProductComplexCounting<M>) AccumulationProductComplexCounting.generate(originalModel, accexp, rewards, mc, statesOfInterest); |
|
|
|
product = (AccumulationProductComplexCounting<M>) AccumulationProductComplexCounting.generate(originalModel, accexp, rewards, singleTrack, mc, statesOfInterest); |
|
|
|
} else { |
|
|
|
throw new PrismException("Accumulation Expression has no valid monitor!"); |
|
|
|
} |
|
|
|
@ -176,7 +183,7 @@ public class AccumulationTransformation<M extends ModelExplicit> implements Mode |
|
|
|
} |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
protected void doTransformationSimple(ExpressionAccumulation accexp, Vector<Rewards> rewards) throws PrismException { |
|
|
|
protected void doTransformationSimple(ExpressionAccumulation accexp, Vector<Rewards> rewards, boolean singleTrack) throws PrismException { |
|
|
|
StopWatch clock = new StopWatch(mc.getLog()); |
|
|
|
|
|
|
|
// Build the product |
|
|
|
@ -184,9 +191,9 @@ public class AccumulationTransformation<M extends ModelExplicit> implements Mode |
|
|
|
|
|
|
|
if(accexp.hasRegularExpression()) { |
|
|
|
//throw new PrismException("I don't know how to do regular things..."); |
|
|
|
product = (AccumulationProductSimpleRegular<M>) AccumulationProductSimpleRegular.generate(originalModel, accexp, rewards, mc, statesOfInterest); |
|
|
|
product = (AccumulationProductSimpleRegular<M>) AccumulationProductSimpleRegular.generate(originalModel, accexp, rewards, singleTrack, mc, statesOfInterest); |
|
|
|
} else if (accexp.hasBoundExpression()) { |
|
|
|
product = (AccumulationProductSimpleCounting<M>) AccumulationProductSimpleCounting.generate(originalModel, accexp, rewards, mc, statesOfInterest); |
|
|
|
product = (AccumulationProductSimpleCounting<M>) AccumulationProductSimpleCounting.generate(originalModel, accexp, rewards, singleTrack, mc, statesOfInterest); |
|
|
|
} else { |
|
|
|
throw new PrismException("Accumulation Expression has no valid monitor!"); |
|
|
|
} |
|
|
|
|