public PDMStateSpace calculateSimpleStateSpace( boolean root, boolean failure, boolean input, boolean colored, int numStates, int breadth) { PDMStateSpace result = new PDMStateSpace(this, colored); HashSet states = new HashSet(); int j = (operations.size() + 1); if (!input) { HashSet empty = new HashSet(); PDMState st = new PDMState(result, "state" + i, empty, empty, empty); result.addState(st); states.add(st); i++; } else { // Start with the complete set of input data elements available HashSet empty = new HashSet(); String name = new String("state" + i); HashSet ins = new HashSet(); // this hashSet contains the input // elements to the process (input // elements of PDM) HashSet execOps = new HashSet(); // Fill the hashSet with the leaf elements HashMap leafs = getLeafElements(); Object[] leafElts = leafs.values().toArray(); for (int i = 0; i < leafElts.length; i++) { PDMDataElement d = (PDMDataElement) leafElts[i]; ins.add(d); } HashSet leafOps = getLeafOperations(); Iterator it = leafOps.iterator(); while (it.hasNext()) { PDMOperation op = (PDMOperation) it.next(); execOps.add(op); } PDMState start = new PDMState(result, name, ins, execOps, empty); // start // state // of // the // statespace result.addState(start); i++; states.add(start); } while (!states.isEmpty()) { HashSet states2 = (HashSet) states.clone(); Iterator it = states2.iterator(); while (it.hasNext()) { PDMState state = (PDMState) it.next(); HashSet nextStates = calculateNextStates(state, result, root, failure, numStates, breadth); Iterator it2 = nextStates.iterator(); // Add the new states to iterator while (it2.hasNext()) { PDMState st = (PDMState) it2.next(); states.add(st); } states.remove(state); } } i = 0; j = 0; Message.add("<PDMMDPStateSpace>", Message.TEST); Message.add("<NumberOfStates = " + result.getNumberOfStates() + " >", Message.TEST); Message.add("</PDMMDPStateSpace>", Message.TEST); return result; }