Jon’s PhD Journal

May 31, 2006

Coding, coding, coding, get them birdies flying, rawhide …

Filed under: Notes — JDE @ 8:54 am

Started writing the 2D version of a flocking model today — going quite well: done all of the initialisation pieces, now just got 2 of the 3 rules to do, which I’ll finish off tomorrow, and then hopefully (touch wood) I’ll have a 2D simulation of flocking to play with !!

May 30, 2006

Monday 29th and Tuesday 30th May double-post …

Filed under: Notes — JDE @ 9:33 am

Yes, totally forgot to post an update yesterday  — got confused due to the bank holiday ;-). Spent Sunday – Tuesday’s allotted time getting the Flocking Overview Report into a state where it can be handed in. Still feels quite lightweight, but confident that as I put more time into the reading/writing/reporting cycle, and learn more about the field, it will be bolstered in content.

 Tomorrow will be coding a 2D flocking example from scratch!! (… to have a few days off from writing)

May 26, 2006

Friday’s frustration….

Filed under: Notes — JDE @ 8:50 am

As can probably be seen from the title, a frustrating day …

  • taught myself how command line options work in Python, so that I can take options from the command line instead of hard-changing the code each time I want to change something — for example, turning logging on and off, change the number of boids, etc. However, while I understand how it works, how this is applied to the Python biod simulation I found on the internet is beyond me at this point … :-(
  • … so I had a look at the Python simulation I found, and had a bit of a think about it: I think I’ve gone about this potentially the wrong way. I now believe the best way forwards on the coding front would be to try and implement a 2D simple simulation of my own, not trying to re-engineer something that I found on the net. This will be next week’s coding efforts I think … and the source of next week’s trials and tribulations !!
  • I’m now going to have a couple of day’s off from the coding, and look back at the written efforts
  • Have a feeling that a weekly cycle will be 3 days code, 3 days, repeat, to begin with, and see how this goes

May 25, 2006

Meeting with Will, 25-May, TC …

Filed under: Meetings — JDE @ 10:55 am
  • agreed to get flocking report in for initial review and critique: aiming to send to Will 30-May
  • discussed ways of measuring emergent behaviour
    • traces of  position
      • i.e. the position of a particle in the environment
    • distance travelled by the particle
    • average distance apart
    • distance from perceived centre of flock
      • min, mean, max
      • individual distance from perceived centroid
  • flocking is very fragile:
    • what causes it to stabilise
    • what are the critical factors
  • automate the testing of flocking: how "good" is this flock?
    • the ability to classify flocks, into good, bad, etc …
    • any scoring systems out there?
      • if not, invent one!
  • !!NB if you pick up a number of inter-library loan cards and stickers the next time on campus, you can post them to Will for him to put them through the system (thanks Will!)

Thursday’s misadventures with writing to files ….

Filed under: Notes — JDE @ 8:56 am

Within the first 10min of today, got my flocking algorithm working. However, looking at the behaviour didn’t appear to work as anticipated — the boids appeared to be flying in a line and not flocking. To test this, I decided to look into logging the vector positions of the individuals, as I’d then be able to chart positions, etc…

Finally, after 60min of trying, managed to get Python to write the results of a for-loop to a file — result!! Following this, *ahem*, "grand accomplishment" (!), set about getting the logging working.  I got this sorted, and realised that my fears were confirmed: my implementation of the function does not function as anticipated — for example, the x coordinate of the move to centre rule starts at ~-250 … suscpicious.

Now that I’ve got this to work, the next step is to adjust the code snippets so I can take arguments from the command line to change things on the fly (number of boids and whether to turn logging on and off), and then figure out where it’s all going wrong. When that’s done, I can start playing with the variables — what happens if the flocking parameters are changed, etc.

(NB may need to ask Will how to go about comparing emergent behvaiours to one another) 

May 24, 2006

Meeting Agenda with Will, 25-May-06 @ 11 – 12pm (TC — Jon to call Will) …

Filed under: Meetings — JDE @ 9:00 am
  • Week’s activities
    • continuing to write up flocking report
      • NB following last week’s meeting, had a bit of a brainwave — see Friday’s Notes for more details on how I can see the reporting cycles working
      • … and as such, recognise need to get "something" out there, for review and comment, so I at least understand the required level of detail, etc
        • as such, agree date to get first draft in — am thinking Tuesday 30-May : thoughts?
    • programming
      • attempting to learn how to program algortihms
      • also learning on how to program in Python
      • plan is to get something working, and have a bit of a tinker with it: e.g. change variables, see what happens, how to log the positions of the particles, etc
  • Next week’s activities
    • get report into some state for submission
    • get the boids simulation working!!

Summary of Activites, Thurs 18-May-06 — Wed 24-May-06 …

Filed under: Summaries — JDE @ 8:55 am

Admin

  •  blessed little, thankfully … ;-)

Research

  • kept adding some detail into the flocking overview report
    • recognise need to get this compiled and out there for comment
    • following last week’s meeting with Will, had the following brainwave about how to do this part of the research: see Friday’s Friday’s notes on thoughts around this
      • so need to set a deadline for when to submit the report in it’s current state
  • programming…
    • found an implementation of a boids algorithm, and trying to get it to work in Python, as a crash-course in both Python and boid algorithms
      • in short, getting there … got the code entered, but there are obviously issues with it as it doesn’t work!
      • currently debugging, as a chance to learn/understand more about Python (current weapon of choice), and boid algorithms

Wednesday’s debugging attempts …

Filed under: Notes — JDE @ 8:49 am

As of yesterday, I had a Python program that refused to work … and today I have a Python program that refuses to work!! However, we’ve made some sort of progress in the shape of today’s version at least pushes out some error messages. Yesterday’s major issue was the fact that Python depends on indentation to indicate blocks of code … three guesses who got the indentation a little incorrect … ? ;-)

Anyway, got the program to kick out error messages, so I at least have something to debug — yesterday it looks like the main statement wasn’t working, so the entire program wasn’t working … leaving me scratching my head as to why there was no output! Tomorrow, should be able to explain in further detail.

Also, had a crash course in the Python debugger, as will need to know this at some point (and at the beginning of the day, I thought I’d need to know it ASAP!) 

May 23, 2006

Tuesday’s adventures …

Filed under: Notes — JDE @ 8:53 am

Still  attempting to get a program for boids to work … got all the code entered in, and it’s not working — grrr!! Cue a couple of days of working out how to get the Python debugger to work. I’ve been struggling with Eclipse’s indenting of the code as well, and I know Python can get picky about this, so there could well be an error here somewhere.

May 22, 2006

Monday …

Filed under: Notes — JDE @ 9:01 am

V. briefly, started looking at the code aspects of boid programming. Found a boid program written in Python, so have gone through that to understand how it works (or not … ;-) ). Going to go through the file, probably typing it out again, and having a go at playing with the variables .. could also look at getting it to output the positions of all the boids also.

Older Posts »

Blog at WordPress.com.