Browse Source

Add (explicit engine) tra file export for LTSs.

accumulation-v4.7
Dave Parker 5 years ago
parent
commit
8f0769da66
  1. 12
      prism/src/explicit/LTS.java

12
prism/src/explicit/LTS.java

@ -49,7 +49,17 @@ public interface LTS extends NondetModel
@Override
default void exportToPrismExplicitTra(PrismLog out)
{
throw new UnsupportedOperationException();
// Output transitions to .tra file
int numStates = getNumStates();
out.print(numStates + " " + getNumChoices() + "\n");
for (int i = 0; i < numStates; i++) {
int numChoices = getNumChoices(i);
for (int j = 0; j < numChoices; j++) {
out.print(i + " " + j + " " + getSuccessor(i, j));
Object action = getAction(i, j);
out.print(action == null ? "\n" : (" " + action + "\n"));
}
}
}
@Override

Loading…
Cancel
Save