1

I am fairly new to NetLogo.

I would like to create links between different turtles’ breeds and keep track of how many times each turtle of breed A links with any turtle of breed B. Let’s say breed A are patients and breed B are doctors that have their own practice. Patients directly link with the closest doctor (direct link). I want to have patients visit i.e. link with the same doctor several times (e.g. for a follow up appointments) and I want to be able to count how many times a specific patient visits each different doctor.

I know patches can display the number of times that turtles have visited it, but making a “practice a patch” would only tell me how many patients visited it, and not which patients’ visited it and how many times.

Is there any alternative or am I missing something?

Any help on this would be much appreciated.

snetlogo
  • 59
  • 5
  • 2
    Given your patient-doctor link a `n-visits` attribute and increment it upon each visit. – Alan Oct 04 '19 at 21:36
  • 1
    As Alan says, you need to create a variable that is owned by the links (using a `links-own` statement) that you can use to keep track of the number of visits. Alan suggested the name n-visits. You increment that variable each visit. – JenB Oct 05 '19 at 08:44

0 Answers0