Fuzzy.h 1.0 KB

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