Jump to content

A* concept


Joseph

Recommended Posts

if you are confused feel free to ask question

 

i was writing down notes while watching an A* algor


Open list =  checking nodes
close list = checked nodes (checked node, current node)

get current node
add all adjacent to open list

H, G , F: <---- COST
(F = G + H)

[MOVING COST (rethink this)
diagnal = 14G
straight = 10G
] 

F gets added into the closed list. (F < #)
G = movement cost (distance from current node, to the adjacent node).
H = distance from target node 

calculate the H, G, F cost,
and give it a parent node (prev node)

then look for an adjacent nodes again,
add none repeatting nodes to open list.

compare: (youtube)
     if (parent g + current G < parent new G) { 
        add new node to closed list, new block parent = prev block parent
     }

(my idea):
Grand parent, parent, son

if (grand parent already has son in open list before the parent was looking)	{
     calculation the distance.
if (son has the less g cost then, the grand parent and parent g cost together)	{
     add son to closed list, add grand parent as the new parent
     try to remove the initial parent. (you could keep)
}}

stop algor once target node is in the closed list
retrace steps and use the prev node and add it into a list. 
reverse it to have a normal path

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...