- Timestamp:
- 03/08/12 09:24:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDgenerateFixedLengthSequences.java
r240 r393 41 41 boolean all = true; 42 42 int numSequences = -1; 43 boolean validEnd = true; 43 44 try { 44 45 modelname = (String) parameters.get(0); … … 49 50 all = Boolean.parseBoolean((String) parameters.get(4)); 50 51 } 51 if (parameters.size() == 6) {52 if (parameters.size() >= 6) { 52 53 numSequences = Integer.parseInt((String) parameters.get(5)); 54 } 55 if (parameters.size() >= 7) { 56 validEnd = Boolean.parseBoolean((String) parameters.get(6)); 53 57 } 54 58 } catch (Exception e) { … … 69 73 Collection<List<? extends Event<?>>> sequences = new LinkedHashSet<List<? extends Event<?>>>(); 70 74 for (int length = minLength; length <= maxLength; length++) { 71 sequences.addAll(model.generateValidSequences(length + 2)); 75 if( validEnd ) { 76 sequences.addAll(model.generateValidSequences(length + 2)); 77 } else { 78 sequences.addAll(model.generateSequences(length + 1, true)); 79 } 72 80 } 73 81 Console.traceln("" + sequences.size() + " possible"); … … 120 128 @Override 121 129 public void help() { 122 Console.println("Usage: generateFixedLengthSequences <modelname> <sequencesName> <minlenght> <maxlength> {<all>} {<numSequences>} ");130 Console.println("Usage: generateFixedLengthSequences <modelname> <sequencesName> <minlenght> <maxlength> {<all>} {<numSequences>} {<validEnd>}"); 123 131 } 124 132
Note: See TracChangeset
for help on using the changeset viewer.