• Advertisement
Sign in to follow this  

Don't have enough windows for WHCA*

This topic is 1241 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

Currently, I am porting WHCA* to C++.

But I encounter a strange bug just because of my mistakes.

But I don't see where it happens.

 

First, in the function

void Coordinater::putUnitInWindow(ObjectBase *unit, int position)
{
     std::vector<ObjectBase*> unitsAtT;
     if (window.find(position) != window.end())
            unitsAtT = window.at(position);
                    
     // if not found in nodepool
     if (unitsAtT.empty())
     {
           unitsAtT.push_back(unit);                        
           window.insert(std::make_pair(position, unitsAtT));
                    
     }
     else {
           unitsAtT.push_back(unit);                        
     }
                    
 }

This produces 9 windows. But the depth must be set to at least 4. When I change it to a depth of 32.

9 windows just won't fit as time moves forward and each window only contains one agent

I should have 9 agents with at least 32 windows. Let me try to zip the file to this forum....

Thanks

Jack

Edited by lucky6969b

Share this post


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

  • Advertisement