From ac06210cdc9e4c9aa5010cbcf2d1ec4c95cfdb91 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Tue, 9 Jul 2013 15:57:28 +0000 Subject: [PATCH] Code tidy. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@7004 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/explicit/STPGAbstrSimple.java | 6 ++++-- prism/src/strat/MDStrategy.java | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/prism/src/explicit/STPGAbstrSimple.java b/prism/src/explicit/STPGAbstrSimple.java index b8f4ad55..152cde5e 100644 --- a/prism/src/explicit/STPGAbstrSimple.java +++ b/prism/src/explicit/STPGAbstrSimple.java @@ -160,8 +160,10 @@ public class STPGAbstrSimple extends ModelExplicit implements STPG, NondetModelS // Parse first line to get num states s = in.readLine(); lineNum = 1; - if (s == null) + if (s == null) { + in.close(); throw new PrismException("Missing first line of .tra file"); + } ss = s.split(" "); n = Integer.parseInt(ss[0]); // Initialise @@ -1084,7 +1086,7 @@ public class STPGAbstrSimple extends ModelExplicit implements STPG, NondetModelS STPGAbstrSimple stpg; DistributionSet set; Distribution distr; - ModelCheckerResult res; + //ModelCheckerResult res; BitSet target; // Simple example: Create and solve the stochastic game from: diff --git a/prism/src/strat/MDStrategy.java b/prism/src/strat/MDStrategy.java index 51a21352..96c0ca76 100644 --- a/prism/src/strat/MDStrategy.java +++ b/prism/src/strat/MDStrategy.java @@ -38,24 +38,24 @@ public abstract class MDStrategy implements Strategy * Get the number of states of the model associated with this strategy. */ public abstract int getNumStates(); - + /** * Get the index of the choice taken in state s. * The index is defined with respect to a particular model, stored locally. */ public abstract int getChoice(int s); - + /** * Get the action taken in state s. */ public abstract Object getChoiceAction(int s); - + @Override public void exportActions(PrismLog out) { int n = getNumStates(); for (int s = 0; s < n; s++) { - out.println(s + ":" + getChoiceAction(s)); + out.println(s + ":" + getChoice(s) + "," + getChoiceAction(s)); } } }