Fuzzy.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "../FuzzyLite/FuzzyLite.h"
  2. /*
  3. * Fuzzy.h, part of VCMI engine
  4. *
  5. * Authors: listed in file AUTHORS in main folder
  6. *
  7. * License: GNU General Public License v2.0 or later
  8. * Full text of license available in license.txt file, in main folder
  9. *
  10. */
  11. class VCAI;
  12. class CArmedInstance;
  13. class FuzzyHelper
  14. {
  15. friend class VCAI;
  16. fl::FuzzyEngine engine;
  17. fl::InputLVar* bankInput;
  18. fl::OutputLVar* bankDanger;
  19. fl::RuleBlock bankBlock;
  20. fl::InputLVar * ourWalkers, * ourShooters, * ourFlyers, * enemyWalkers, * enemyShooters, * enemyFlyers;
  21. fl::InputLVar * ourSpeed, * enemySpeed;
  22. fl::InputLVar * bankPresent;
  23. fl::InputLVar * castleWalls;
  24. fl::OutputLVar * threat;
  25. fl::RuleBlock tacticalAdvantage;
  26. public:
  27. enum RuleBlocks {BANK_DANGER, TACTICAL_ADVANTAGE};
  28. FuzzyHelper();
  29. void initBank();
  30. void initTacticalAdvantage();
  31. ui64 estimateBankDanger (int ID);
  32. float getTacticalAdvantage (const CArmedInstance *we, const CArmedInstance *enemy); //returns factor how many times enemy is stronger than us
  33. };