1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Normalized GatherArmy evaluation.

This commit is contained in:
DJWarmonger 2017-06-16 21:14:24 +02:00
parent 9623f7caf3
commit 5e8fe083f2
2 changed files with 2 additions and 22 deletions

View File

@ -1,21 +0,0 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app

View File

@ -473,7 +473,8 @@ float FuzzyHelper::evaluate (Goals::GatherArmy & g)
//the more army we need, the more important goal
//the more army we lack, the less important goal
float army = g.hero->getArmyStrength();
return g.value / std::max(g.value - army, 1000.0f);
float ratio = g.value / std::max(g.value - army, 2000.0f); //2000 is about the value of hero recruited from tavern
return 5 * (ratio / (ratio + 2)); //so 50% army gives 2.5, asymptotic 5
}
float FuzzyHelper::evaluate (Goals::ClearWayTo & g)