19.12.2019 Views

syntax#1

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

110

once the nodes are positioned (along a grid or

around obstacles / walls/ passages / corners), we

have to know, for each node, which others nodes it

can reach, and these will be the links.

the links can be created automatically by using a

procedure with raypicks from one node to another

node, and if the other node can be reached (not

obstructed by an obstacle / wall), a

link would be created, and have its length (from one

node to the other node) stored

each node will have its number of links +

corresponding links indexes stored

the map could have static obstacles or dynamic

obstacles (which can be moved, added, removed).

for dynamic obstacles, i have found that it is easier

to use nodes positioned along a grid, and activate /

deactivate some nodes and some links depending

on where the obstacle is (since when a node is

positioned along a grid, it is easy to do determine

which nodes / links need to be updated depending

on the moving obstacle position). but this is for

another article...

1.2

astar logic:

for the pathfinding / pathfollowing

system i propose to use these lists /

variables : (i am just going to explain the

structure / logic, i let you write the code

as you want)

bots

to store the origin of the bot (reference

of a pivot), to store the followpath state

(true or false), to store the target

(reference of a pivot)

temps

to store indexes temporarily

nodes

to store the origin of the node (reference

of a pivot), to store the active state of

each node (On or Off), the AS (ASTAR)

state of each node (Not, Discovered,

Processed), the discoveredfrom index (of

another node) from which this node has

been discovered, the reach length

(length from start node to this node, by

following a temporary path through

others nodes), the fly length (length

from this node to end node)

links

to store the count of links (to others

nodes) of this node, the active state of

each link (On or Off), the index (of

another node) linked to this node

paths

(one path for each bot)

to store the count of nodes in this path,

the indexes (of nodes) in this path, the

origin of the start node (reference of a

pivot), the origin of the end node

(reference of a pivot), the index of the

next node to target (in this path)

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

Saved successfully!

Ooh no, something went wrong!