Browse Source

Print warning when -importmodel ignores (unsupported) transition rewards file.

accumulation-v4.7
Dave Parker 7 years ago
parent
commit
bf6e02d47e
  1. 8
      prism/src/prism/PrismCL.java

8
prism/src/prism/PrismCL.java

@ -127,6 +127,7 @@ public class PrismCL implements PrismModelListener
private String importLabelsFilename = null; private String importLabelsFilename = null;
private String importStateRewardsFilename = null; private String importStateRewardsFilename = null;
private String importInitDistFilename = null; private String importInitDistFilename = null;
private String importModelWarning = null;
private String propertiesFilename = null; private String propertiesFilename = null;
private String exportTransFilename = null; private String exportTransFilename = null;
private String exportStateRewardsFilename = null; private String exportStateRewardsFilename = null;
@ -588,6 +589,9 @@ public class PrismCL implements PrismModelListener
// parse model // parse model
try { try {
if (importModelWarning != null) {
mainLog.printWarning(importModelWarning);
}
if (importpepa) { if (importpepa) {
mainLog.print("\nImporting PEPA file \"" + modelFilename + "\"...\n"); mainLog.print("\nImporting PEPA file \"" + modelFilename + "\"...\n");
modulesFile = prism.importPepaFile(new File(modelFilename)); modulesFile = prism.importPepaFile(new File(modelFilename));
@ -1886,6 +1890,7 @@ public class PrismCL implements PrismModelListener
String extList = filesString.substring(i + 1); String extList = filesString.substring(i + 1);
String exts[] = extList.split(","); String exts[] = extList.split(",");
// Process file extensions // Process file extensions
importModelWarning = null;
for (String ext : exts) { for (String ext : exts) {
// Items to import // Items to import
if (ext.equals("all")) { if (ext.equals("all")) {
@ -1899,6 +1904,9 @@ public class PrismCL implements PrismModelListener
importstaterewards = true; importstaterewards = true;
importStateRewardsFilename = basename + ".srew"; importStateRewardsFilename = basename + ".srew";
} }
if (new File(basename + ".trew").exists()) {
importModelWarning = "Import of transition rewards is not yet supported so " + basename + ".trew is being ignored";
}
} else if (ext.equals("tra")) { } else if (ext.equals("tra")) {
importtrans = true; importtrans = true;
modelFilename = basename + ".tra"; modelFilename = basename + ".tra";

Loading…
Cancel
Save