Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to MAP over agentset?

I need to iterate over a specific agentset of patches and get the neighbors of them all and then join those...

I'd do something like

reduce patch-set (map [patch-set neighbors self] patches with [somecondition?]) 

But MAP and REDUCE won't work on agentsets!

like image 731
Alejandro Navas Avatar asked Oct 25 '25 15:10

Alejandro Navas


1 Answers

The normal idea of a map does not really make sense for a set, but you can produce a list with of, and then convert it to a patch set.

let _nbrs patch-set [neighbors] of mypatches

You filter either mypatches or _nbrs with with on any condition you wish.

like image 140
Alan Avatar answered Oct 28 '25 05:10

Alan