Skip to content

Commit

Permalink
Fixed a small bug that occurred when no maximum runtime was set.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelRoeder committed Sep 27, 2024
1 parent 41f7a8f commit b2c7ceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/dice_research/cel/PruneCEL.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public List<ScoredClassExpression> findClassExpression(Collection<String> positi
if (iResultPrinter != null) {
iResultPrinter.setStartTime(startTime);
}
long timeToStop = startTime + maxTime;
long timeToStop = maxTime > 0 ? startTime + maxTime : 0;
return findClassExpression(positive, negative, logStream, iResultPrinter, startTime, timeToStop);
}

Expand Down Expand Up @@ -126,7 +126,7 @@ public List<ScoredClassExpression> findClassExpression(Collection<String> positi
LOGGER.info("Refining rScore={}, cScore={}, ce={}", nextBestExpression.getRefinementScore(),
nextBestExpression.getClassificationScore(), nextBestExpression.getClassExpression());
// Refine this expression
newExpressions = rho.refine(nextBestExpression.getClassExpression(), timeToStop);
newExpressions = rho.refine(nextBestExpression.getClassExpression(), maxTime > 0 ? timeToStop : 0);
// Check the expressions
for (ScoredClassExpression newExpression : newExpressions) {
// If 1) we haven't seen this before AND 2a) we are configured to not further
Expand Down

0 comments on commit b2c7ceb

Please sign in to comment.