Changeset 143
- Timestamp:
- 05/24/17 11:45:20 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPareConfigurationBuilder/src/de/ugoe/cs/crosspare/ConfigurationBuilder.java
r133 r143 8 8 public class ConfigurationBuilder { 9 9 10 private static enum Dataset {MDP, JURECZKO, FILTERJURECZKO, AEEEM, RELINK, NETGENE, SELECTEDJURECZKO };10 private static enum Dataset {MDP, JURECZKO, FILTERJURECZKO, AEEEM, RELINK, NETGENE, SELECTEDJURECZKO, AEEEM_LDHH, AEEEM_WCHU, AEEEM_LDHHWCHU, SMARTSHARK_ALL, SMARTSHARK_AST, SMARTSHARK_SM} 11 11 12 12 private static final String storageFolder = "config/"; … … 48 48 49 49 public static void writeFile(String approach, Dataset dataset) { 50 FileWriter writer; 51 try { 52 writer = new FileWriter(storageFolder + dataset.toString() + "-" + approach + ".xml"); 50 try(FileWriter writer = new FileWriter(storageFolder + dataset.toString() + "-" + approach + ".xml");) { 53 51 writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 54 52 writer.flush(); 55 writer.close();56 53 } 57 54 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { … … 124 121 configFile.append(" <loader name=\"ARFFFolderLoader\" datalocation=\"benchmark/data/AEEEM\" relative=\"false\"/>\n"); 125 122 break; 123 case AEEEM_LDHH: 124 configFile.append(" <loader name=\"ARFFFolderLoader\" datalocation=\"benchmark/data/AEEEM_LDHH\" relative=\"false\"/>\n"); 125 break; 126 case AEEEM_LDHHWCHU: 127 configFile.append(" <loader name=\"ARFFFolderLoader\" datalocation=\"benchmark/data/AEEEM_LDHHWCHU\" relative=\"false\"/>\n"); 128 break; 129 case AEEEM_WCHU: 130 configFile.append(" <loader name=\"ARFFFolderLoader\" datalocation=\"benchmark/data/AEEEM_WCHU\" relative=\"false\"/>\n"); 131 break; 126 132 case RELINK: 127 133 configFile.append(" <loader name=\"RelinkFolderLoader\" datalocation=\"benchmark/data/RELINK\" relative=\"false\"/>\n"); … … 132 138 case SELECTEDJURECZKO: 133 139 configFile.append(" <loader name=\"CSVFolderLoader\" datalocation=\"benchmark/data/SELECTEDJURECZKO\" relative=\"false\"/>\n"); 140 break; 141 case SMARTSHARK_ALL: 142 configFile.append(" <loader name=\"JsonFolderLoader\" datalocation=\"exp-smartshark/data\" relative=\"false\"/>\n"); 143 configFile.append(" <versionfilter name=\"MinInstanceNumberFilter\" param=\"100\" />\n"); 144 configFile.append(" <versionfilter name=\"UnbalancedFilter\" param=\"0.05\" />\n"); 145 break; 146 case SMARTSHARK_AST: 147 configFile.append(" <loader name=\"JsonFolderLoader\" datalocation=\"exp-smartshark/data\" relative=\"false\"/>\n"); 148 configFile.append(" <versionfilter name=\"MinInstanceNumberFilter\" param=\"100\" />\n"); 149 configFile.append(" <versionfilter name=\"UnbalancedFilter\" param=\"0.05\" />\n"); 150 configFile.append(" <setwisepreprocessor name=\"AttributeRemoval\" param=\"PDA LLOC PUA LOC McCC CLOC TNLM CLLC CCO TNPA NA AD NLPA NLS LDC NM TNPM LCOM5 WMC NOD RFC TNM NL NS NPA NOC CBO TNC TLLOC CI TNLG NLM NLG TNA DIT TCD TNLA NLE NG NLA TNLPA NOS CBOI NLPM LLDC CD TNG NPM CCL NOI NOP TLOC CLC CC DLOC NII TCLOC TNLS NOA TNLPM\"/>\n"); 151 break; 152 case SMARTSHARK_SM: 153 configFile.append(" <loader name=\"JsonFolderLoader\" datalocation=\"exp-smartshark/data\" relative=\"false\"/>\n"); 154 configFile.append(" <versionfilter name=\"MinInstanceNumberFilter\" param=\"100\" />\n"); 155 configFile.append(" <versionfilter name=\"UnbalancedFilter\" param=\"0.05\" />\n"); 156 configFile.append(" <setwisepreprocessor name=\"AttributeRemoval\" param=\"ReferenceType LambdaExpression Member TypeArgument ThrowStatement ArraySelector Declaration ClassCreator ForStatement SwitchStatement InnerClassCreator Literal TypeParameter VoidClassReference WhileStatement EnhancedForControl This Statement ForControl BinaryOperation MethodReference SuperMemberReference EnumBody FormalParameter EnumConstantDeclaration Expression PackageDeclaration VariableDeclarator AssertStatement Documented node_count DoStatement InterfaceDeclaration ReturnStatement Cast ExplicitConstructorInvocation EnumDeclaration SynchronizedStatement AnnotationMethod SwitchStatementCase MemberReference TypeDeclaration ArrayInitializer CatchClauseParameter CatchClause VariableDeclaration TryStatement Annotation TryResource MethodInvocation BasicType ElementArrayValue InferredFormalParameter IfStatement SuperConstructorInvocation BreakStatement AnnotationDeclaration FieldDeclaration Assignment ContinueStatement Import Primary BlockStatement ClassDeclaration TernaryExpression ClassReference CompilationUnit ConstantDeclaration LocalVariableDeclaration MethodDeclaration ConstructorDeclaration ElementValuePair ArrayCreator Invocation StatementExpression SuperMethodInvocation\"/>\n"); 134 157 break; 135 158 default: … … 360 383 { 361 384 case AEEEM: 385 case AEEEM_LDHH: 386 case AEEEM_WCHU: 387 case AEEEM_LDHHWCHU: 362 388 numNeighbors = 2; 363 389 break; … … 380 406 numNeighbors = 4; 381 407 break; 408 case SMARTSHARK_ALL: 409 case SMARTSHARK_AST: 410 case SMARTSHARK_SM: 411 // TODO check num neighbors 382 412 default: 383 413 numNeighbors = 10; … … 404 434 { 405 435 case AEEEM: 436 case AEEEM_LDHH: 437 case AEEEM_LDHHWCHU: 438 case AEEEM_WCHU: 406 439 numNeighbors = 1; 407 440 break; … … 424 457 numNeighbors = 4; 425 458 break; 459 case SMARTSHARK_ALL: 460 case SMARTSHARK_AST: 461 case SMARTSHARK_SM: 462 // TODO check num neighbors 426 463 default: 427 464 numNeighbors = 10;
Note: See TracChangeset
for help on using the changeset viewer.