@@ -849,7 +849,7 @@ private void doExports() throws PrismException
849849 try {
850850 File dotFile = File .createTempFile ("prism-dot-" , ".dot" , null );
851851 File dotPdfFile = File .createTempFile ("prism-dot-" , ".dot.pdf" , null );
852- prism .exportBuiltModelTransitions (dotFile , new ModelExportOptions ().setFormat (ModelExportFormat .DOT ).setShowStates (true ));
852+ prism .exportBuiltModelTransitions (dotFile , new ModelExportOptions ().setFormat (ModelExportFormat .DOT ).setShowStates (true ). setShowObservations ( true ) );
853853 (new ProcessBuilder (new String []{ "dot" , "-Tpdf" , "-o" , dotPdfFile .getPath (), dotFile .getPath ()})).start ().waitFor ();
854854 (new ProcessBuilder (new String []{ "open" ,dotPdfFile .getPath ()})).start ();
855855 }
@@ -1515,7 +1515,7 @@ else if (sw.equals("exportunordered") || sw.equals("unordered")) {
15151515 // export transition matrix graph to dot file
15161516 else if (sw .equals ("exporttransdot" )) {
15171517 if (i < args .length - 1 ) {
1518- ModelExportOptions exportOptions = new ModelExportOptions ().setFormat (ModelExportFormat .DOT ).setShowStates (false );
1518+ ModelExportOptions exportOptions = new ModelExportOptions ().setFormat (ModelExportFormat .DOT ).setShowStates (false ). setShowObservations ( false ) ;
15191519 modelExportTasks .add (new ModelExportTask (ModelExportTask .ModelExportEntity .MODEL , args [++i ], exportOptions ));
15201520 } else {
15211521 errorAndExit ("No file specified for -" + sw + " switch" );
@@ -1524,7 +1524,7 @@ else if (sw.equals("exporttransdot")) {
15241524 // export transition matrix graph to dot file (with states)
15251525 else if (sw .equals ("exporttransdotstates" )) {
15261526 if (i < args .length - 1 ) {
1527- ModelExportOptions exportOptions = new ModelExportOptions ().setFormat (ModelExportFormat .DOT ).setShowStates (true );
1527+ ModelExportOptions exportOptions = new ModelExportOptions ().setFormat (ModelExportFormat .DOT ).setShowStates (true ). setShowObservations ( true ) ;
15281528 modelExportTasks .add (new ModelExportTask (ModelExportTask .ModelExportEntity .MODEL , args [++i ], exportOptions ));
15291529 } else {
15301530 errorAndExit ("No file specified for -" + sw + " switch" );
@@ -2163,6 +2163,28 @@ else if (opt.equals("proplabels")) {
21632163 }
21642164 }
21652165 }
2166+ else if (opt .startsWith (sOpt = "states" )) {
2167+ if (!opt .startsWith (sOpt + "=" ))
2168+ throw new PrismException ("No value provided for \" " + sOpt + "\" option of -exportmodel" );
2169+ String optVal = opt .substring (sOpt .length () + 1 );
2170+ if (optVal .equals ("true" ))
2171+ exportOptions .setShowStates (true );
2172+ else if (optVal .equals ("false" ))
2173+ exportOptions .setShowStates (false );
2174+ else
2175+ throw new PrismException ("Unknown value \" " + optVal + "\" provided for \" reach\" option of -exportstrat" );
2176+ }
2177+ else if (opt .startsWith (sOpt = "obs" )) {
2178+ if (!opt .startsWith (sOpt + "=" ))
2179+ throw new PrismException ("No value provided for \" " + sOpt + "\" option of -exportmodel" );
2180+ String optVal = opt .substring (sOpt .length () + 1 );
2181+ if (optVal .equals ("true" ))
2182+ exportOptions .setShowObservations (true );
2183+ else if (optVal .equals ("false" ))
2184+ exportOptions .setShowObservations (false );
2185+ else
2186+ throw new PrismException ("Unknown value \" " + optVal + "\" provided for \" reach\" option of -exportstrat" );
2187+ }
21662188 else if (opt .startsWith (sOpt = "actions" )) {
21672189 if (!opt .startsWith (sOpt + "=" ))
21682190 throw new PrismException ("No value provided for \" " + sOpt + "\" option of -exportmodel" );
@@ -2762,6 +2784,8 @@ else if (sw.equals("exportmodel")) {
27622784 mainLog .println (" * matlab - same as format=matlab" );
27632785 mainLog .println (" * rows - export matrices with one row/distribution on each line" );
27642786 mainLog .println (" * proplabels - export labels from a properties file into the same file, too" );
2787+ mainLog .println (" * states (=true/false) - include state definitions" );
2788+ mainLog .println (" * obs (=true/false) - include observation definitions" );
27652789 mainLog .println (" * actions (=true/false) - show actions on choices/transitions" );
27662790 mainLog .println (" * headers (=true/false) - include headers when exporting rewards" );
27672791 mainLog .println (" * precision (=n) - export probabilities/rewards with n significant decimal places" );
0 commit comments