Jon’s PhD Journal

March 31, 2009

Tuesday: munging …

Filed under: Notes — JDE @ 6:59 pm

Spent today re-running simulation a number of times … but finally got there. Downloaded results, and then went through munging process.

Note to self: don’t see any reason why can’t run DirectoryMunger on a full dir of files — should still play ball.

March 30, 2009

Monday: stupidity strikes …

Filed under: Notes — JDE @ 8:54 am

Looking at results from Grid, struggling to identify why the velocities never change. They never change, because the population never gets passed to the velocity calculation rules. Smooth, real smooth.

Idiot.

March 25, 2009

Wednesday: merged code base today …

Filed under: Notes — JDE @ 9:47 am

Today made the changes to grid code that have been made to local code base. Attempted to re-run on the Grid, and appears to have run successfully. Now just need to sanity check the data, and then start to re-run the simulations.

March 24, 2009

Tuesday: fixed model logic

Filed under: Notes — JDE @ 9:51 am

(NB direct linkage to previously mentioned activestate page: http://code.activestate.com/recipes/502240/ – this is the more up to date link)

Got the model running better now. Today implemented a different scaling rule,  so that positions do not just progress linearly. This coupled with the work done on Friday, where the correct population is based to the flocking rules => better flocking behaviour.

Now just need to diff the changes I made and merge into the code used on the grid to re-run the experiments. (Note to self: need to learn how to wield Subversion to do branches / merges correctly!)

March 20, 2009

Friday: broken velocity scaling logic …

Filed under: Notes — JDE @ 9:35 am

So I have the velocity rule:

What seems to happen is that if you exceed the max vel — let’s say its 10 — and come up with a vel of say 10.9416. Max vel / vel = a caling factor of 0.913946. Multiply this scaling factor by the vel of 10.9416 and you get …. 10. Queue permenant loop, and velocity set to 10. Marvelous. Hence you see birds just proceeding in straight lines across the environment.

How do other people do this? What happens if you ditch the velocity rules? Vergenet says to keep the vel bounding rules. How to implement then? The activestate page has an interesting section on velocity.mag ….

March 15, 2009

Sunday: data not quite legit it seems …

Filed under: Notes — JDE @ 7:33 pm

R command of the day:

par(mfrow=c(2, 2), cex=0.6, mar=c(4, 4, 1, 1))
plot(y, type="p")

From http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html — useful for graphing.

Appears data is screwy for some reason. More investigation ahoy!

March 13, 2009

Fri: stating it up …

Filed under: Notes — JDE @ 9:50 am

Need to use factorial anova. See delivicous for details.

R snippets:

test = apply(tt2, MARGIN=2, FUN=mean, na.rm=TRUE) # calculate the mean for each column

 t1 = read.table(“D:/Temp/Data/GridResults/Results/Stat1/output.txt”, sep = “,”, head=TRUE) # seems to be the preferred way to read in files

t2 = t1[,1:10] # how to lop off the trailing column if it is full of NA’s

tt2 = t(t2) # transpose data in the preferred format (it appears) for R

Blog at WordPress.com.