comp-b-cw1/mainDLA.cpp

44 lines
943 B
C++

#include <iostream>
#include <vector>
#include "DLASystem.h"
using namespace std;
// functions which are needed for openGL go into a namespace so that we can identify them
namespace drawFuncs {
void handleKeypress(unsigned char key, int x, int y);
void display(void);
void update(int val);
void introMessage();
}
// this is a global pointer, which is how we access the system itself
DLASystem *sys;
int main(int argc, char **argv) {
const auto seed = std::stoi(argv[1]);
char buffer[20];
snprintf(buffer, 20, "seed-%i.csv", seed);
const auto p1 = std::chrono::system_clock::now();
std::ofstream myfile;
myfile.open(buffer);
// create the system
sys = new DLASystem(std::move(myfile));
// this is the seed for the random numbers
cout << "setting seed " << seed << endl;
sys->setSeed(seed);
while (sys->Update()) {
}
cout << sys->numParticles;
return 0;
}