Skip to content

Commit

Permalink
fix previous comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Jan 6, 2025
1 parent 012a614 commit ea881ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,14 @@ public void run(Plan plan) {
for (int i = 0; i < mask.length; i++) {
if (mask[i])
option[i] = m;

options.add(option);
}

options.add(option);
}

List<PlanCandidate> singleModeCandidates = ctx.generator.generatePredefined(model, options);
singleModeCandidates.removeIf(p -> p.getUtility() == Double.NEGATIVE_INFINITY);

// if none of the single mode options are valid, no further search is needed
// this works in conjunction with subtour constraints, with other constraints it might be too strict
if (singleModeCandidates.size() <= 1) {
continue;
}

// Single modes are also added
Set<PlanCandidate> candidateSet = new LinkedHashSet<>(singleModeCandidates);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ public List<PlanCandidate> generatePredefined(PlanModel planModel, List<String[]
Set<String> consolidateModes = planModel.filterModes(ModeEstimate::isMin);
Set<String> usableModes = planModel.filterModes(ModeEstimate::isUsable);

ReferenceSet<String> usedModes = new ReferenceOpenHashSet<>();

// Same Logic as the top k estimator
for (String[] result : modes) {

Expand All @@ -330,6 +328,8 @@ public List<PlanCandidate> generatePredefined(PlanModel planModel, List<String[]

double estimate = 0;

ReferenceSet<String> usedModes = new ReferenceOpenHashSet<>();

// Collect estimates for all entries
for (int i = 0; i < result.length; i++) {

Expand Down

0 comments on commit ea881ab

Please sign in to comment.