Movement of turtles between nodes following the shortest path
I hope you are having a nice day.
I am stuck in developing my NetLogo code.
I am trying to move my citizens from one node (slocation) to another node
(new-location) calculating the shortest path.
I could only calculate the distance from slocation to new-location using set
total-expected-path [distance [slocation] of myself] of new-location.
However, I am pretty sure that the next following lines in blue are not
*How can I define this distance calculate in the total-expected-path as the
minimum between nodes using the link connection between nodes?*
*and after that, how can I move the turtles following this short path?*
I attached an image of my work in NetLogo. Any help will be very useful!
Thank you so much,
let counter ticks
if (counter = 2)
[set timekeeper 2]
if (timekeeper = 2)
if (sex = 0 and age = 1 and employment = 0 and household-size = 0
set slocation min-one-of nodes [distance myself]
let new-location min-one-of nodes [distance one-of workbuildings]
set total-expected-path [distance [slocation] of myself] of new-location
*ask min-one-of (citizens) [total-expected-path]*
*[ask [link-neighbors] of slocation*
*[let connection link-with slocation*
*let length-path [link-length] of connection]]*