Fuzzy.h 1.3 KB

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