Changeset 98 for trunk/CrossPare/src/de/ugoe/cs/cpdp
- Timestamp:
- 05/13/16 09:18:15 (9 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/ExperimentConfiguration.java
r86 r98 161 161 */ 162 162 private Boolean saveClassifier = null; 163 164 /** 165 * number of repetitions of an experiment (to account for randomness) 166 */ 167 private int repetitions = 1; 163 168 164 169 /** … … 421 426 return saveClassifier; 422 427 } 428 429 /** 430 * number of repetitions of an experiment 431 * 432 * @return number of repetitions 433 */ 434 public int getRepetitions() { 435 return repetitions; 436 } 423 437 424 438 /** … … 564 578 else if (qName.equals("saveClassifier")) { 565 579 saveClassifier = true; 580 } 581 else if( qName.equals("repetitions")) { 582 repetitions = Integer.parseInt(attributes.getValue("number")); 566 583 } 567 584 else if (qName.equals("executionStrategy")) { -
trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/IResultStorage.java
r86 r98 43 43 * @param productName 44 44 * name of the product 45 * @return true of the results ofr the given product and experiment are contained in the result 46 * storage 45 * @return number of contained resultsfor the given product and experiment 47 46 */ 48 public booleancontainsResult(String experimentName, String productName);47 public int containsResult(String experimentName, String productName); 49 48 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/MySQLResultStorage.java
r97 r98 162 162 */ 163 163 @Override 164 public booleancontainsResult(String experimentName, String productName) {164 public int containsResult(String experimentName, String productName) { 165 165 String sql = "SELECT COUNT(*) as cnt FROM crosspare.results WHERE configurationName=\'" + 166 166 experimentName + "\' AND productName=\'" + productName + "\';"; 167 167 Statement stmt; 168 boolean contained = false;169 168 try { 170 169 stmt = connectionPool.getConnection().createStatement(); 171 170 ResultSet results = stmt.executeQuery(sql); 172 171 results.next(); 173 int count = results.getInt("cnt"); 174 contained = count > 0; 172 return results.getInt("cnt"); 175 173 } 176 174 catch (SQLException e) { … … 179 177 Console.printerr("SQLState: " + e.getSQLState() + "\n"); 180 178 Console.printerr("VendorError: " + e.getErrorCode() + "\n"); 181 Console.printerr("\nskipping product since we could not check if the results is available"); 182 contained = true; 179 return 0; 183 180 } 184 return contained;185 181 } 186 182 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/execution/AbstractCrossProjectExperiment.java
r86 r98 148 148 int versionCount = 1; 149 149 int testVersionCount = 0; 150 int numTrainers = 0; 150 151 151 152 for (SoftwareVersion testVersion : versions) { … … 154 155 } 155 156 } 157 158 numTrainers += config.getSetWiseTrainers().size(); 159 numTrainers += config.getSetWiseTestdataAwareTrainers().size(); 160 numTrainers += config.getTrainers().size(); 161 numTrainers += config.getTestAwareTrainers().size(); 156 162 157 163 // sort versions … … 164 170 config.getExperimentName(), versionCount, 165 171 testVersionCount, testVersion.getVersion())); 166 if (resultsAvailable(testVersion)) { 172 int numResultsAvailable = resultsAvailable(testVersion); 173 if (numResultsAvailable >= numTrainers*config.getRepetitions()) { 167 174 Console.traceln(Level.INFO, 168 175 String.format( … … 339 346 } 340 347 341 private booleanresultsAvailable(SoftwareVersion version) {348 private int resultsAvailable(SoftwareVersion version) { 342 349 if (config.getResultStorages().isEmpty()) { 343 return false;344 } 345 boolean available = true;350 return 0; 351 } 352 int available = Integer.MAX_VALUE; 346 353 for (IResultStorage storage : config.getResultStorages()) { 347 available &= storage.containsResult(config.getExperimentName(), version.getVersion()); 354 int curAvailable = storage.containsResult(config.getExperimentName(), version.getVersion()); 355 if( curAvailable<available ) { 356 available = curAvailable; 357 } 348 358 } 349 359 return available;
Note: See TracChangeset
for help on using the changeset viewer.