Skip to content

Commit

Permalink
[PEx] Minor: correct an assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-goel committed May 8, 2024
1 parent d739b61 commit c438e7f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ public static void logEndTask(SearchTask task, int numSchedules) {
}
}

/**
* Log when the next task is selected
*
* @param task Next search task
*/
public static void logNextTask(SearchTask task) {
if (verbosity > 1) {
log.info(String.format(" Next task: %s", task.toStringDetailed()));
}
}

public static void logNewTasks(List<SearchTask> tasks) {
if (verbosity > 0) {
log.info(String.format(" Added %d new tasks", tasks.size()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ private void setChildTask(Choice choice, int choiceNum, SearchTask parentTask, b
public SearchTask setNextTask() {
SearchTask nextTask = searchStrategy.setNextTask();
if (nextTask != null) {
PExplicitLogger.logNextTask(nextTask);
schedule.setChoices(nextTask.getAllChoices());
postIterationCleanup();
}
Expand Down Expand Up @@ -504,7 +505,9 @@ private void postIterationCleanup() {
if (PExplicitGlobal.getConfig().isStatefulBacktrackEnabled()) {
scheduleChoice = schedule.getScheduleChoiceAt(choice);
if (scheduleChoice != null && scheduleChoice.getChoiceState() != null) {
assert ((scheduleChoice == choice) || (scheduleChoice.getStepNumber() == (choice.getStepNumber() - 1)));
assert ((scheduleChoice == choice) ||
(scheduleChoice.getStepNumber() == (choice.getStepNumber() - 1)) ||
(scheduleChoice.getStepNumber() == choice.getStepNumber()));
newStepNumber = scheduleChoice.getStepNumber();
} else {
assert (choice.getStepNumber() <= 1);
Expand Down

0 comments on commit c438e7f

Please sign in to comment.