Minor changes
This commit is contained in:
parent
c1b4b6bab1
commit
dacfff3e96
@ -148,12 +148,12 @@ void DLASystem::updateClusterRadius(double pos[]) {
|
|||||||
|
|
||||||
// make a random move of the last particle in the particleList
|
// make a random move of the last particle in the particleList
|
||||||
void DLASystem::moveLastParticle() {
|
void DLASystem::moveLastParticle() {
|
||||||
int rr = rgen.randomInt(4); // pick a random number in the range 0-3, which direction do we hop?
|
int direction = rgen.randomInt(4); // pick a random number in the range 0-3, which direction do we hop?
|
||||||
double newpos[2];
|
double newpos[2];
|
||||||
|
|
||||||
Particle *lastP = particleList[this->particleList.size() - 1];
|
Particle *lastP = particleList[this->particleList.size() - 1];
|
||||||
|
|
||||||
setPosNeighbour(newpos, lastP->pos, rr);
|
setPosNeighbour(newpos, lastP->pos, direction);
|
||||||
|
|
||||||
if (distanceFromOrigin(newpos) > killCircle) {
|
if (distanceFromOrigin(newpos) > killCircle) {
|
||||||
setGrid(lastP->pos, 0);
|
setGrid(lastP->pos, 0);
|
||||||
@ -173,10 +173,9 @@ void DLASystem::moveLastParticle() {
|
|||||||
updateClusterRadius(lastP->pos); // update the cluster radius, addCircle, etc.
|
updateClusterRadius(lastP->pos); // update the cluster radius, addCircle, etc.
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if we get to here then we are trying to move to an occupied site
|
// If we get to here then we are trying to move to an occupied site
|
||||||
// (this should never happen as long as the sticking probability is 1.0)
|
cout << "reject " << direction << endl
|
||||||
cout << "reject " << rr << endl;
|
<< lastP->pos[0] << "," << lastP->pos[1] << endl;
|
||||||
cout << lastP->pos[0] << " " << lastP->pos[1] << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user