added help site describing the shift assigment algorithm

This commit is contained in:
2025-10-14 16:26:55 +02:00
parent a2aaa12c4c
commit 9885d962f1
4 changed files with 581 additions and 119 deletions

View File

@@ -1,7 +1,7 @@
// frontend/src/services/scheduling/repairFunctions.ts
import { SchedulingEmployee, SchedulingShift, Assignment, RepairContext } from './types';
import { canAssign, assignEmployee, unassignEmployee,
hasErfahrener, candidateScore,
candidateScore,
countExperiencedCanWorkAlone,
isManagerAlone, isManagerShiftWithOnlyNew,
onlyNeuAssigned, canRemove,
@@ -776,7 +776,7 @@ export function checkAllProblemsResolved(
}
if (violation.startsWith('ERROR:')) {
// ... bestehende ERROR-Logik ...
remaining.push(`❌ NICHT BEHOBEN: ${violation.replace('ERROR: ', '')}`);
} else if (violation.startsWith('WARNING:')) {
const warningText = violation.replace('WARNING: ', '');
const shiftIdMatch = warningText.match(/Schicht\s+([a-f0-9-]+)/);

View File

@@ -14,20 +14,15 @@ import {
assignEmployee,
hasErfahrener,
wouldBeAloneIfAdded,
findViolations,
isManagerShiftWithOnlyNew,
isManagerAlone,
hasExperiencedAloneNotAllowed
} from './utils';
import {
attemptMoveErfahrenerTo,
attemptSwapBringErfahrener,
attemptLocalFixNeuAlone,
attemptUnassignOrSwap,
attemptFillFromOverallocated,
attemptAddErfahrenerToShift,
attemptFillFromPool,
checkManagerShiftRules,
resolveTwoExperiencedInShift,
attemptMoveExperiencedToManagerShift,
attemptSwapForExperienced,
@@ -149,7 +144,7 @@ function phaseBInsertManager(
console.log(`🎯 Phase B: Processing ${managerShifts.length} manager shifts`);
for (const shiftId of managerShifts) {
const shift = nonManagerShifts.find(s => s.id === shiftId) || { id: shiftId, requiredEmployees: 2 };
//const shift = nonManagerShifts.find(s => s.id === shiftId) || { id: shiftId, requiredEmployees: 2 };
// Assign manager to his chosen shifts
if (!assignments[shiftId].includes(manager.id)) {
@@ -426,7 +421,7 @@ export function scheduleWithManager(
): SchedulingResult & { resolutionReport?: string[]; allProblemsResolved?: boolean } {
const assignments: Assignment = {};
const allViolations: string[] = [];
//const allViolations: string[] = [];
// Initialisiere Zuweisungen
shifts.forEach(shift => {
@@ -449,14 +444,14 @@ export function scheduleWithManager(
console.log('🔄 Starting Phase B: Enhanced Manager insertion');
// Phase B: Erweiterte Manager-Einfügung
const phaseBResult = phaseBInsertManager(
/*const phaseBResult = phaseBInsertManager(
assignments,
manager,
managerShifts,
employees,
nonManagerShifts,
constraints
);
);*/
console.log('🔄 Starting Enhanced Phase C: Smart Repair & Validation');