2012-07-01 02:48:40 +03:00
|
|
|
#pragma once
|
2012-03-05 16:31:59 +03:00
|
|
|
#include "../FuzzyLite/FuzzyLite.h"
|
2013-11-25 14:55:48 +03:00
|
|
|
#include "Goals.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;
|
2013-11-24 11:21:51 +03:00
|
|
|
//class TSubgoal;
|
|
|
|
//class TGoalVec;
|
|
|
|
//class AbstractGoal;
|
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
|
2013-11-24 11:21:51 +03:00
|
|
|
|
2013-11-25 14:55:48 +03:00
|
|
|
Goals::TSubgoal chooseSolution (Goals::TGoalVec & vec);
|
2013-11-24 11:21:51 +03:00
|
|
|
//shared_ptr<AbstractGoal> chooseSolution (std::vector<shared_ptr<AbstractGoal>> & vec);
|
2012-03-05 16:31:59 +03:00
|
|
|
};
|