Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Strange std::set comparator outcome.

This topic is 1003 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?

Thanks

Jack 

 

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!