Add parametrisation for testing
This commit is contained in:
parent
dacfff3e96
commit
54d02253ef
@ -172,10 +172,6 @@ void DLASystem::moveLastParticle() {
|
||||
setParticleInactive(); // make the particle inactive (stuck)
|
||||
updateClusterRadius(lastP->pos); // update the cluster radius, addCircle, etc.
|
||||
}
|
||||
} else {
|
||||
// If we get to here then we are trying to move to an occupied site
|
||||
cout << "reject " << direction << endl
|
||||
<< lastP->pos[0] << "," << lastP->pos[1] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
mainDLA.cpp
22
mainDLA.cpp
@ -13,14 +13,24 @@ using std::endl;
|
||||
DLASystem *sys;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
std::ofstream csv_out("./out.csv");
|
||||
int seed;
|
||||
double stickProbability = 0.5;
|
||||
|
||||
if (argc != 3) {
|
||||
return 1;
|
||||
} else {
|
||||
seed = std::stoi(argv[1]);
|
||||
stickProbability = std::stod(argv[2]);
|
||||
}
|
||||
|
||||
cout << "Seed: " << seed << "Stick P: " << stickProbability << endl;
|
||||
|
||||
std::stringstream str;
|
||||
str << "./out-" << seed << '-' << stickProbability << ".csv";
|
||||
std::ofstream csv_out(str.str());
|
||||
|
||||
// create the system
|
||||
sys = new DLASystem(std::move(csv_out), 0.5);
|
||||
|
||||
// this is the seed for the random numbers
|
||||
int seed = 6;
|
||||
cout << "setting seed " << seed << endl;
|
||||
sys = new DLASystem(std::move(csv_out), stickProbability);
|
||||
sys->setSeed(seed);
|
||||
sys->setRunning();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user