2012-07-01 02:48:40 +03:00
|
|
|
#pragma once
|
2012-03-05 16:31:59 +03:00
|
|
|
#include "../FuzzyLite/FuzzyLite.h"
|
2012-03-03 13:08:01 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Fuzzy.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
class VCAI;
|
2012-03-04 13:43:46 +03:00
|
|
|
class CArmedInstance;
|
2012-03-03 13:08:01 +03:00
|
|
|
|
|
|
|
class FuzzyHelper
|
|
|
|
{
|
|
|
|
friend class VCAI;
|
|
|
|
|
|
|
|
fl::FuzzyEngine engine;
|
2012-03-04 13:43:46 +03:00
|
|
|
|
2012-03-03 13:08:01 +03:00
|
|
|
fl::InputLVar* bankInput;
|
|
|
|
fl::OutputLVar* bankDanger;
|
2012-03-04 13:43:46 +03:00
|
|
|
fl::RuleBlock bankBlock;
|
|
|
|
|
|
|
|
fl::InputLVar * ourWalkers, * ourShooters, * ourFlyers, * enemyWalkers, * enemyShooters, * enemyFlyers;
|
|
|
|
fl::InputLVar * ourSpeed, * enemySpeed;
|
|
|
|
fl::InputLVar * bankPresent;
|
|
|
|
fl::InputLVar * castleWalls;
|
|
|
|
fl::OutputLVar * threat;
|
|
|
|
fl::RuleBlock tacticalAdvantage;
|
2012-03-03 13:08:01 +03:00
|
|
|
|
|
|
|
public:
|
2012-03-04 13:43:46 +03:00
|
|
|
enum RuleBlocks {BANK_DANGER, TACTICAL_ADVANTAGE};
|
|
|
|
|
2012-03-03 13:08:01 +03:00
|
|
|
FuzzyHelper();
|
2012-03-04 13:43:46 +03:00
|
|
|
void initBank();
|
|
|
|
void initTacticalAdvantage();
|
|
|
|
|
2012-03-03 13:08:01 +03:00
|
|
|
ui64 estimateBankDanger (int ID);
|
2012-03-04 13:43:46 +03:00
|
|
|
float getTacticalAdvantage (const CArmedInstance *we, const CArmedInstance *enemy); //returns factor how many times enemy is stronger than us
|
2012-03-05 16:31:59 +03:00
|
|
|
};
|