-
Notifications
You must be signed in to change notification settings - Fork 0
/
sabrBatting
39 lines (30 loc) · 1.28 KB
/
sabrBatting
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public class sabrBatting {
public static double runsCreated;
public static double wOBA;
public static double BABIP;
public static double isoPower;
// Estimates number of runs a hitter contributed to the team
public static void runsCreated() {
runsCreated = ((regBatting.hits + regBatting.BB) * regBatting.totalBases)/(regBatting.atBats + regBatting.BB);
}
// Weighted on base average
// Player's overall offensive contribution per plate appearance
public static void wOBA() {
wOBA = ((0.72 * regBatting.BB) + (0.884 * regBatting.singles) + (1.257 * regBatting.doubles) +
(1.593 * regBatting.triples) + (2.058 * regBatting.HR))/regBatting.PA;
}
// Batted balls in play
// Measurement of how many balls that a batter puts in play go for hits or how many balls
// put in play against a pitcher go for hits excluding home runs
public static void BABIP() {
BABIP = (regBatting.hits - regBatting.HR)/(regBatting.atBats - regBatting.HR);
}
// Isolated power
// Hitting power showing how many extra bases a player averages per at bat
// Defined as slugging percentage minus batting average
public static void isoPower() {
isoPower = (regBatting.doubles + (regBatting.triples * 2) + (regBatting.HR * 3))/regBatting.atBats;
}
public static void main(String[] args) {
}
}