# 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.

## 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 (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