diff --git a/prism/src/explicit/StateValues.java b/prism/src/explicit/StateValues.java index f936d72d..35adb44c 100644 --- a/prism/src/explicit/StateValues.java +++ b/prism/src/explicit/StateValues.java @@ -157,6 +157,21 @@ public class StateValues implements StateVector } } + /** + * Create a new (int-valued) state values vector from an existing array of ints. + * The array is stored directly, not copied. + * Also set associated model (whose state space size should match vector size). + */ + public static StateValues createFromIntegerArray(int[] array, Model model) + { + StateValues sv = new StateValues(); + sv.type = TypeInt.getInstance(); + sv.size = array.length; + sv.valuesI = array; + sv.statesList = model.getStatesList(); + return sv; + } + /** * Create a new (double-valued) state values vector from an existing array of doubles. * The array is stored directly, not copied.