Improve formatting for Event Create

This commit is contained in:
2025-09-25 09:58:56 -04:00
parent 7b1a52d5b3
commit 227dbcf336
9 changed files with 135 additions and 190 deletions
+4 -3
View File
@@ -84,9 +84,10 @@ public class TeamScheduler
foreach (var s in _timeSlots)
model.Add(x[ts.Item1, s] != x[ts.Item2, s]);
var solver = new CpSolver();
var cpSolverStatus = solver.Solve(model);
var solver = new CpSolver();
solver.StringParameters = "max_time_in_seconds:2.0";
var cpSolverStatus = solver.Solve(model);
Debug.WriteLine($"Solver status: {cpSolverStatus}");
var timeSlotTeams = new Team[_timeSlots.Length][];
+12
View File
@@ -29,4 +29,16 @@ public class TeamSchedulerSolution(
where gs.Key.Count() > 1
select Tuple.Create(gs.First(), gs.Key);
}
public static Student[] GetStudentsNotInTimSlot(Team[] timeSlot, Student[] students)
{
var studentsInTimeSlot = timeSlot.SelectMany(ts => ts.Students).Distinct();
return
(from allStudent in students
where studentsInTimeSlot.FirstOrDefault(e => e.Equals(allStudent)) == null
select allStudent
).ToArray();
}
}
+14 -2
View File
@@ -5,9 +5,20 @@ namespace Core.Entities;
public class EventDefinition
{
public int Id { get; set; }
[Required]
[StringLength(100, MinimumLength = 2)]
[Display(Name = "Event Name")]
public string Name { get; set; }
public string? ShortName { get; set; }
public EventFormat EventFormat { get; set; }
[Required]
[StringLength(40, MinimumLength = 2)]
[Display(Name = "Event Short Name")]
public string? ShortName { get; set; }
[Required]
public EventFormat EventFormat { get; set; }
[Range(1, 6)]
public int MinTeamSize { get; set; }
@@ -55,6 +66,7 @@ public class EventDefinition
public string? Documentation { get; set; }
[Required]
public string Eligibility { get; set; }
public string? Theme { get; set; }
public string? Description { get; set; }