Jon’s PhD Journal

April 25, 2007

Wednesday: looking at a flock’s polarisation …

Filed under: Coding — JDE @ 4:00 pm

Ok, it’s taken a while but I think we are finally there.  Following on from the SAS code documented yesterday, the outstanding task is to work out the standard deviation of the flock: this can be achieved through the means procedure, the syntax of which is as follows:

proc means data=boids;
var vel_atan_theta; * variable to run the calculations on;
run;

…  And this led me back to the actual data itself.I had run some simulations previously, adjusting the radius parameter of the birds each time, but I had not recorded the flock velocity information in this data, so would need to do them again.  As such, this in turn led me back to the simulation code itself.

After running a couple of simulations, changing the radius settings, I noticed that there didn’t appear to be any difference in what I was visually observing the simulation when I changed the radius setting.  As such, I start to look through the code in a little bit more detail.  Upon doing this, it dawned on me that the radius parameter actually has nothing to do with the flocking behaviour witnessed: from my reading a couple weeks ago in 3-D programming, it hit me that the radius parameter was actually there to be used in collision detection calculations — nothing to do with flocking per se.

As such the remainder of today was spent adjusting the simulation to be able to gather the parameters I think will be of value: namely the different weightings used in the flocking calculations (separation, alignment, cohesion), and the proximity parameter.  I also modified the simulation so that it is now toroidal.

Although I did spend some time messing around with what has proved to be a fruitless parameter setting, at least I now know more about the simulation, and have come up with a way of being able to measure the amount of polarisation in the flock.  I’ll pick this up again on Friday, as my daytrip to Reading campus. 

Blog at WordPress.com.