I have 6 members who are on one of two teams (so 2 x 3 member teams). Two team members randomly get selected from each team to work on a team task -- the two members simultaneously form a task-link with their respective team task. My goal is to create and then update the count (links-own variable n-interaction) of the number of times the two members on each team interact (interact-link). I have attempted to use ifelse statements calling who numbers but cannot get n-interaction to update. Any ideas would be appreciated.
breed [members member]
breed [team-tasks team-task]
members-own [
teamID
tasklink?
teammembers
interactwith ]
team-tasks-own [
teamID
]
undirected-link-breed [team-links team-link]
undirected-link-breed [task-links task-link]
undirected-link-breed [interact-links interact-link]
interact-links-own [ n-interaction ]
to go
create-initialform-task
dyads-work-task
update-interaction
tick
clear-taskwork
end
to dyads-work-task
ask n-of 2 members with [teamID = 1]
[ create-task-link-with one-of team-tasks with [teamID = 1 and completed? = false]
set tasklink? true
]
ask n-of 2 members with [teamID = 2]
[ create-task-link-with one-of team-tasks with [teamID = 2 and completed? = false]
set tasklink? true
]
end
to update-interaction
ask members with [ teamID = 1 and tasklink? ]
[ let my-work-partner (other teammembers with [ teamID = 1 and tasklink? ])
set interactwith (sentence interactwith my-work-partner)
]
ask members with [ teamID = 2 and tasklink? ]
[
let my-work-partner (other teammembers with [ teamID = 2 and tasklink? ])
set interactwith (sentence interactwith [ who ] of my-work-partner)
]
end
to clear-taskwork
ask task-links [ die ]
ask members
[ set tasklink? false ]
end