- Timestamp:
- 05/05/15 16:29:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/ExperimentConfiguration.java
r2 r32 119 119 */ 120 120 private List<IEvaluationStrategy> evaluators; 121 122 /** 123 * indicates, if the classifier should be saved 124 */ 125 private Boolean saveClassifier = null; 126 127 /** 128 * indicates, which execution strategy to choose 129 * (e.g. CrossProjectExperiment, ClassifierCreationExecution). 130 * Default is CrossProjectExperiment. 131 */ 132 private String executionStrategy = "CrossProjectExperiment"; 121 133 122 134 /** … … 315 327 } 316 328 329 /** 330 * returns boolean, if classifier should be saved 331 * @return boolean 332 */ 333 public boolean getSaveClassifier() { 334 return saveClassifier; 335 } 336 337 /** 338 * returns the execution strategy 339 * @return String execution strategy 340 */ 341 public String getExecutionStrategy() { 342 return executionStrategy; 343 } 344 317 345 /* (non-Javadoc) 318 346 * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) … … 393 421 final IEvaluationStrategy evaluator = (IEvaluationStrategy) Class.forName("de.ugoe.cs.cpdp.eval." + attributes.getValue("name")).newInstance(); 394 422 evaluators.add(evaluator); 423 } 424 else if( qName.equals("saveClassifier")) { 425 saveClassifier = true; 426 } 427 else if( qName.equals("executionStrategy")) { 428 executionStrategy = attributes.getValue("name"); 395 429 } 396 430 else if( qName.equals("partialconfig") ) { … … 423 457 * If the current data path is the empty string (""), it is override by the datapath of the other configuration. Otherwise, the current data path is kept. 424 458 * @param other experiment whose information is added 425 */ 426 private void addConfigurations(ExperimentConfiguration other) { 459 * @throws ExperimentConfigurationException 460 */ 461 private void addConfigurations(ExperimentConfiguration other) throws ExperimentConfigurationException { 427 462 if( "results".equals(resultsPath) ) { 428 463 resultsPath = other.resultsPath; … … 441 476 trainers.addAll(other.trainers); 442 477 evaluators.addAll(other.evaluators); 478 479 if(!executionStrategy.equals(other.executionStrategy)) { 480 throw new ExperimentConfigurationException("Executionstrategies must be the same, if config files should be added."); 481 } 482 483 /* Only if saveClassifier is not set in the main config and 484 * the other configs saveClassifier is true, it must be set. 485 */ 486 if(saveClassifier == null && other.saveClassifier == true) { 487 saveClassifier = other.saveClassifier; 488 } 489 443 490 } 444 491 … … 464 511 builder.append("Pointwise trainers: " + trainers.toString() + StringTools.ENDLINE); 465 512 builder.append("Evaluators: " + evaluators.toString() + StringTools.ENDLINE); 466 513 builder.append("Save Classifier?: " + saveClassifier + StringTools.ENDLINE); 514 builder.append("Execution Strategy: " + executionStrategy + StringTools.ENDLINE); 515 467 516 return builder.toString(); 468 517 }
Note: See TracChangeset
for help on using the changeset viewer.