Browse Source

Added some error detection in -aroptions settings.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@3549 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 15 years ago
parent
commit
4cc990cdc4
  1. 24
      prism/src/explicit/QuantAbstractRefine.java

24
prism/src/explicit/QuantAbstractRefine.java

@ -279,7 +279,11 @@ public abstract class QuantAbstractRefine
}
// Parse
if (opt.equals("verbose") || opt.equals("v")) {
setVerbosity((optVal == null) ? 10 : Integer.parseInt(optVal));
try {
setVerbosity((optVal == null) ? 10 : Integer.parseInt(optVal));
} catch (NumberFormatException e) {
throw new PrismException("Invalid value \"" + optVal + "\" for abstraction-refinement setting \"" + opt + "\"");
}
} else if (opt.matches("refine")) {
if (optVal != null) {
String ss[] = optVal.split(",");
@ -310,7 +314,11 @@ public abstract class QuantAbstractRefine
}
} else if (opt.equals("epsilonref") || opt.equals("eref")) {
if (optVal != null) {
setRefineTermCritParam(Double.parseDouble(optVal));
try {
setRefineTermCritParam(Double.parseDouble(optVal));
} catch (NumberFormatException e) {
throw new PrismException("Invalid value \"" + optVal + "\" for abstraction-refinement setting \"" + opt + "\"");
}
}
} else if (opt.equals("nopre")) {
getModelChecker().setPrecomp(false);
@ -322,11 +330,19 @@ public abstract class QuantAbstractRefine
getModelChecker().setProb1(false);
} else if (opt.equals("epsilon")) {
if (optVal != null) {
getModelChecker().setTermCritParam(Double.parseDouble(optVal));
try {
getModelChecker().setTermCritParam(Double.parseDouble(optVal));
} catch (NumberFormatException e) {
throw new PrismException("Invalid value \"" + optVal + "\" for abstraction-refinement setting \"" + opt + "\"");
}
}
} else if (opt.equals("maxrefs")) {
if (optVal != null) {
setMaxRefinements(Integer.parseInt(optVal));
try {
setMaxRefinements(Integer.parseInt(optVal));
} catch (NumberFormatException e) {
throw new PrismException("Invalid value \"" + optVal + "\" for abstraction-refinement setting \"" + opt + "\"");
}
}
} else if (opt.equals("opt")) {
setOptimise(true);

Loading…
Cancel
Save