Your usage of nw:maximal-cliques
is not quite correct.
I think that what you are trying to express by specifying of turtles with [guild = g]
is something like "taking into account only the turtles that are part of guild g", but what it actually means to NetLogo is "run the reporter that precedes of
for each turtle that are part of guild g and make a list out of that". (Just like, e.g., [color] of turtles
will run the [color]
reporter block once for each turtle and build a list of colors with the results.)
nw:maximal-cliques
is a primitive that operates on the whole network, so you don't want to run it once for each turtle. And just like most primitives in the nw
extension, you need to tell it which turtles and links to operate on by using the nw:set-snapshot
primitive.
I think you can achieve what you want by simply doing:
nw:set-snapshot (turtles with [guild = g]) links
let lista-cliques nw:maximal-cliques
(Note that nw:set-snapshot
takes a static "picture" of your network on which further calls to nw
primitives operate. If something changes in your network, you need to call nw:set-snapshot
to take a new picture. This will probably change in a future version of the extension.)