Netlogo shopping simulation: Oscillation problem

17 views
Skip to first unread message

Bo van Sterkenburg

unread,
Jul 17, 2024, 12:22:55 PM (5 days ago) Jul 17
to netlogo-users
Hi,

I am creating a simulation system for shopping areas in Netlogo and I currently have a major problem I would like to fix in a realistic way. I have a square-like road structure with shops neighboring these streets. When a turtle is in the middle of a street and it targets a store that is in a street below the current street, the turtle will oscillate between 3 patches as he tries to go to the shop through the shops, but this is not allowed as it can only move onto the street patches. The path of the turtle is determined when he leaves the previously visited store. 

Does anyone have suggestions on how to prevent this from happening or how to make determine a turtle is stuck oscillating and fix it when this has been spotted?

I want to solve this problem in a realistic way. So moving the turtle a couple of patches is not possible unfortunately.

I am open to any suggestions and would like to show more in a meeting perhaps!

Kind regards,



Steve Scott

unread,
Jul 18, 2024, 1:09:06 PM (4 days ago) Jul 18
to vansterk...@gmail.com, netlogo-users

What I would do is designate a target store as a destination, and then find the shortest path.  Djikstra's algorithm to find the nearest path to that store, but you could probably implement a naive approach as you are on a grid. You could also have it turn toward the nearest cross street, then turn towards the destination  and snap north or South, go up to the cross Street, turn toward the destination and snap east or west and go to the next store. Because you have a grid you will have to do some way finding.

Is the turtle having trouble leaving the store?

When I get occultations it is often because the destination is dynamic (like "nearest") rather than set once and saved until the turtle reaches the destination.


--
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/ffdee2dc-e7ec-4ab2-b0ba-c67c53947e82n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages