|
|
@ -26,9 +26,11 @@ |
|
|
|
|
|
|
|
|
package explicit; |
|
|
package explicit; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.BitSet; |
|
|
import java.util.BitSet; |
|
|
import java.util.HashSet; |
|
|
import java.util.HashSet; |
|
|
import java.util.Iterator; |
|
|
import java.util.Iterator; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.function.IntPredicate; |
|
|
import java.util.function.IntPredicate; |
|
|
|
|
|
|
|
|
import prism.PrismLog; |
|
|
import prism.PrismLog; |
|
|
@ -75,6 +77,19 @@ public interface NondetModel extends Model |
|
|
*/ |
|
|
*/ |
|
|
public Object getAction(int s, int i); |
|
|
public Object getAction(int s, int i); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get a list of the actions labelling the choices of state {@code s}. |
|
|
|
|
|
*/ |
|
|
|
|
|
public default List<Object> getAvailableActions(int s) |
|
|
|
|
|
{ |
|
|
|
|
|
List<Object> actions = new ArrayList<>(); |
|
|
|
|
|
int numChoices = getNumChoices(s); |
|
|
|
|
|
for (int i = 0; i < numChoices; i++) { |
|
|
|
|
|
actions.add(getAction(s, i)); |
|
|
|
|
|
} |
|
|
|
|
|
return actions; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Get the index of the (first) choice in state {@code s} with action label {@code action}. |
|
|
* Get the index of the (first) choice in state {@code s} with action label {@code action}. |
|
|
* Action labels (which are {@link Object}s) are tested for equality using {@link Object#equals()}. |
|
|
* Action labels (which are {@link Object}s) are tested for equality using {@link Object#equals()}. |
|
|
|