|
|
|
@ -30,6 +30,8 @@ public abstract class AccumulationProduct<M extends Model,Component> extends Pro |
|
|
|
protected final ArrayList<BitSet> labels; |
|
|
|
|
|
|
|
protected int numberOfTracks; |
|
|
|
protected int accumulationLength; |
|
|
|
|
|
|
|
protected int numberOfWeights; |
|
|
|
|
|
|
|
protected final ArrayList<BitSet> initStates; |
|
|
|
@ -54,6 +56,10 @@ public abstract class AccumulationProduct<M extends Model,Component> extends Pro |
|
|
|
return numberOfTracks; |
|
|
|
} |
|
|
|
|
|
|
|
public final int getAccumulationLength() { |
|
|
|
return accumulationLength; |
|
|
|
} |
|
|
|
|
|
|
|
protected final boolean constraintHolds(final AccumulationTrack<Component> track) throws PrismException { |
|
|
|
return ctx.accexp.getConstraint().holds(ctx, track.getWeights()); |
|
|
|
} |
|
|
|
@ -87,13 +93,16 @@ public abstract class AccumulationProduct<M extends Model,Component> extends Pro |
|
|
|
|
|
|
|
protected final AccumulationState<Component> updateAccumulationState(final int modelFromStateId, final AccumulationState<Component> accstate, final HashMap<Object, Double> weights) throws PrismException { |
|
|
|
// If we are in singleTrack mode and the last restart is the numberOfTracks, we can stop... |
|
|
|
if(ctx.singleTrack && (accstate.lastRestartNr == numberOfTracks-1)) { |
|
|
|
// We still need to return an "empty" accstate. |
|
|
|
|
|
|
|
if(ctx.singleTrack && (accstate.lastRestartNr == numberOfTracks)) { |
|
|
|
// We still need to return an "empty" accstate |
|
|
|
AccumulationState<Component> newAccstate = this.accStates.getById(0); |
|
|
|
newAccstate.lastRestartNr = numberOfTracks-1; |
|
|
|
newAccstate.lastRestartNr = numberOfTracks; |
|
|
|
return newAccstate; |
|
|
|
//return accstate; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// If this is not a recorded action, we can return the same accstate. Copies are made on modification. |
|
|
|
if(!recordIn(modelFromStateId)) { return accstate; } |
|
|
|
// ...otherwise proceed. |
|
|
|
|