Using the "values-from" primitive

55 views
Skip to first unread message

Michèle Grindat

unread,
Aug 9, 2022, 11:51:30 AM8/9/22
to netlogo-users
Hello NetLogo community,
I'm trying to create a list out of a patch variable. Each patch has a variable called "households " which contains the number of households on this patch. I would like to have these numbers as a list, e.g with a world of 8 patches it would be something like [ 0 4 3 5 1 0 0 2 ]. My google research lead me to the Primitives Dictionary where it says I could use the "values-from" primitive. But when I tried to implement it in my code (using NetLogo version 6.2.2.) it doesn't recognize it as a primitive. Does the primitive only exist in older versions of NetLogo and if so, does anyone know an alternative to the "values-from" primitive with which I can store patch variables in a list?

Thanks in advance!
Michèle

Jeremy Baker

unread,
Aug 9, 2022, 12:22:53 PM8/9/22
to Michèle Grindat, netlogo-users
Hey Michèle,

The `values-from` primitive was replaced with `of` in NetLogo 4.0.  You can read more about it in the transition guide:  http://ccl.northwestern.edu/netlogo/docs/transition.html#new-of-syntax


-Jeremy


From: netlog...@googlegroups.com <netlog...@googlegroups.com> on behalf of Michèle Grindat <shang...@gmail.com>
Sent: Tuesday, August 9, 2022 7:34 AM
To: netlogo-users <netlog...@googlegroups.com>
Subject: [netlogo-users] Using the "values-from" primitive
 
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/263ed8c8-bf19-4a95-933f-9c4a99e81f3fn%40googlegroups.com.

Michèle Grindat

unread,
Aug 15, 2022, 11:56:55 AM8/15/22
to netlogo-users

Hey Jeremy

Thank you very much for the information! I was able to solve my problem with the "of" primitive. 

Greetings
Michèle
Reply all
Reply to author
Forward
0 new messages