Changeset 143


Ignore:
Timestamp:
05/24/17 11:45:20 (7 years ago)
Author:
sherbold
Message:

Added code for SmartSHARK data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPareConfigurationBuilder/src/de/ugoe/cs/crosspare/ConfigurationBuilder.java

    r133 r143  
    88public class ConfigurationBuilder { 
    99     
    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} 
    1111     
    1212    private static final String storageFolder = "config/"; 
     
    4848     
    4949    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");) { 
    5351            writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 
    5452            writer.flush(); 
    55             writer.close(); 
    5653        } 
    5754        catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 
     
    124121                configFile.append(" <loader name=\"ARFFFolderLoader\" datalocation=\"benchmark/data/AEEEM\" relative=\"false\"/>\n"); 
    125122                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; 
    126132            case RELINK: 
    127133                configFile.append(" <loader name=\"RelinkFolderLoader\" datalocation=\"benchmark/data/RELINK\" relative=\"false\"/>\n"); 
     
    132138            case SELECTEDJURECZKO: 
    133139                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"); 
    134157                break; 
    135158            default: 
     
    360383        { 
    361384            case AEEEM: 
     385            case AEEEM_LDHH: 
     386            case AEEEM_WCHU: 
     387            case AEEEM_LDHHWCHU: 
    362388                numNeighbors = 2; 
    363389                break; 
     
    380406                numNeighbors = 4; 
    381407                break; 
     408            case SMARTSHARK_ALL: 
     409            case SMARTSHARK_AST: 
     410            case SMARTSHARK_SM: 
     411                // TODO check num neighbors 
    382412            default: 
    383413                numNeighbors = 10; 
     
    404434        { 
    405435            case AEEEM: 
     436            case AEEEM_LDHH: 
     437            case AEEEM_LDHHWCHU: 
     438            case AEEEM_WCHU: 
    406439                numNeighbors = 1; 
    407440                break; 
     
    424457                numNeighbors = 4; 
    425458                break; 
     459            case SMARTSHARK_ALL: 
     460            case SMARTSHARK_AST: 
     461            case SMARTSHARK_SM: 
     462                // TODO check num neighbors 
    426463            default: 
    427464                numNeighbors = 10; 
Note: See TracChangeset for help on using the changeset viewer.