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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user