Enhance AI and simulation components with presence management and routing capabilities
ci / server (push) Failing after 3m39s
ci / client (push) Successful in 14s

- Introduced the `HSchool.Ai` project, responsible for routing, day plans, and presence management.
- Updated the `HSchool.Simulation` project to integrate with the new AI functionalities, improving decision-making and presence tracking.
- Added `travelMinutes` to room and territory definitions, ensuring accurate movement calculations within the simulation.
- Enhanced the `School` class to manage presence and implement empty-time skipping functionality.
- Updated documentation to reflect the new AI features and their impact on school simulation.
- Added tests for presence management and routing to ensure robust functionality and reliability.
This commit is contained in:
Leonid Pershin
2026-08-19 16:33:52 +03:00
parent c16c34a83c
commit 4137400621
50 changed files with 1978 additions and 57 deletions
@@ -86,6 +86,52 @@ public class CalendarTests
Assert.Equal(DaySlot.BreakAfter(2), slot);
}
[Fact]
public void NextWorkMorning_FromSaturdayLandsOnMondaySix()
{
var catalog = LoadVanilla();
var next = SchoolDay.NextWorkMorning(catalog, new DateTime(2012, 4, 7, 10, 0, 0, DateTimeKind.Utc), weekDays: 5);
Assert.Equal(new DateTime(2012, 4, 9, 6, 0, 0, DateTimeKind.Utc), next);
}
[Fact]
public void NextWorkMorning_FromTuesdayNightLandsOnThatMorning()
{
var catalog = LoadVanilla();
var next = SchoolDay.NextWorkMorning(catalog, new DateTime(2012, 4, 3, 3, 0, 0, DateTimeKind.Utc), weekDays: 5);
Assert.Equal(new DateTime(2012, 4, 3, 6, 0, 0, DateTimeKind.Utc), next);
}
[Fact]
public void NextWorkMorning_FromTuesdayEveningLandsOnWednesday()
{
var catalog = LoadVanilla();
var next = SchoolDay.NextWorkMorning(catalog, new DateTime(2012, 4, 3, 22, 0, 0, DateTimeKind.Utc), weekDays: 5);
Assert.Equal(new DateTime(2012, 4, 4, 6, 0, 0, DateTimeKind.Utc), next);
}
[Fact]
public void InWorkWindow_SevenOnAWorkday_IsAlreadyOpen()
{
var catalog = LoadVanilla();
var seven = new DateTime(2012, 4, 3, 7, 0, 0, DateTimeKind.Utc);
Assert.True(SchoolDay.IsWorkday(catalog, seven, weekDays: 5));
Assert.True(SchoolDay.InWorkWindow(catalog, seven, weekDays: 5));
}
[Fact]
public void InWorkWindow_DoesNotNeedTeachers()
{
var catalog = LoadVanilla();
var morning = new DateTime(2012, 4, 3, 10, 0, 0, DateTimeKind.Utc);
Assert.True(SchoolDay.InWorkWindow(catalog, morning, weekDays: 5));
}
[Fact]
public void Subject_UnknownRoom_FailsTheCatalog()
{