Changeset 121 for trunk/CrossPare/src


Ignore:
Timestamp:
06/03/16 15:55:22 (8 years ago)
Author:
sherbold
Message:
  • result storage now considers first classifier in file when checking if a result is available
Location:
trunk/CrossPare/src/de/ugoe/cs/cpdp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/IResultStorage.java

    r98 r121  
    4343     * @param productName 
    4444     *            name of the product 
     45     * @param classifierName 
     46     *            name of the first classifier in the configuration 
    4547     * @return number of contained resultsfor the given product and experiment 
    4648     */ 
    47     public int containsResult(String experimentName, String productName); 
     49    public int containsResult(String experimentName, String productName, String classifierName); 
    4850} 
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/MySQLResultStorage.java

    r98 r121  
    162162     */ 
    163163    @Override 
    164     public int containsResult(String experimentName, String productName) { 
     164    public int containsResult(String experimentName, String productName, String classifierName) { 
    165165        String sql = "SELECT COUNT(*) as cnt FROM crosspare.results WHERE configurationName=\'" + 
    166             experimentName + "\' AND productName=\'" + productName + "\';"; 
     166            experimentName + "\' AND productName=\'" + productName + "\' AND classifier=\'" + classifierName + "\';"; 
    167167        Statement stmt; 
    168168        try { 
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/execution/AbstractCrossProjectExperiment.java

    r98 r121  
    3636import de.ugoe.cs.cpdp.training.ITrainer; 
    3737import de.ugoe.cs.cpdp.training.ITrainingStrategy; 
     38import de.ugoe.cs.cpdp.training.IWekaCompatibleTrainer; 
    3839import de.ugoe.cs.cpdp.versions.IVersionFilter; 
    3940import de.ugoe.cs.cpdp.versions.SoftwareVersion; 
     
    350351            return 0; 
    351352        } 
     353         
     354        List<ITrainer> allTrainers = new LinkedList<>(); 
     355        for (ISetWiseTrainingStrategy setwiseTrainer : config.getSetWiseTrainers()) { 
     356            allTrainers.add(setwiseTrainer); 
     357        } 
     358        for (ISetWiseTestdataAwareTrainingStrategy setwiseTestdataAwareTrainer : config 
     359            .getSetWiseTestdataAwareTrainers()) 
     360        { 
     361            allTrainers.add(setwiseTestdataAwareTrainer); 
     362        } 
     363        for (ITrainingStrategy trainer : config.getTrainers()) { 
     364            allTrainers.add(trainer); 
     365        } 
     366        for (ITestAwareTrainingStrategy trainer : config.getTestAwareTrainers()) { 
     367            allTrainers.add(trainer); 
     368        } 
     369         
    352370        int available = Integer.MAX_VALUE; 
    353371        for (IResultStorage storage : config.getResultStorages()) { 
    354             int curAvailable = storage.containsResult(config.getExperimentName(), version.getVersion()); 
     372            String classifierName = ((IWekaCompatibleTrainer) allTrainers.get(0)).getName(); 
     373            int curAvailable = storage.containsResult(config.getExperimentName(), version.getVersion(), classifierName); 
    355374            if( curAvailable<available ) { 
    356375                available = curAvailable; 
Note: See TracChangeset for help on using the changeset viewer.