#include #include #include #include #include void writeEventsToFile(std::ofstream & file, int numberOfEvents, std::mt19937 & rng) { std::uniform_int_distribution distribution(0,4*Ion::Events::Event::PageSize); int i = numberOfEvents; while (i > 0) { int prEventId = distribution(rng); Ion::Events::Event e(prEventId); if (e.isDefined() && e != Ion::Events::Termination) { i--; file << (unsigned char)(prEventId); } } } int main(int argc, char * argv[]) { if (argc != 3) { std::cerr << "Usage: event_generator " << std::endl; return -1; } std::random_device r; std::mt19937 mt(r()); int count = std::stoi(argv[1]); int lengthAvg = std::stoi(argv[2]); int lengthStdDev = lengthAvg; std::normal_distribution<> lengthDistribution(lengthAvg, lengthStdDev); for (int i=0; i