Changeset 171 for trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDprintRandomSession.java
- Timestamp:
- 09/09/11 06:23:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDprintRandomSession.java
r18 r171 10 10 import de.ugoe.cs.util.console.Console; 11 11 12 /** 13 * <p> 14 * Command that prints a randomly generated sessions of events to the console. 15 * </p> 16 * 17 * @author Steffen Herbold 18 * @version 1.0 19 */ 12 20 public class CMDprintRandomSession implements Command { 13 21 22 /* 23 * (non-Javadoc) 24 * 25 * @see de.ugoe.cs.util.console.Command#help() 26 */ 14 27 @Override 15 28 public void help() { … … 17 30 } 18 31 32 /* 33 * (non-Javadoc) 34 * 35 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 36 */ 19 37 @Override 20 38 public void run(List<Object> parameters) { … … 22 40 try { 23 41 modelname = (String) parameters.get(0); 24 } 25 catch (Exception e) { 42 } catch (Exception e) { 26 43 throw new InvalidParameterException(); 27 44 } 28 29 IStochasticProcess model = null; 30 Object dataObject = GlobalDataContainer.getInstance().getData(modelname); 31 if( dataObject==null ) { 45 46 IStochasticProcess model = null; 47 Object dataObject = GlobalDataContainer.getInstance() 48 .getData(modelname); 49 if (dataObject == null) { 32 50 Console.println("Model " + modelname + " not found in storage."); 33 } 34 else if( !(dataObject instanceof IStochasticProcess) ) { 51 } else if (!(dataObject instanceof IStochasticProcess)) { 35 52 Console.println("Object " + modelname + " not of type MarkovModel!"); 36 53 } else { 37 54 model = (IStochasticProcess) dataObject; 38 for ( Event<?> event : model.randomSequence()) {55 for (Event<?> event : model.randomSequence()) { 39 56 Console.println(event.toString()); 40 57 }
Note: See TracChangeset
for help on using the changeset viewer.