- Timestamp:
- 06/28/16 12:01:39 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/AbstractFolderLoader.java
r86 r132 16 16 17 17 import java.io.File; 18 import java.util.ArrayList; 18 19 import java.util.LinkedList; 19 20 import java.util.List; 20 21 22 import weka.core.Attribute; 21 23 import weka.core.Instances; 22 24 … … 66 68 Instances data = instancesLoader.load(versionFile); 67 69 String versionName = data.relationName(); 68 versions.add(new SoftwareVersion(projectName, versionName, data)); 70 List<Double> efforts = getEfforts(data); 71 versions.add(new SoftwareVersion(projectName, versionName, data, efforts)); 69 72 } 70 73 } … … 73 76 } 74 77 return versions; 78 } 79 80 private List<Double> getEfforts(Instances data) { 81 // attribute in the JURECZKO data and default 82 Attribute effortAtt = data.attribute("loc"); 83 if (effortAtt == null) { 84 // attribute in the NASA/SOFTMINE/MDP data 85 effortAtt = data.attribute("LOC_EXECUTABLE"); 86 } 87 if (effortAtt == null) { 88 // attribute in the AEEEM data 89 effortAtt = data.attribute("numberOfLinesOfCode"); 90 } 91 if (effortAtt == null) { 92 // attribute in the RELINK data 93 effortAtt = data.attribute("CountLineCodeExe"); 94 } 95 if( effortAtt == null ) { 96 return null; 97 } 98 List<Double> efforts = new ArrayList<>(data.size()); 99 for( int i=0; i<data.size(); i++ ) { 100 efforts.add(data.get(i).value(effortAtt)); 101 } 102 return efforts; 75 103 } 76 104
Note: See TracChangeset
for help on using the changeset viewer.