Browse Source

automata.DA: allow incrementally adding states

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@12041 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 9 years ago
parent
commit
3e5a9e0afb
  1. 19
      prism/src/automata/DA.java

19
prism/src/automata/DA.java

@ -73,6 +73,14 @@ public class DA<Symbol, Acceptance extends AcceptanceOmega>
}
}
/**
* Construct a DRA with zero states, use addState to add states.
*/
public DA()
{
this(0);
}
/**
* Construct a DRA of fixed size (i.e. fixed number of states).
*/
@ -109,6 +117,17 @@ public class DA<Symbol, Acceptance extends AcceptanceOmega>
// Mutators
/**
* Add a state.
* @return index of the fresh state
*/
public int addState()
{
edges.add(new ArrayList<Edge>());
size++;
return size-1;
}
/**
* Set the start state (index)
*/

Loading…
Cancel
Save