aboutsummaryrefslogtreecommitdiffstats
path: root/src/many.cc
blob: 8844d04cc3fa599516dbea7189667bd4c39498e2 (plain) (blame)
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
#include <iostream>
#include <fstream>

#include "NameGame.h"

constexpr int group_size = 1000, T = 1000;
constexpr int cmsize_min = 250, cmsize_max = 255;
constexpr int trials = 10;

int main(int argc, char* argv[]) {
	tp::NameGame namegame(group_size, 0, 12);
	std::vector<std::pair<int, int>> runs;
	for (int i = cmsize_min; i <= cmsize_max; ++i) {
		for (int j = 0; j < trials; ++j) {
			namegame.setCMsize(i);
			namegame.initMemory();
			namegame.clearRecord();
			int a = namegame.run(group_size * T);
			runs.push_back({i, a});
		}
		std::cout << "finished cmsize " << i << std::endl;
	}
	std::ofstream f("many.csv");
	f << "cmsize,adopters\n";
	for (const auto& p : runs) {
		f << p.first << ',' << p.second << '\n';
	}
	return 0;
}