Multi-Factor Fairness Calculation Engine
The generator ranks eligible players for each open defensive spot using playing-time history and rotation rules. Unlike a simple round-robin, it considers:
-
Historical Position Frequency: Tracks how many times each player has played each position across previous games in the season, not just the current game. Players who have spent less time at a spot are ranked first for that assignment.
-
Consecutive Position Variety: Tries to avoid assigning the same player to infield for too many consecutive innings. Locked spots and fill-the-board fallbacks can still override that preference.
-
Player Position Preferences: Considers player position preferences when building the rotation. Disliked positions are skipped when another player is available; coaches can still lock or change any assignment.
-
Locked Key Positions: Pitcher, catcher, and other spots you have already assigned stay in place. The generator fills the remaining field around those locks.
-
Bench Time Distribution: Uses bench history to help spread sitting time more evenly across the roster, rather than guaranteeing identical bench time.
Ranking, Constraints, and Adjustment Passes
The generator fills open spots inning by inning, then runs a limited adjustment pass. Coaches keep final control. Here's how it works step-by-step:
-
Constraint Definition Phase: Hard constraints include assigning exactly one player per position per inning and leaving locked assignments in place. Consecutive-infield variety and bench rotation are preferences the generator tries to honor.
-
Fairness Ranking: For each open position, eligible players are ranked by how often they have already played that spot. Players who have played it less frequently are considered first.
-
Fill Open Spots With Fallback: The generator assigns the best-ranked eligible player to each open spot. If a spot would otherwise stay empty, a fallback pass can fill it even when a preferred rotation rule cannot be met.
-
Improvement Pass: After a starting lineup is filled, the algorithm can swap some algorithm-assigned spots to spread infield and bench time more evenly. Locked assignments stay put. The result is a stronger starting point, not a guaranteed perfectly fair card.
-
Validation and Output: Before presenting the lineup, the system checks the current plan and produces summary notes and breakdowns that coaches and parents can review together.
Performance and Scalability
Our generator is designed for real-world youth baseball and softball team sizes (typically 9-15 players) and game lengths (4-7 innings):
Fast
Built for typical youth team sizes and inning counts
Flexible
Works around locked spots and not-playing players
Repeatable
Clear and regenerate after edits
The generator is built for typical youth team sizes and game lengths, making it practical for normal pregame planning and quick reruns after edits.
Why This Matters for Your Team
Understanding how the algorithm works helps coaches explain lineup decisions. Playing-time history and rotation notes give families clearer context, while the coach still makes the final call.
The generator is designed to support fairer lineup decisions while keeping competitive decisions with the coach. The goal is more consistent opportunities for players to develop at different positions, not a guaranteed outcome.