How to measure a set of attributes of individual agents in Behaviour Space?

171 Views Asked by At

So far, all the experiments I have run using Behaviour Space have been to either record global variables or the average values of agent variables across different agentsets.

However, I need to measure a set of attributes (violence, entitativity, homogeneity, size) of individual emergent agents (extremist groups) at two/three different timesteps each run. I also need to do this across a number of different model scenarios and ideally have it all summarised in the same spreadsheet. The aim is to plot the relationship between each agent attributes, with individual agents as my cases.

I can't seem to workout if this is possible using Behaviour Space. I have tried using e.g. [violence] of groups as a reporter in Behaviour Space, but the output is then a single string variable that I can't do anything with. I've also thought about using the export-world primitive but, from what I understand, this will overwrite the file every time it is executed or create separate files each time.

1

There are 1 best solutions below

0
On

There may be a more elegant way to do this but the following should work. Create global variables, say v0, v1, v2 ...,vn for the individual violence within group n. Set these at each tick. Report them separately in Behavior space.

Example:

globals [ mass-violence v0 v1 v2]

turtles-own [ violence]

to setup
  clear-all
  create-turtles 3 [ setxy random-xcor random-ycor set violence 0 ]
  reset-ticks
end

to go
     
  set mass-violence 0
  
  if ( ticks > 4 ) [ stop ]
  ask turtles [ set violence random 100  set mass-violence mass-violence + violence]
  
  set v0 [violence] of turtle 0
  set v1 [violence] of turtle 1
  set v2 [violence] of turtle 2
  
  print (word mass-violence " " v0 " " v1 " " v2 )
  tick
end

Or you could parse the string you ended up with in Excel using Excel commands to pull selected items out of the string and put them into separate columns. That would end you up in the same place. For example, 5 runs of the above code produces this: enter image description here