I have looked here: Example code Description
NetLogo project with vector map data
I am using vector map where is roads. Then i draw links where road is. In image where starting point is, that is capital city (Riga) of Latvia. To left side is city Ventspils, witch is about 200 kilometers from Riga. to top is Latvia/Estonia border and also about 200 km. To bottom is about 100 km.
What i want is calculate where i need to place electricity charging station for cars. With average green car can drive 50 kilometers with full battery. So. I know that to Ventspils is about 200 km. We need 4 charging stations on that road.
Idea No 1 is just after every 50 kilometrs to all directions from starting point place charging station. (tree symbols on picture). At this moment charging stations (trees) i am placing at random location:
to setup-stacijas
set-default-shape boats "tree"
create-boats num-boats [
set speed 0 ; min-speed + random-float (max-speed - min-speed)
let l one-of links
set size 18
set-next-stacija-link l [end1] of l
]
end
to set-next-stacija-link [l n] ;; boat proc
set cur-link l
move-to n
ifelse n = [end1] of l [set to-node [end2] of l] [set to-node [end1] of l]
face to-node
end
Questions:
How i can calculate distance xx kilometers to all directions?

An AGENT (a patch or a turtle) can use the DISTANCE primitive along with the MOD operator to find other AGENTS that are multiples of 50 “miles” away.
I assume that 1 patch = 1 mile in our simulation.
I assume that the “links” are connected to turtles of breed “node”.
I assume that START is a variable that contains a “node”.
This isn’t perfect for many reasons.
Some other iterative methods suggest themselves:
Setting “travelers” on the roads to “drop” charging stations every 50 (or so) miles.
In this way, stations will be placed all along all roads.
Fill the patches with stations, in a hex-grid, 25 or something miles in radius. Let them migrate.
This might actually work.
Overfil with stations, then destroy until there is only just enough
That one probably is not optimal.
Simulate cars on your roads–create stations where they die.
Eventually, stations will pop-up where they are needed. This one will be fun to watch.
~~James