Hi Sara,
It’s awesome that you’re working in NetLogo. However, this list is reserved for discussing technical matters regarding how NetLogo’s build and operations. For modeling questions, the best resources are the netlogo-users Yahoo group and/or asking a question on Stackoverflow.
As a quick answer though: the problem is that this line isn’t being run in a turtle context: if (sex = 0 and age = 1 and employment = 0 and household-size = 0) [move-work], since I assume sex and age are citizen variables. But simply putting those in the ask citizens won’t work since move-work already ask citizens, so you’d get all citizens asking all citizens to do stuff, which you obviously don’t want. So, instead of putting ask citizens in Do_7AM_9AM, start-movement, or move-work, I recommend changing your go procedure to do ask citizens [ find-day-activities ].
Best,
Bryan
Hi,--I am working on a model in NetLogo to move citizens around a city to different places in different schedules. I just starting and I am trying to move the citizens which particular characteristics to a patch grey (that represents a work area). However, I have a problem with the find-day-activities command. The error is the following: You can not use find-day-activities in observer context, because find-day-activities is turtles only.I already checked on internet solutions and I know it is related to the context, for this reason, I included ask citizens command to Do_7AM_9AM, start-movement and move-work to move from turtle context to observer context but the error persists.Here is my code, someone could help me?Thank you in advance,Sarato goset-timekeeperfind-day-activitiesendto set-timekeepertick ;Advances the tick counter by one and updates all plots.let counter ticks ;Reports the current value of the tick counter.if (counter = 1) [set timekeeper 1] ;Before 7:00 AMif (counter = 2) [set timekeeper 2] ;From 7:00 AM to 9:00 AMif (counter = 3) [set timekeeper 3] ;From 9:00 AM to 13:00 PMif (counter = 4) [set timekeeper 4] ;From 13:00 AM to 14:30 PMif (counter = 5) [set timekeeper 5] ;From 14:30 AM to 17:00 PMif (counter = 6) [set timekeeper 6] ;From 17:00 AM to 20:30 PMif (counter = 7) [set timekeeper 7] ;After 20:30 PMendto find-day-activitiesif (timekeeper = 2) [Do_7AM_9AM]endto Do_7AM_9AMask citizens[start-movement]if (sex = 0 and age = 1 and employment = 0 and household-size = 0) [move-work]endto start-movementask citizens[let nearest-node min-one-of nodes [distance myself]set slocation nearest-nodemove-to slocation]endto move-workask citizens[let work-patches (patch-set patches with [pcolor = grey])let new-location one-of [link-neighbors] of (patch-set patches with [pcolor = grey])move-to new-locationset slocation new-location]end
You received this message because you are subscribed to the Google Groups "netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.