We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm a beginner at coding, creating a boids model to simulate parasitized and un-parasitized sheep, aiming to predict the prevalence level at which we can detect parasitized sheep from their position in the flock.
I need to measure the mean distance of my two classes of boids from the flock centroid and record this via saveTable. I've found some instructions for how to do that in Nature of Code and on stackoverflow, but what happens when the flock splits in two or more clusters?
The splitting into clusters is realistic, so I don't want to adjust the flocking to prevent it at all, but it complicates how to measure the mean distance from the flock centroid.
Since the proportion of parasitized class to non-parasitized class will vary, my results could be due to the higher probability of the minority class happening to go with the the majority class by chance rather than because of the different weighting values I input on each class's flocking interaction rules.
There is a 'neighbourhood' variable in the model I'm modifying, representing the organisms' limited sensory fields, so perhaps I could use that rather than the simple flock centroid? Any hints how please?
Thanks v much!