save outputs, tweak num samples & output width
This commit is contained in:
parent
c4b27215e2
commit
895baeb1ad
4
main.go
4
main.go
|
@ -298,7 +298,7 @@ func printElectoralCollegeHistogram(samples []int) {
|
||||||
|
|
||||||
cp := 0.0
|
cp := 0.0
|
||||||
for i, count := range histogram {
|
for i, count := range histogram {
|
||||||
bar_length := (count * 75) / max_count // Assuming max_count bar length is 50 characters
|
bar_length := (count * 100) / max_count // Assuming max_count bar length is 50 characters. 75.
|
||||||
p := float64(count) / float64(len(samples)) * 100
|
p := float64(count) / float64(len(samples)) * 100
|
||||||
cp += p
|
cp += p
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
n_sims := 100_000
|
n_sims := 1_000_000
|
||||||
|
|
||||||
printStates(states)
|
printStates(states)
|
||||||
fmt.Printf("\n\n")
|
fmt.Printf("\n\n")
|
||||||
|
|
3
makefile
3
makefile
|
@ -1,6 +1,9 @@
|
||||||
run:
|
run:
|
||||||
go run main.go
|
go run main.go
|
||||||
|
|
||||||
|
save:
|
||||||
|
go run main.go > "out/output-$$(date +"%Y-%m-%d").txt"
|
||||||
|
|
||||||
polls:
|
polls:
|
||||||
mkdir -p data/polls
|
mkdir -p data/polls
|
||||||
rm data/polls/president_polls.csv
|
rm data/polls/president_polls.csv
|
||||||
|
|
1133
out/output-2024-06-02.txt
Normal file
1133
out/output-2024-06-02.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user