Browse Source

Add new getChoiceAction method to ModelGenerator interface, which is basically an alias for getTransitionAction(i, 0).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11506 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 10 years ago
parent
commit
50e13bca29
  1. 6
      prism/src/prism/DefaultModelGenerator.java
  2. 10
      prism/src/prism/ModelGenerator.java

6
prism/src/prism/DefaultModelGenerator.java

@ -171,6 +171,12 @@ public abstract class DefaultModelGenerator implements ModelGenerator
@Override
public abstract Object getTransitionAction(int i, int offset) throws PrismException;
@Override
public Object getChoiceAction(int i) throws PrismException
{
return getTransitionAction(i, 0);
}
@Override
public abstract double getTransitionProbability(int i, int offset) throws PrismException;

10
prism/src/prism/ModelGenerator.java

@ -106,6 +106,16 @@ public interface ModelGenerator extends ModelInfo
*/
public Object getTransitionAction(int i, int offset) throws PrismException;
/**
* Get the action label of a choice, specified by its index.
* The label can be any Object, but will often be treated as a string, so it should at least
* have a meaningful toString() method implemented. Absence of an action label is denoted by null.
* Note: If the model has different actions for different transitions within a choice
* (as can be the case for Markov chains), this method returns the action for the first transition.
* So, this method is essentially equivalent to {@code getTransitionAction(i, 0)}.
*/
public Object getChoiceAction(int i) throws PrismException;
/**
* Get the probability/rate of a transition within a choice, specified by its index/offset.
* @param i Index of the nondeterministic choice

Loading…
Cancel
Save