|
|
@ -68,8 +68,9 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//TODO: dra's element is changed here, not neat. |
|
|
//TODO: dra's element is changed here, not neat. |
|
|
protected NondetModel constructDRAandProductMulti(NondetModel model, LTLModelChecker mcLtl, ModelChecker modelChecker, Expression ltl, int i, DA<BitSet,AcceptanceRabin> dra[], Operator operator, |
|
|
|
|
|
Expression targetExpr, JDDVars draDDRowVars, JDDVars draDDColVars, JDDNode ddStateIndex) throws PrismException |
|
|
|
|
|
|
|
|
protected NondetModel constructDRAandProductMulti(NondetModel model, LTLModelChecker mcLtl, ModelChecker modelChecker, Expression ltl, int i, |
|
|
|
|
|
DA<BitSet, AcceptanceRabin> dra[], Operator operator, Expression targetExpr, JDDVars draDDRowVars, JDDVars draDDColVars, JDDNode ddStateIndex) |
|
|
|
|
|
throws PrismException |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
// TODO (JK): Adapt to support simple path formulas with bounds via DRA construction |
|
|
// TODO (JK): Adapt to support simple path formulas with bounds via DRA construction |
|
|
@ -262,7 +263,8 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
|
|
|
|
|
for (int i = 0; i < opsAndBounds.probSize(); i++) { |
|
|
for (int i = 0; i < opsAndBounds.probSize(); i++) { |
|
|
if (opsAndBounds.getProbOperator(i) != Operator.P_MAX) { |
|
|
if (opsAndBounds.getProbOperator(i) != Operator.P_MAX) { |
|
|
tmpOpsAndBounds.add(opsAndBounds.getOpRelOpBound(i), opsAndBounds.getProbOperator(i), opsAndBounds.getProbBound(i), opsAndBounds.getProbStepBound(i)); |
|
|
|
|
|
|
|
|
tmpOpsAndBounds.add(opsAndBounds.getOpRelOpBound(i), opsAndBounds.getProbOperator(i), opsAndBounds.getProbBound(i), |
|
|
|
|
|
opsAndBounds.getProbStepBound(i)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
tmpOpsAndBounds.add(new OpRelOpBound("R", RelOp.MAX, -1.0), Operator.R_MAX, -1.0, -1); |
|
|
tmpOpsAndBounds.add(new OpRelOpBound("R", RelOp.MAX, -1.0), Operator.R_MAX, -1.0, -1); |
|
|
@ -354,9 +356,9 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected void findTargetStates(NondetModel modelProduct, LTLModelChecker mcLtl, int numTargets, int conflictformulae, boolean reachExpr[], DA<BitSet,AcceptanceRabin> dra[], |
|
|
|
|
|
JDDVars draDDRowVars[], JDDVars draDDColVars[], List<JDDNode> targetDDs, List<JDDNode> multitargetDDs, List<Integer> multitargetIDs) |
|
|
|
|
|
throws PrismException |
|
|
|
|
|
|
|
|
protected void findTargetStates(NondetModel modelProduct, LTLModelChecker mcLtl, int numTargets, int conflictformulae, boolean reachExpr[], |
|
|
|
|
|
DA<BitSet, AcceptanceRabin> dra[], JDDVars draDDRowVars[], JDDVars draDDColVars[], List<JDDNode> targetDDs, List<JDDNode> multitargetDDs, |
|
|
|
|
|
List<Integer> multitargetIDs) throws PrismException |
|
|
{ |
|
|
{ |
|
|
int i, j; |
|
|
int i, j; |
|
|
long l; |
|
|
long l; |
|
|
@ -679,8 +681,7 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
double time = ((double) (timePost - timePre)) / 1000.0; |
|
|
double time = ((double) (timePost - timePre)) / 1000.0; |
|
|
mainLog.println("Multi-objective value iterations took " + time + " s."); |
|
|
mainLog.println("Multi-objective value iterations took " + time + " s."); |
|
|
} else { |
|
|
} else { |
|
|
throw new PrismException("Don't know how to model-check using the method: " |
|
|
|
|
|
+ method); |
|
|
|
|
|
|
|
|
throw new PrismException("Don't know how to model-check using the method: " + method); |
|
|
} |
|
|
} |
|
|
} catch (PrismException e) { |
|
|
} catch (PrismException e) { |
|
|
throw e; |
|
|
throw e; |
|
|
@ -701,8 +702,8 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
return value; |
|
|
return value; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected Object weightedMultiReachProbs(NondetModel modelProduct, JDDNode yes_ones, JDDNode maybe, JDDNode st, JDDNode[] targets, List<JDDNode> rewards, OpsAndBoundsList opsAndBounds) |
|
|
|
|
|
throws PrismException |
|
|
|
|
|
|
|
|
protected Object weightedMultiReachProbs(NondetModel modelProduct, JDDNode yes_ones, JDDNode maybe, JDDNode st, JDDNode[] targets, List<JDDNode> rewards, |
|
|
|
|
|
OpsAndBoundsList opsAndBounds) throws PrismException |
|
|
{ |
|
|
{ |
|
|
int numberOfMaximizing = opsAndBounds.numberOfNumerical(); |
|
|
int numberOfMaximizing = opsAndBounds.numberOfNumerical(); |
|
|
|
|
|
|
|
|
@ -730,7 +731,6 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
for (int i = 0; i < probStepBounds.length; i++) |
|
|
for (int i = 0; i < probStepBounds.length; i++) |
|
|
probStepBounds[i] = opsAndBounds.getProbStepBound(i); |
|
|
probStepBounds[i] = opsAndBounds.getProbStepBound(i); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double timer = System.currentTimeMillis(); |
|
|
double timer = System.currentTimeMillis(); |
|
|
boolean min = false; |
|
|
boolean min = false; |
|
|
|
|
|
|
|
|
@ -812,13 +812,13 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
new double[] { 1.0 }, null); |
|
|
new double[] { 1.0 }, null); |
|
|
}*/ |
|
|
}*/ |
|
|
if (settings.getChoice(PrismSettings.PRISM_MDP_SOLN_METHOD) == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
if (settings.getChoice(PrismSettings.PRISM_MDP_SOLN_METHOD) == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} else { |
|
|
} else { |
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//The following is thrown because in this case the i-th dimension is |
|
|
//The following is thrown because in this case the i-th dimension is |
|
|
@ -851,13 +851,13 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
new double[] { 1.0 }, new int[] { rewardStepBounds[i] }); |
|
|
new double[] { 1.0 }, new int[] { rewardStepBounds[i] }); |
|
|
}*/ |
|
|
}*/ |
|
|
if (settings.getChoice(PrismSettings.PRISM_MDP_SOLN_METHOD) == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
if (settings.getChoice(PrismSettings.PRISM_MDP_SOLN_METHOD) == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} else { |
|
|
} else { |
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
numberOfPoints++; |
|
|
numberOfPoints++; |
|
|
@ -894,13 +894,13 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
|
|
|
|
|
double[] result; |
|
|
double[] result; |
|
|
if (prism.getMDPSolnMethod() == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
if (prism.getMDPSolnMethod() == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} else { |
|
|
} else { |
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* //Minimizing operators are negated, and for Pareto we need to maximize. |
|
|
/* //Minimizing operators are negated, and for Pareto we need to maximize. |
|
|
@ -976,7 +976,6 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
for (int i = 0; i < probStepBounds.length; i++) |
|
|
for (int i = 0; i < probStepBounds.length; i++) |
|
|
probStepBounds[i] = opsAndBounds.getProbStepBound(i); |
|
|
probStepBounds[i] = opsAndBounds.getProbStepBound(i); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double timer = System.currentTimeMillis(); |
|
|
double timer = System.currentTimeMillis(); |
|
|
boolean min = false; |
|
|
boolean min = false; |
|
|
|
|
|
|
|
|
@ -999,7 +998,8 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
|
|
|
|
|
boolean maximizingProb = (opsAndBounds.probSize() > 0 && (opsAndBounds.getProbOperator(0) == Operator.P_MAX || opsAndBounds.getProbOperator(0) == Operator.P_MIN)); |
|
|
boolean maximizingProb = (opsAndBounds.probSize() > 0 && (opsAndBounds.getProbOperator(0) == Operator.P_MAX || opsAndBounds.getProbOperator(0) == Operator.P_MIN)); |
|
|
boolean maximizingReward = (opsAndBounds.rewardSize() > 0 && (opsAndBounds.getRewardOperator(0) == Operator.R_MAX || opsAndBounds.getRewardOperator(0) == Operator.R_MIN)); |
|
|
boolean maximizingReward = (opsAndBounds.rewardSize() > 0 && (opsAndBounds.getRewardOperator(0) == Operator.R_MAX || opsAndBounds.getRewardOperator(0) == Operator.R_MIN)); |
|
|
boolean maximizingNegated = (maximizingProb && opsAndBounds.getProbOperator(0) == Operator.P_MIN) || (maximizingReward && opsAndBounds.getRewardOperator(0) == Operator.R_MIN); |
|
|
|
|
|
|
|
|
boolean maximizingNegated = (maximizingProb && opsAndBounds.getProbOperator(0) == Operator.P_MIN) |
|
|
|
|
|
|| (maximizingReward && opsAndBounds.getRewardOperator(0) == Operator.R_MIN); |
|
|
|
|
|
|
|
|
int maxIters = settings.getInteger(PrismSettings.PRISM_MULTI_MAX_POINTS); |
|
|
int maxIters = settings.getInteger(PrismSettings.PRISM_MULTI_MAX_POINTS); |
|
|
|
|
|
|
|
|
@ -1103,13 +1103,13 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
|
|
|
|
|
double[] result; |
|
|
double[] result; |
|
|
if (prism.getMDPSolnMethod() == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
if (prism.getMDPSolnMethod() == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} else { |
|
|
} else { |
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), false, st, adversary, |
|
|
|
|
|
trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, rewardStepBounds); |
|
|
|
|
|
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
|
|
rewardStepBounds); |
|
|
} |
|
|
} |
|
|
numberOfPoints++; |
|
|
numberOfPoints++; |
|
|
|
|
|
|
|
|
@ -1123,7 +1123,6 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
computedPoints.add(newPoint); |
|
|
computedPoints.add(newPoint); |
|
|
computedDirections.add(direction); |
|
|
computedDirections.add(direction); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (prism.getExportMultiGraphs()) |
|
|
//if (prism.getExportMultiGraphs()) |
|
|
// MultiObjUtils.printGraphFileDebug(targetPoint, computedPoints, computedDirections, prism.getExportMultiGraphsDir(), output++); |
|
|
// MultiObjUtils.printGraphFileDebug(targetPoint, computedPoints, computedDirections, prism.getExportMultiGraphsDir(), output++); |
|
|
|
|
|
|
|
|
|