From 53cfce15bb7d13ebc3f4adb287f0946c9a8dec34 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Mon, 11 Nov 2013 16:07:27 +0000 Subject: [PATCH] Add -exportsccs and -exportmecs to -help. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@7568 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/prism/PrismCL.java | 52 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/prism/src/prism/PrismCL.java b/prism/src/prism/PrismCL.java index 1c8ff509..c15db4ed 100644 --- a/prism/src/prism/PrismCL.java +++ b/prism/src/prism/PrismCL.java @@ -73,9 +73,9 @@ public class PrismCL implements PrismModelListener private boolean exportdot = false; private boolean exporttransdot = false; private boolean exporttransdotstates = false; + private boolean exportsccs = false; private boolean exportbsccs = false; private boolean exportmecs = false; - private boolean exportsccs = false; private boolean exportresults = false; private boolean exportresultsmatrix = false; private boolean exportresultscsv = false; @@ -129,9 +129,9 @@ public class PrismCL implements PrismModelListener private String exportDotFilename = null; private String exportTransDotFilename = null; private String exportTransDotStatesFilename = null; + private String exportSCCsFilename = null; private String exportBSCCsFilename = null; private String exportMECsFilename = null; - private String exportSCCsFilename = null; private String exportResultsFilename = null; private String exportSteadyStateFilename = null; private String exportTransientFilename = null; @@ -762,6 +762,20 @@ public class PrismCL implements PrismModelListener } } + // export SCCs to a file + if (exportsccs) { + try { + File f = (exportSCCsFilename.equals("stdout")) ? null : new File(exportSCCsFilename); + prism.exportSCCsToFile(exportType, f); + } + // in case of error, report it and proceed + catch (FileNotFoundException e) { + error("Couldn't open file \"" + exportSCCsFilename + "\" for output"); + } catch (PrismException e) { + error(e.getMessage()); + } + } + // export BSCCs to a file if (exportbsccs) { try { @@ -789,20 +803,6 @@ public class PrismCL implements PrismModelListener error(e.getMessage()); } } - - // export SCCs to a file - if (exportsccs) { - try { - File f = (exportSCCsFilename.equals("stdout")) ? null : new File(exportSCCsFilename); - prism.exportSCCsToFile(exportType, f); - } - // in case of error, report it and proceed - catch (FileNotFoundException e) { - error("Couldn't open file \"" + exportSCCsFilename + "\" for output"); - } catch (PrismException e) { - error(e.getMessage()); - } - } } /** @@ -1257,6 +1257,15 @@ public class PrismCL implements PrismModelListener errorAndExit("No file specified for -" + sw + " switch"); } } + // export sccs to file + else if (sw.equals("exportsccs")) { + if (i < args.length - 1) { + exportsccs = true; + exportSCCsFilename = args[++i]; + } else { + errorAndExit("No file specified for -" + sw + " switch"); + } + } // export bsccs to file else if (sw.equals("exportbsccs")) { if (i < args.length - 1) { @@ -1275,15 +1284,6 @@ public class PrismCL implements PrismModelListener errorAndExit("No file specified for -" + sw + " switch"); } } - // export sccs to file - else if (sw.equals("exportsccs")) { - if (i < args.length - 1) { - exportsccs = true; - exportSCCsFilename = args[++i]; - } else { - errorAndExit("No file specified for -" + sw + " switch"); - } - } // export steady-state probs (as opposed to displaying on screen) else if (sw.equals("exportsteadystate") || sw.equals("exportss")) { if (i < args.length - 1) { @@ -2120,7 +2120,9 @@ public class PrismCL implements PrismModelListener mainLog.println("-exporttransdot ......... Export the transition matrix graph to a dot file"); mainLog.println("-exporttransdotstates ... Export the transition matrix graph to a dot file, with state info"); mainLog.println("-exportdot .............. Export the transition matrix MTBDD to a dot file"); + mainLog.println("-exportsccs ............. Compute and export all SCCs of the model"); mainLog.println("-exportbsccs ............ Compute and export all BSCCs of the model"); + mainLog.println("-exportmecs ............. Compute and export all maximal end components (MDPs only)"); mainLog.println("-exportsteadystate ...... Export steady-state probabilities to a file"); mainLog.println("-exporttransient ........ Export transient probabilities to a file"); mainLog.println("-exportprism ............ Export final PRISM model to a file");