I'm loading animal data with a lot of duplicates which I'm trying to merge into one agent representing a single animal. The csv file looks like this:
Animal ID - Group ID
1 - A
2 - A
3 - A
4 - A
1 - B
2 - B
And for this example, i'm hoping to produce 4 unique animal agents that have a list of the groups they are associated with. Animal 1's list would be [A, B] and Animal 4's list would be just [A].
So far, I'm loading the csv using:
csv:from-row file-read-line
create-animal 1 [
set Animal-ID item 0 data
set group-ID item 1 data]
Which produces 6 animals with one group id each.
But how should I cull the duplicate animals?
