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,

Sara

to go
set-timekeeper
find-day-activities
end

to set-timekeeper
tick ;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 AM
  if (counter = 2) [set timekeeper 2] ;From 7:00 AM to 9:00 AM
  if (counter = 3) [set timekeeper 3] ;From 9:00 AM to 13:00 PM
  if (counter = 4) [set timekeeper 4] ;From 13:00 AM to 14:30 PM
  if (counter = 5) [set timekeeper 5] ;From 14:30 AM to 17:00 PM
  if (counter = 6) [set timekeeper 6] ;From 17:00 AM to 20:30 PM
  if (counter = 7) [set timekeeper 7] ;After 20:30 PM
end

to find-day-activities
if (timekeeper = 2) [Do_7AM_9AM]
end

to Do_7AM_9AM
ask citizens 
[start-movement]
if (sex = 0 and age = 1 and employment = 0 and household-size = 0) 
[move-work]
end
   
to start-movement
ask citizens
[let nearest-node min-one-of nodes [distance myself]
set slocation nearest-node
move-to slocation]
end

to move-work
ask 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-location
set 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-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to