Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ <h3 class="fw-semibold mb-1">Constraint Summary</h3>
Add Constraint
</button>
</div>

@if (isCompanyGreedyMode) {
<div class="greedy-strategy-note">
<div class="fw-semibold mb-1">Greedy Matching Strategy</div>
<div class="mb-0">
The system builds matches step by step by selecting the best currently available option. Participants are
organized into priority tiers, and higher-priority candidates are matched first. This makes the process fast
and efficient for larger datasets, but because each decision is made locally, the final allocation may not
always be the globally optimal solution.
</div>
</div>
}

@if (constraintWrappers.length) {
<div class="border border-1 rounded-3 table-container overflow-y-scroll">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ th {
}
}
}

.greedy-strategy-note {
padding: 0.875rem 1rem;
border: 1px solid $border-color;
border-radius: 0.5rem;
background: $accent-color-light;
color: $text-color;
line-height: 1.5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import { ToastsService } from 'src/app/shared/services/toasts.service';
import { StudentSortService } from 'src/app/shared/services/student-sort.service';
import { ConstraintBuilderNationalityComponent } from '../constraint-builder-nationality/constraint-builder-nationality.component';
import { Subscription } from 'rxjs';
import { MatchingRouterService } from 'src/app/shared/matching/matching-router.service';
import { CourseIterationsService } from 'src/app/shared/data/course-iteration.service';
import { MatchingMode, MatchingRouterService } from 'src/app/shared/matching/matching-router.service';import { CourseIterationsService } from 'src/app/shared/data/course-iteration.service';

@Component({
selector: 'app-constraint-summary',
Expand All @@ -48,6 +47,7 @@ export class ConstraintSummaryComponent implements OverlayComponentData, OnInit,

constraintWrappers: ConstraintWrapper[] = [];
projects: Project[] = [];
matchingMode: MatchingMode;

private subscription: Subscription;

Expand All @@ -69,6 +69,13 @@ export class ConstraintSummaryComponent implements OverlayComponentData, OnInit,
this.constraintWrappers = constraintWrappers;
});
this.projects = this.projectsService.getProjects();
this.matchingMode = this.matchingRouterService.getMatchingMode({
students: this.studentsService.getStudents(),
projects: this.projects,
constraintWrappers: this.constraintWrappers,
locks: this.lockedStudentsService.getLocks(),
courseIteration: this.courseIterationsService.getCourseIteration(),
});
}

ngOnDestroy(): void {
Expand Down Expand Up @@ -120,4 +127,8 @@ export class ConstraintSummaryComponent implements OverlayComponentData, OnInit,
this.constraintsService.setActive(id, active);
this.constraintWrappers = this.constraintsService.getConstraints();
}

get isCompanyGreedyMode(): boolean {
return this.matchingMode === 'company-greedy';
}
}
Loading