I have created a small network consist of nodes which are connected through links. Some of the nodes are sources and some of the targets. I try to implement Random Walk algorithm.
I place walkers on source nodes, and walkers are moving randomly through the network. Now, I want to check walker reached to targets nodes, if all target nodes are visited by walker then ask walker to stop or die. I'm new to NetLogo and don't know how to implement this logic. Any help or guide will be appreciated.
One way to do this is to have your nodes know if they are a target, and if they have been visited. That way, if a turtle visits a node, that node can be marked as having been visited. Then, you can have a
stop
procedure at the end of your go procedure that checks if any nodes are still present that are a target but have not been visited. I have made slight modifications to the Link-Walking Turtles Example to show one way that you could do this- almost all the code below is directly pulled from that model.