+ if (args.length != 3) {
+ System.out.println("error: missing commandline arguments!");
+ return;
+ }
+
+ /* this option reduces the number of inputs used by the learning
+ *
+ * this should result in a smaller model because these inputs
+ * are only valid in certain states.
+ */
+ stateCountStr = args[0];
+ int stateCount = 0;
+ if (args[0].equals("partial")) {
+ stateCount = 1;
+ } else if (args[0].equals("full")) {
+ stateCount = 2;
+ }
+
+ /* learning method
+ *
+ * can be LStar, TTT, RS or KV
+ */
+ methodStr = args[1];
+ if (methodStr.equals("LStar")) {
+ learningAlgorithm = LearningMethod.LStar;
+ } else if (methodStr.equals("TTT")) {
+ learningAlgorithm = LearningMethod.TTT;
+ } else if (methodStr.equals("RS")) {
+ learningAlgorithm = LearningMethod.RivestSchapire;
+ } else if (methodStr.equals("KV")) {
+ learningAlgorithm = LearningMethod.KearnsVazirani;
+ }
+
+ /* testing method
+ *
+ * can be: rand, wm, wpm
+ */
+ testStr = args[2];
+ if (testStr.equals("rand")) {
+ testMethod = TestingMethod.RandomWalk;
+ } else if (testStr.equals("wm")) {
+ testMethod = TestingMethod.WMethod;
+ } else if (testStr.equals("wpm")) {
+ testMethod = TestingMethod.WpMethod;
+ }
+
+ System.out.println("settings:");
+ System.out.println("stateCount = "+stateCount);
+ System.out.println("learningMethod = "+methodStr);
+ System.out.println("testMethod = "+testStr);
+
+ switch (stateCount) {
+ case 2:
+ inputAlphabet = new SimpleAlphabet<String>(ImmutableSet.of(
+ "SYN", "ACK",
+ "DAT", "RST", "FIN"));
+ break;
+ case 1:
+ inputAlphabet = new SimpleAlphabet<String>(ImmutableSet.of(
+ "SYN", "ACK",
+ "RST"));
+ break;
+ default:
+ inputAlphabet = new SimpleAlphabet<String>(ImmutableSet.of(
+ "SYN", "ACK"));
+ }
+