新增每门课程的“优先上课日 / 偏好节次范围”,与硬性可排范围分离。

遗传算法在满足冲突、容量、场地等硬约束后,优先满足课程偏好;偏好无法满足时仍会安排可行课次。
管理员可通过“课程偏好权重”控制偏好的影响程度。
修复遗传适应度:教室容量冗余、同一任务分散、日负载和实验场地偏好现在都会实际参与种群评分
This commit is contained in:
biss committed 2026-08-17 11:10:49 +08:00
1 parent 94bc064697
commit c4649f9cdc
10 files changed
+7409 -17

No files matched your search

@@ -58,6 +58,7 @@ public sealed class ScheduleOptimizationSettings : EntityBase
public int EarlyPeriodPenalty { get; set; } = 30;
public int LatePeriodPenalty { get; set; } = 30;
public int RoomCapacityWasteWeight { get; set; } = 1;
public int CoursePreferenceWeight { get; set; } = 180;
public static ScheduleOptimizationSettings CreateDefault(Guid academicTermId) =>
new() { AcademicTermId = academicTermId };
@@ -79,6 +80,9 @@ public sealed class TeachingTaskScheduleConstraint : EntityBase
public string? AllowedDayOfWeeks { get; set; }
public int? EarliestPeriod { get; set; }
public int? LatestPeriod { get; set; }
public string? PreferredDayOfWeeks { get; set; }
public int? PreferredEarliestPeriod { get; set; }
public int? PreferredLatestPeriod { get; set; }
public TeachingVenueNature AllowedExperimentVenueNatures { get; set; }
public ICollection<TeachingTaskAllowedClassroom> AllowedClassrooms { get; set; } = [];
public ICollection<TeachingTaskAllowedExperimentClassroom> AllowedExperimentClassrooms { get; set; } = [];