general issue: have reporter list of breed-owned variable. every tick list changes , want make list store breed-owned variable list every tick.
specifically: record "age" of breed of turtle (ants here). them reported list of "ant nest ages" via following
to-report nest_age_dist let nest-ages-list [nest-age] of ants report (list [nest-age] of ants) end
if call reporter following @ every tick (where numbers ages):
[[1 2 3 3 3 3 3 4 4 4 4 4 5 5 6 6 6 6 6 6 6 6 6]]
this fine , good, want tick each list added list holds them. example want
[[1 1 1 1 2 2 2 3 3 3 ][2 2 2 2 3 3 3 4 4 4][3 3 3 3 4 4 4 5 5 5]]
where
[[tick 1 nest_age_dist ] [tick 2 nest_age_dist ] [tick 3 nest_age_dist ] [tick n nest_age_dist]]
i hope clear.
it seems solution should simple not sure how , have not been able find solution on stackoverflow. fact lists in netlogo immutable blows mind.
as side note, have because when use behaviorspace can't use nest_age_dist reporter because when large list reported every tick .csv created large opened in text editor have tried (textwrangler, texteditor, excel). once have list of lists (given resolved) want report last 100 lists (nest age lists) of list of lists. understand run smaller simulations many times whats point if can't leave overnight whole damn thing!
hope questions , motives asking clear. in advance!
responding last answer there hajz, can use sublist
. like:
globals [ all_nest_age_list last_x_list ] turtles-own [ age ] setup ca crt 5 [ set age random 6 ] set all_nest_age_list [] end go repeat 10 [ ask turtles [ set age age + 1 ] set all_nest_age_list lput ( sort [age] of turtles ) all_nest_age_list ] let x 3 ;; far want set last_x_list sublist all_nest_age_list (length all_nest_age_list - x) (length all_nest_age_list) print last_x_list end
Comments
Post a Comment