-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMonthlyAnalysis.sh
More file actions
95 lines (76 loc) · 2.96 KB
/
Copy pathMonthlyAnalysis.sh
File metadata and controls
95 lines (76 loc) · 2.96 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env bash
# Running this by itself assumes at least some logs have been processed
#
# Usage:
# ./MonthlyAnalysis.sh outputs Stats for all cutoffs
# ./MonthlyAnalysis.sh --partial only 1630/1695 files
partial=false
if [[ "$1" == "--partial" ]]; then
partial=true
fi
rm -r Stats
mkdir Stats
mkdir Stats/moveset
function process {
tier=$1
if [[ $tier == "moveset" ]]; then
return
fi
echo "Processing "$tier >> log.log
if [[ $tier == "gen9ou" ]] || [[ $tier == "gen9doublesou" ]] || [[ $tier == "gen9randombattle" ]] || [[ $tier == 'gen9oususpecttest' ]] || [[ $tier == "gen9doublesoususpecttest" ]]; then
node dist/StatCounter.js $tier 1695 &&
node dist/batchMovesetCounter.js $tier 1695 > Stats/moveset/$tier-1695.txt
else
node dist/StatCounter.js $tier 1630 &&
node dist/batchMovesetCounter.js $tier 1630 > Stats/moveset/$tier-1630.txt
fi
}
export -f process
function nextprocess {
tier=$1
if [[ $tier == "moveset" ]]; then
return
fi
echo "Processing "$tier >> log.log
if [[ $tier == "gen9ou" ]] || [[ $tier == "gen9doublesou" ]] || [[ $tier == "gen9randombattle" ]] || [[ $tier == 'gen9oususpecttest' ]] || [[ $tier == "gen9doublesoususpecttest" ]]; then
node dist/StatCounter.js $tier 1825 &&
node dist/batchMovesetCounter.js $tier 1825 > Stats/moveset/$tier-1825.txt
else
node dist/StatCounter.js $tier 1760 &&
node dist/batchMovesetCounter.js $tier 1760 > Stats/moveset/$tier-1760.txt
fi
node dist/StatCounter.js $tier 0 &&
node dist/batchMovesetCounter.js $tier 0 > Stats/moveset/$tier-0.txt
node dist/StatCounter.js $tier 1500 &&
node dist/batchMovesetCounter.js $tier 1500 > Stats/moveset/$tier-1500.txt
}
export -f nextprocess
function monotype {
tag=$1
tier=gen9monotype
echo "Processing "$tag >> log.log
node dist/StatCounter.js $tier 1630 $tag &&
node dist/batchMovesetCounter.js $tier 1630 $tag > Stats/moveset/$tier-$tag-1630.txt
node dist/StatCounter.js $tier 1760 $tag &&
node dist/batchMovesetCounter.js $tier 1760 $tag > Stats/moveset/$tier-$tag-1760.txt
node dist/StatCounter.js $tier 0 $tag &&
node dist/batchMovesetCounter.js $tier 0 $tag > Stats/moveset/$tier-$tag-0.txt
node dist/StatCounter.js $tier 1500 $tag &&
node dist/batchMovesetCounter.js $tier 1500 $tag > Stats/moveset/$tier-$tag-1500.txt
}
export -f monotype
ls -S Raw/ | parallel -j 5 process
if [[ "$partial" == false ]]; then
ls -S Raw/ | parallel -j 5 nextprocess
parallel -j 5 monotype ::: mononormal monofighting monoflying monopoison monoground monorock monobug monoghost monosteel monofire monowater monograss monoelectric monopsychic monoice monodragon monodark monofairy
mkdir Stats/monotype
mv Stats/gen9monotype-mono* Stats/monotype/.
mkdir Stats/monotype/matchupcharts
mv Stats/gen9monotype-matchup* Stats/monotype/matchupcharts/.
mv Stats/gen9nationaldexmonotype-matchup* Stats/monotype/matchupcharts/.
for d in chaos leads metagame moveset
do
mkdir Stats/monotype/$d
mv Stats/$d/gen9monotype-mono* Stats/monotype/$d/.
done
fi