2021-05-15 18:23:38 +02:00
|
|
|
/*
|
2021-05-15 21:04:26 +02:00
|
|
|
* PriorityEvaluator.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
|
|
|
|
*
|
2021-05-15 18:23:38 +02:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "fl/Headers.h"
|
|
|
|
#include "../Goals/Goals.h"
|
|
|
|
|
2021-05-16 13:15:03 +02:00
|
|
|
class IEvaluationContextBuilder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual Goals::EvaluationContext buildEvaluationContext(Goals::TSubgoal goal) const = 0;
|
|
|
|
};
|
2021-05-15 18:23:38 +02:00
|
|
|
|
2021-05-15 21:02:27 +02:00
|
|
|
class PriorityEvaluator
|
2021-05-15 18:23:38 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
PriorityEvaluator();
|
|
|
|
~PriorityEvaluator();
|
|
|
|
void initVisitTile();
|
|
|
|
|
|
|
|
float evaluate(Goals::TSubgoal task);
|
|
|
|
|
|
|
|
private:
|
2021-05-15 21:02:27 +02:00
|
|
|
fl::Engine * engine;
|
2021-05-15 18:23:38 +02:00
|
|
|
fl::InputVariable * armyLossPersentageVariable;
|
2021-05-15 21:02:27 +02:00
|
|
|
fl::InputVariable * heroRoleVariable;
|
2021-05-16 13:14:07 +02:00
|
|
|
fl::InputVariable * mainTurnDistanceVariable;
|
|
|
|
fl::InputVariable * scoutTurnDistanceVariable;
|
2021-05-16 13:19:00 +02:00
|
|
|
fl::InputVariable * turnVariable;
|
2021-05-15 18:23:38 +02:00
|
|
|
fl::InputVariable * goldRewardVariable;
|
|
|
|
fl::InputVariable * armyRewardVariable;
|
2021-05-15 20:57:40 +02:00
|
|
|
fl::InputVariable * dangerVariable;
|
2021-05-15 21:02:27 +02:00
|
|
|
fl::InputVariable * skillRewardVariable;
|
2021-05-16 13:13:35 +02:00
|
|
|
fl::InputVariable * strategicalValueVariable;
|
2021-05-15 21:02:27 +02:00
|
|
|
fl::InputVariable * rewardTypeVariable;
|
|
|
|
fl::InputVariable * closestHeroRatioVariable;
|
2021-05-16 13:19:00 +02:00
|
|
|
fl::InputVariable * goldPreasureVariable;
|
|
|
|
fl::InputVariable * goldCostVariable;
|
2021-05-15 18:23:38 +02:00
|
|
|
fl::OutputVariable * value;
|
2021-05-16 13:15:03 +02:00
|
|
|
std::map<Goals::EGoals, std::shared_ptr<IEvaluationContextBuilder>> evaluationContextBuilders;
|
|
|
|
|
|
|
|
Goals::EvaluationContext buildEvaluationContext(Goals::TSubgoal goal) const;
|
2021-05-15 18:23:38 +02:00
|
|
|
};
|