GithubHelp home page GithubHelp logo

diffusion-limited-aggregation's Introduction

Always learning.

Charlie's GitHub stats

My top languages are-

Top Langs

Here's my research blog

You can find me on Medium, or on LinkedIn.

diffusion-limited-aggregation's People

Contributors

cm2435 avatar

Watchers

 avatar

diffusion-limited-aggregation's Issues

Double Checks of stick probability

When performing stick calculations you perform two probabilistic checks for a successful stick. This can be seen in the following two code sections:

if (checkStick()) {
//cout << "stick" << endl;
if(rgen.random01() < StickProb){
setParticleInactive(); // make the particle inactive (stuck)
updateClusterRadius(lastP->pos); // update the cluster radius, addCircle, etc.
if (numParticles % 100 == 0 && logfile.is_open()) {
logfile << numParticles << " " << clusterRadius << endl;
}
bool verb = false;
string LogRow = LogRadius(verb);
LogfileRows.push_back(LogRow);
}
}

int DLASystem::checkStick(double StickProb) {
//Stickprob should not be able to be greater than one, it is a probability
if (StickProb > 1.0){
throw std::invalid_argument( "StickProb was set greater than one" );
};
Particle *lastP = particleList[numParticles - 1];
int result = 0;
// loop over neighbours
for (int i = 0; i < 4; i++) {
double checkpos[2];
setPosNeighbour(checkpos, lastP->pos, i);
// if the neighbour is occupied...
if (readGrid(checkpos) == 1){
if (rgen.random01() < StickProb){
result = 1;
}
};
}
return result;
}

Both approaches are valid, either inserting the probability check after we have confirmed we are in the correct location (the first code block), or for each possible stick (up, down, left, right). However the inclusion of both is an error giving you a stick probability $p_{err} \sim p^2$.

We should ask the lecturers which behaviour is correct, I chose the former but thinking about it the latter may be more "correct".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.