Моя модель имитирует движение автотранспорта на карте ГИС (растровый файл).Маршрут черепах основан на минимальном расстоянии между текущей позицией и целью.Как рассчитать минимальный маршрут с учетом неоднородности дорог?Я прилагаю изображение в качестве примера возникшей проблемы и процедуры расчета минимального расстояния.
Черепаха должна перейти от «А» к «В», но она висит на пятне, ближайшем к цели.как ворона летит.
to go
ask turtles [
direzione-turtles
face direzione ;aggiunto
ifelse next-patch != nobody
[
face next-patch
fd 1 ask patch-here [set done? true]]
[set other-choices neighbors with [strada > 0 and stato <= 4 ]
move-to one-of other-choices ;al posto di face
fd 1]]
tick
end
to-report next-patch
if direzione = casa and (member? patch-here [neighbors] of casa) [
set direzione ufficio
]
if direzione = ufficio and (member? patch-here [neighbors] of ufficio) [
set direzione casa
]
set choices neighbors with [done? = false and strada > 0 and stato >= 1 and stato <= 4]
set choice min-one-of choices [distance [direzione] of myself]
report choice
end