1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Nullkiller: disable decomosition for now. Very slow

This commit is contained in:
Andrii Danylchenko
2021-05-16 14:44:48 +03:00
committed by Andrii Danylchenko
parent cebb5b296b
commit c7d35dcc6f

View File

@ -45,9 +45,10 @@ Goals::TTask Nullkiller::choseBestTask(Goals::TSubgoal behavior) const
{ {
logAi->debug("Checking behavior %s", behavior->toString()); logAi->debug("Checking behavior %s", behavior->toString());
const int MAX_DEPTH = 10; const int MAX_DEPTH = 0;
Goals::TGoalVec goals[MAX_DEPTH + 1]; Goals::TGoalVec goals[MAX_DEPTH + 1];
Goals::TTaskVec tasks; Goals::TTaskVec tasks;
std::map<Goals::TSubgoal, Goals::TSubgoal> decompositionMap;
goals[0] = {behavior}; goals[0] = {behavior};
@ -66,7 +67,10 @@ Goals::TTask Nullkiller::choseBestTask(Goals::TSubgoal behavior) const
logAi->trace("Found %d goals", subgoals.size()); logAi->trace("Found %d goals", subgoals.size());
#endif #endif
if(depth < MAX_DEPTH)
{
goals[depth + 1].clear(); goals[depth + 1].clear();
}
for(auto subgoal : subgoals) for(auto subgoal : subgoals)
{ {
@ -83,7 +87,7 @@ Goals::TTask Nullkiller::choseBestTask(Goals::TSubgoal behavior) const
tasks.push_back(task); tasks.push_back(task);
} }
else else if(depth < MAX_DEPTH)
{ {
#if AI_TRACE_LEVEL >= 1 #if AI_TRACE_LEVEL >= 1
logAi->trace("Found abstract goal %s", subgoal->toString()); logAi->trace("Found abstract goal %s", subgoal->toString());
@ -92,7 +96,7 @@ Goals::TTask Nullkiller::choseBestTask(Goals::TSubgoal behavior) const
} }
} }
if(goals[depth + 1].size() && depth < MAX_DEPTH) if(depth < MAX_DEPTH && goals[depth + 1].size())
{ {
depth++; depth++;
} }