Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Making agents in agentset move one by one and not simultaneously

32 views
Skip to first unread message

Beruchya Dao-Bai

unread,
Oct 24, 2024, 11:29:20 AM10/24/24
to netlogo-users
Hello, 

I hope you are well. I am new to Netlogo and I am trying to get more information on a model I'm putting together. I have two breeds: movers and houses.
1. I would like to  make sure each mover (imported from a GIS point layer with 100+ points) goes to a house, not simultaneously but, one by one, in order, based on a field called [group] in the dataset.
2. I am also trying to make sure that each mover changes color one at a time when it moves to the house location
-I also integrated the time extension
3. Once the movers get to the house they should not move to another house

The issue is that all agents are moving all at once and changing colors all at once. So the move-to command repeats and keeps the movers moving from house to house until the end of the simulation period. The ideal scenario would be that each agent would move and change color one by one and not move again until the end of the simulation time, so that the individual moves would be completed by the simulation end time. 

Please find below the code I attempted:


to go

ask movers [foreach sort-on [group] movers
[the-mover -> ask the-mover [move-to one-of houses]

set color blue]

;one mover moves to one house one at a time and changes to the color blue

if time:is-after? sim-time sim-end-time

[stop]

update-time-variables

tick

end


Thanks, I look forward to your feedback.

Best,

Beruchya

Wade Schuette

unread,
Oct 24, 2024, 1:14:04 PM10/24/24
to Beruchya Dao-Bai, netlogo-users
Oh,  also,  nothing in that code automatically guarantees that the mover won't go to a house that is already occupied.


On Thu, Oct 24, 2024 at 12:11 PM Wade Schuette <wade.s...@gmail.com> wrote:
I have to try it but i think you can remove the first "ask movers [" as you already are asking the movers to move.
Wade

--
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 visit https://groups.google.com/d/msgid/netlogo-users/2a0d0d0d-29b7-4b54-ac82-d0ba9ebe2fb5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages