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:
parent
9623f7caf3
commit
5e8fe083f2
21
AI/FuzzyLite/.gitignore
vendored
21
AI/FuzzyLite/.gitignore
vendored
@ -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
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user