jakehanson / Random-Walk-Simulation

Thermodynamic model of nest site selection in Temnothorax ant colonies used to demonstrate how Brownian particles can take on decision-making characteristics
https://elife-asu.github.io/wss-modules/modules/4-collective-behavior/
MIT License
0 stars 0 forks source link

Maxwell Boltzmann Initial Distribution #9

Open jakehanson opened 7 years ago

jakehanson commented 7 years ago

Add a flag so that particles can start with a maxwell boltzmann distribution with temperature T.

jakehanson commented 7 years ago

Proposed API

void Ants::populate(double L, double H, double T,double r_enc,int max_init, int seed)
{
    std::mt19937 gen(seed); // create generator with default seed
    std::normal_distribution<double> nd(0.,1.0); // init normal dist with mean 0 and stddev 1
    std::uniform_real_distribution<double> uni(0.,1);

...

    x_velocities.at(i) = sqrt(T)*nd(gen);
    y_velocities.at(i) = sqrt(T)*nd(gen);
}