|
|
|
@ -754,6 +754,8 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
double tolerance = settings.getDouble(PrismSettings.PRISM_PARETO_EPSILON); |
|
|
|
int maxIters = settings.getInteger(PrismSettings.PRISM_MULTI_MAX_POINTS); |
|
|
|
|
|
|
|
int exportAdvSetting = settings.getChoice(PrismSettings.PRISM_EXPORT_ADV); |
|
|
|
|
|
|
|
NativeIntArray adversary = new NativeIntArray((int) modelProduct.getNumStates()); |
|
|
|
int dimProb = targets.length; |
|
|
|
int dimReward = rewards.size(); |
|
|
|
@ -781,6 +783,12 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
NDSparseMatrix trans_matrix = NDSparseMatrix.BuildNDSparseMatrix(a, modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars()); |
|
|
|
|
|
|
|
// If adversary generation is enabled, we build/store action info |
|
|
|
if (settings.getChoice(PrismSettings.PRISM_EXPORT_ADV) != Prism.EXPORT_ADV_NONE) { |
|
|
|
NDSparseMatrix.AddActionsToNDSparseMatrix(a, modelProduct.getTransActions(), modelProduct.getODD(), modelProduct.getAllDDRowVars(), |
|
|
|
modelProduct.getAllDDColVars(), modelProduct.getAllDDNondetVars(), trans_matrix); |
|
|
|
} |
|
|
|
|
|
|
|
//create double vectors for probabilistic objectives |
|
|
|
for (int i = 0; i < dimProb; i++) { |
|
|
|
probDoubleVectors[i] = new DoubleVector(targets[i], modelProduct.getAllDDRowVars(), modelProduct.getODD()); |
|
|
|
@ -795,6 +803,9 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
|
|
|
|
JDD.Deref(a); |
|
|
|
|
|
|
|
// Disable adversary generation (if it was switched on) for these initial computations |
|
|
|
PrismNative.setExportAdv(Prism.EXPORT_ADV_NONE); |
|
|
|
|
|
|
|
for (int i = 0; i < dimProb; i++) { |
|
|
|
double[] result; |
|
|
|
|
|
|
|
@ -806,7 +817,7 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
rewardStepBounds); |
|
|
|
} else { |
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, modelProduct.getSynchs(), probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
rewardStepBounds); |
|
|
|
} |
|
|
|
|
|
|
|
@ -833,7 +844,7 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
rewardStepBounds); |
|
|
|
} else { |
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, modelProduct.getSynchs(), probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
rewardStepBounds); |
|
|
|
} |
|
|
|
|
|
|
|
@ -846,6 +857,9 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Reinstate temporarily-disabled adversary generation setting |
|
|
|
PrismNative.setExportAdv(exportAdvSetting); |
|
|
|
|
|
|
|
if (verbose) |
|
|
|
mainLog.println("Points for initial tile: " + pointsForInitialTile); |
|
|
|
|
|
|
|
@ -869,6 +883,12 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
weights[i] = direction.getCoord(i); |
|
|
|
} |
|
|
|
|
|
|
|
// If adversary generation is enabled, we amend the filename so that multiple adversaries can be exported |
|
|
|
String advFileName = settings.getString(PrismSettings.PRISM_EXPORT_ADV_FILENAME); |
|
|
|
if (settings.getChoice(PrismSettings.PRISM_EXPORT_ADV) != Prism.EXPORT_ADV_NONE) { |
|
|
|
PrismNative.setExportAdvFilename(PrismUtils.addCounterSuffixToFilename(advFileName, iters)); |
|
|
|
} |
|
|
|
|
|
|
|
double[] result; |
|
|
|
if (prism.getMDPSolnMethod() == Prism.MDP_MULTI_GAUSSSEIDEL) { |
|
|
|
result = PrismSparse.NondetMultiObjGS(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
@ -876,7 +896,7 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
rewardStepBounds); |
|
|
|
} else { |
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, modelProduct.getSynchs(), probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
rewardStepBounds); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1047,7 +1067,7 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
} else { |
|
|
|
//System.out.println("Not doing GS"); |
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, null, null, new NDSparseMatrix[] { rewSparseMatrices[0] }, |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, modelProduct.getSynchs(), null, null, new NDSparseMatrix[] { rewSparseMatrices[0] }, |
|
|
|
new double[] { 1.0 }, new int[] { rewardStepBounds[0] }); |
|
|
|
} |
|
|
|
numberOfPoints++; |
|
|
|
@ -1085,7 +1105,7 @@ public class MultiObjModelChecker extends PrismComponent |
|
|
|
rewardStepBounds); |
|
|
|
} else { |
|
|
|
result = PrismSparse.NondetMultiObj(modelProduct.getODD(), modelProduct.getAllDDRowVars(), modelProduct.getAllDDColVars(), |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
modelProduct.getAllDDNondetVars(), false, st, adversary, trans_matrix, modelProduct.getSynchs(), probDoubleVectors, probStepBounds, rewSparseMatrices, weights, |
|
|
|
rewardStepBounds); |
|
|
|
} |
|
|
|
numberOfPoints++; |
|
|
|
|