feat: add sliding window trip generation for By Games mode

Adds a trip duration stepper (2-21 days) to the By Games planning mode.
When users select specific games, the planner now generates ALL possible
N-day windows containing those games (e.g., 7-day trips starting on
different days), finding additional games in each window to maximize
route options.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-11 19:19:46 -06:00
parent 3f80a16201
commit dcd5edb229
4 changed files with 64 additions and 8 deletions

View File

@@ -240,6 +240,9 @@ struct TripPreferences: Codable, Hashable {
/// Whether to start/end from a home location (vs fly-in/fly-out)
var useHomeLocation: Bool
/// Trip duration for gameFirst mode sliding windows (number of days)
var gameFirstTripDuration: Int
init(
planningMode: PlanningMode = .dateRange,
startLocation: LocationInput? = nil,
@@ -262,7 +265,8 @@ struct TripPreferences: Codable, Hashable {
allowRepeatCities: Bool = true,
selectedRegions: Set<Region> = [.east, .central, .west],
followTeamId: UUID? = nil,
useHomeLocation: Bool = true
useHomeLocation: Bool = true,
gameFirstTripDuration: Int = 7
) {
self.planningMode = planningMode
self.startLocation = startLocation
@@ -286,6 +290,7 @@ struct TripPreferences: Codable, Hashable {
self.selectedRegions = selectedRegions
self.followTeamId = followTeamId
self.useHomeLocation = useHomeLocation
self.gameFirstTripDuration = gameFirstTripDuration
}
var totalDriverHoursPerDay: Double {