Jump to content
  • Advertisement
Sign in to follow this  

Strange std::set comparator outcome.

This topic is 1091 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

From: TimeAStar 1 X: 34 Z 38 total_cost 31.7885 path_cost 2.475 estimated_cost 29.3135 Current Depth: 1
From: TimeAStar 2 X: 34 Z 50 total_cost 31.7885 path_cost 8.38229 estimated_cost 23.4062 Current Depth: 3

2.475+29.3135 = 31.7885

8.38229+23.4062 = 31.78849

#2 should have a higher rank than #1 What the heck is going on?




struct NodePoolComparator {

    bool operator()(const NodePoolNode& node1, const NodePoolNode& node2) const
        return std::tie(node1.total_cost, node1.estimated_cost, node1.m_time_dependent_id)
            < std::tie(node2.total_cost, node2.estimated_cost, node2.m_time_dependent_id);
Edited by lucky6969b

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!