Implement EMBA Specialization Solver web app
Full React+TypeScript app with LP-based optimization engine, drag-and-drop specialization ranking (with touch/arrow support), course selection UI, results dashboard with decision tree, and two optimization modes (maximize-count, priority-order).
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { COURSES } from './courses';
|
||||
import { ELECTIVE_SETS } from './electiveSets';
|
||||
import type { Course, Qualification } from './types';
|
||||
|
||||
// Courses indexed by set ID
|
||||
export const coursesBySet: Record<string, Course[]> = {};
|
||||
for (const set of ELECTIVE_SETS) {
|
||||
coursesBySet[set.id] = set.courseIds.map(
|
||||
(cid) => COURSES.find((c) => c.id === cid)!
|
||||
);
|
||||
}
|
||||
|
||||
// Qualifications indexed by course ID
|
||||
export const qualificationsByCourse: Record<string, Qualification[]> = {};
|
||||
for (const course of COURSES) {
|
||||
qualificationsByCourse[course.id] = course.qualifications;
|
||||
}
|
||||
|
||||
// Course IDs indexed by specialization ID (with marker info)
|
||||
export const coursesBySpec: Record<string, { courseId: string; marker: Qualification['marker'] }[]> = {};
|
||||
for (const course of COURSES) {
|
||||
for (const q of course.qualifications) {
|
||||
if (!coursesBySpec[q.specId]) {
|
||||
coursesBySpec[q.specId] = [];
|
||||
}
|
||||
coursesBySpec[q.specId].push({ courseId: course.id, marker: q.marker });
|
||||
}
|
||||
}
|
||||
|
||||
// Course lookup by ID
|
||||
export const courseById: Record<string, Course> = {};
|
||||
for (const course of COURSES) {
|
||||
courseById[course.id] = course;
|
||||
}
|
||||
|
||||
// Set ID lookup by course ID
|
||||
export const setIdByCourse: Record<string, string> = {};
|
||||
for (const course of COURSES) {
|
||||
setIdByCourse[course.id] = course.setId;
|
||||
}
|
||||
Reference in New Issue
Block a user