Alternatives for std::heap?

Started by
2 comments, last by Eric F. 7 years, 8 months ago

Hi all,

I am currently converting the JPS pathfinding code from C++ to Delphi and the code I'm converting uses the std::heap to manage the open node list.

Now, I never used the heap before and I was wondering what structure in Delphi I could use in its place or if there was a heap class for Delphi anyone had already done.

My knowledge of the STD is kinda abysmal as I usually never need to use it in my daily work, so any help on this would be met with untold gratitudes ;)

Thanks!

Advertisement
The main thing you get from a heap structure in A* implementations is typically a priority queue of sorts; a google search for "delphi priority queue" turns up a few options for libraries that offer this functionality.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I am sure what ApochPiQ said is right. Also, if you learn how a priority queue is implemented, you'll realize that std::heap is basically std::vector with some different interface thrown on top. You could very well reproduce that in Delphi.

Ah, indeed!

Thanks to you both. "Priority queue" lead me in the right direction and I now have it working. Now to test it and continue on my merry way!

:D

This topic is closed to new replies.

Advertisement