Skip to content

Commit

Permalink
Merge pull request #145 from alpha-asp/fix_144
Browse files Browse the repository at this point in the history
Fix: Avoid duplicate work in ChoicePoint.recomputeActive
  • Loading branch information
AntoniusW authored Sep 2, 2018
2 parents b543685 + 8f94fdc commit 86121a2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/at/ac/tuwien/kr/alpha/solver/ChoiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,12 @@ void recomputeActive() {
LOGGER.trace("Recomputing activity of atom {}.", atom);
final boolean wasActive = isActive;
isActive = isNotChosen() && isActiveChoicePoint();
if (isActive) {
if (isActive && !wasActive) {
activeChoicePoints.add(this);
LOGGER.debug("Activating choice point for atom {}", this.atom);
} else {
if (wasActive) {
activeChoicePoints.remove(this);
LOGGER.debug("Deactivating choice point for atom {}", this.atom);
}
} else if (wasActive && !isActive) {
activeChoicePoints.remove(this);
LOGGER.debug("Deactivating choice point for atom {}", this.atom);
}
}

Expand Down

0 comments on commit 86121a2

Please sign in to comment.