19.12.2019 Views

syntax#1

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

112

1.2.2

following a path

procedure FollowPath :

;target node is first node of path

;calculate distance between bot and target node

;if bot is far from target node

;oriente / move bot towards target node

;if bot is near target node

;if target node is the end node

;the path is complete, set the FollowPath state to false, the Target to 0

;if the target node is another node (not the end node)

;set the next node of the path, as the target node

end of procedure

You should have a good idea on how a pathfinding / pathfollowing system, using AStar logic, works.

PART 2: the road structure / rules similarities with Astar

2.1

Road structure and similarities with AStar structure

on a road map, there are roads and intersections and accesses

in this case the nodes would be the intersections and the accesses, the links would

be the roads. The length of a link would correspond to the length of the road

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!