Changeset 121
- Timestamp:
- 07/13/11 11:33:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDgenerateRandomSequences.java
r119 r121 3 3 import java.security.InvalidParameterException; 4 4 import java.util.HashSet; 5 import java.util.LinkedList;6 5 import java.util.List; 7 6 import java.util.Set; … … 21 20 int numSessions; 22 21 long maxIter; 22 int minLength = 0; 23 int maxLength = Integer.MAX_VALUE; 23 24 try { 24 25 modelname = (String) parameters.get(0); … … 26 27 numSessions = Integer.parseInt((String) parameters.get(2)); 27 28 maxIter = numSessions*10; 28 if( parameters.size() ==4 ) {29 if( parameters.size()>=4 ) { 29 30 maxIter = Long.parseLong((String) parameters.get(3)); 31 } 32 if( parameters.size()>=5 ) { 33 minLength = Integer.parseInt((String) parameters.get(4)); 34 } 35 if( parameters.size()>=6 ) { 36 maxLength = Integer.parseInt((String) parameters.get(5)); 30 37 } 31 38 } … … 46 53 long numIterations = 0; 47 54 while( sequences.size()<numSessions && numIterations<maxIter ) { 48 sequences.add(model.randomSequence()); 55 List<? extends Event<?>> generatedSequence = model.randomSequence(); 56 if( generatedSequence.size()>=minLength && generatedSequence.size()<=maxLength ) { 57 sequences.add(generatedSequence); 58 } 49 59 numIterations++; 50 60 } … … 60 70 @Override 61 71 public void help() { 62 Console.println("Usage: generateRandomSequenecs <modelName> <sequencesName> <numSessions> {<maxIter> }");72 Console.println("Usage: generateRandomSequenecs <modelName> <sequencesName> <numSessions> {<maxIter> <minLength> <maxLength>}"); 63 73 } 64 74
Note: See TracChangeset
for help on using the changeset viewer.