Revision: 1005
http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1005&view=rev
Author: JensLehmann
Date: 2008-07-10 02:41:14 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
- bug fix: number of descriptions returned was incorrect
Modified Paths:
--------------
trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java
Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java
===================================================================
--- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-07-07 08:50:10 UTC (rev 1004)
+++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-07-10 09:41:14 UTC (rev 1005)
@@ -107,16 +107,13 @@
public synchronized List<Description> getCurrentlyBestDescriptions(int nrOfDescriptions, boolean filterNonMinimalDescriptions) {
List<Description> currentlyBest = getCurrentlyBestDescriptions();
List<Description> returnList = new LinkedList<Description>();
- int count = 0;
for(Description ed : currentlyBest) {
- // return if we have sufficiently many descriptions
- if(count >= nrOfDescriptions)
+ if(returnList.size() >= nrOfDescriptions)
return returnList;
if(!filterNonMinimalDescriptions || ConceptTransformation.isDescriptionMinimal(ed))
returnList.add(ed);
- count++;
}
return returnList;
}
@@ -160,7 +157,6 @@
public synchronized List<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions) {
SortedSet<EvaluatedDescription> currentlyBest = getCurrentlyBestEvaluatedDescriptions();
List<EvaluatedDescription> returnList = new LinkedList<EvaluatedDescription>();
- int count = 0;
for(EvaluatedDescription ed : currentlyBest) {
// once we hit a description with a below threshold accuracy, we simply return
// because learning algorithms are advised to order descriptions by accuracy,
@@ -169,13 +165,12 @@
return returnList;
// return if we have sufficiently many descriptions
- if(count >= nrOfDescriptions)
+ if(returnList.size() >= nrOfDescriptions)
return returnList;
if(!filterNonMinimalDescriptions || ConceptTransformation.isDescriptionMinimal(ed.getDescription()))
returnList.add(ed);
- count++;
}
return returnList;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|