Calculates the best batting lineup given your existing stats by simulating Little League games. The best batting lineup is the one that produces, on average, the most runs per game. Assumptions about the game—such as the number of innings, frequency of passed balls/wild pitches, chances of stealing, and other simulation parameters—can be changed in Settings.
Uses hits, walks, HBP, strikeouts, singles, doubles, triples, HR, ROE, FC, sacrifice flies, sacrifices, stolen bases, caught stealing, and wild pitches/passed balls. Assumes no double plays. Batted outs are split into ground balls and fly balls using adjustable assumptions, with configurable runner advancement on grounders and fielder's choices. Players with fewer than half as many PA as the team PA leader are automatically excluded.
Getting started
Upload either a GameChanger stats export CSV or a simple batting-stat CSV using the format below. For a full GameChanger export, the simulator automatically reads the Batting section and ignores Pitching and Fielding statistics.
PA = plate appearances, H = hits, 1B/2B/3B/HR = singles/doubles/triples/home runs, BB = walks, SO = strikeouts, HBP = hit by pitch, SAC = sacrifice bunts, SF = sacrifice flies, ROE = reached on error, FC = fielder's choice, SB = stolen bases, and CS = caught stealing.
Roster / CSV
This app has your Red Sox stats embedded. Each plate appearance is modeled as one weighted draw from actual event counts, including HR explicitly. You can also load a new CSV.
Settings
0.50 = at least half as many PA as the team leader.
Time-limited games use exactly one fewer inning than the Innings setting. If Batting side is Home, games judged as wins skip the team's final offensive half-inning.
Runner advancement
Batted-out assumptions
For ordinary batted outs, strikeouts stay as strikeouts, while non-strikeout outs are randomly treated as ground balls or fly balls. Ground balls and fielders choices can produce one force out, but never a double play.
Stolen-base attempt rate starts from (SB + CS) / (H + BB + HBP), but SB is treated as bases stolen, not just attempts to steal second. Each simulated game gives every player a season-based steal budget of (SB + CS) / GP. A runner can try for 2nd, 3rd, or home in the same trip, but each attempt spends from that budget, so his later steal chance drops after he has already stolen or attempted. The base-specific aggressiveness settings make stealing 2nd more likely than stealing 3rd, and stealing home much rarer. Success rate is SB / (SB + CS), or the default above if CS is unavailable.
The genetic algorithm seeds the population with current, OBP, OPS/SLG, speed, and baseball-style orders; keeps the best lineups each generation; then creates children by order-crossover and swap/insertion mutations.
Lineup locks (optional)
Force a player into a specific batting slot. The optimizer will keep locked players fixed and optimize the remaining slots. No batting slots are locked by default. You can leave this entire section unchanged for a normal optimization run.
Start the simulation
When your settings are ready, click Run Optimizer below to start simulating and comparing batting orders.
Top 5 lineups so far
Results
Player batting-position distributions — Top 30 lineups
Each player has a separate bar chart. The x-axis is batting position and the bar height is how many of the top 30 optimized lineups place that player in that position.
Watch one simulated game
This animates one game using the same hitter event probabilities, stolen-base budgets, runner-advancement rules, and inning setting as the optimizer. The simulator models only your offense, so the opponent score is shown as 0.
Batting order
HOME1B2B3B
P
C
1B
2B
SS
3B
LF
CF
RF
RUNS
0
INNING
1
OUTS
0
At bat:—
AVG
—
OBP
—
OPS
—
SB
—
AT-BAT RESULT
—
Ready
Last play:Ready
Score: Red Sox 0 – Opponent 0
RUN!
Game:1 of 1Series runs:0Avg:0.00
Model validation / sanity check
This simulates each player’s plate appearances many times and compares the simulated cumulative batting line to the original GameChanger data. The optimizer is only useful if these values are close.
Eligible players
Lineup leverage / forced-slot analysis
Choose a player and the app will force him into each batting slot, then re-optimize the rest of the lineup around him. This helps explain why a strong hitter or basestealer may be worth more in one spot than another.
Bottom-order value + pairwise synergy
These diagnostics help explain counterintuitive lineups where a stronger hitter is placed lower. Turnover value tests whether a player creates value as a second leadoff hitter in spots 7–9. Pairwise synergy estimates which hitter-before-hitter combinations create more runs than typical random adjacency.
Turnover / bottom-order value
Pairwise synergy matrix
The matrix value is runs/game above or below a randomized baseline when the row player bats immediately before the column player. Positive values suggest a useful sequence; negative values suggest that adjacency is less helpful.
This software is licensed for personal, non-commercial use only. You may use it in its original form for personal, non-commercial purposes. Copying, modification, redistribution, sublicensing, sale, publication, commercial use, or incorporation of this software or its source code into another product or service is prohibited without the author's prior written permission.
This software is provided “as is,” without warranty of any kind, express or implied, including warranties of merchantability, fitness for a particular purpose, and noninfringement. The author shall not be liable for claims, damages, or other liability arising from use of the software.