1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00
vcmi/AI/GeniusAI/AIPriorities.h
beegee1 7f04ed990b Major refactoring. First part: BattleInterface
Introduction of pre compiled headers,...
2011-12-13 21:23:17 +00:00

36 lines
894 B
C++

#pragma once
#include "CGeniusAI.h"
#include "neuralNetwork.h"
namespace geniusai {
class Network
{
public:
Network();
Network(vector<ui32> whichFeatures);// random network
Network(istream & input);
vector<ui32> whichFeatures;
double feedForward(const vector<double> & stateFeatures);
neuralNetwork net; //a network with whichFeatures.size() inputs, and 1 output
};
class Priorities
{
public:
Priorities(const string & filename); //read brain from file
vector<double> stateFeatures;
int specialFeaturesStart;
int numSpecialFeatures;
void fillFeatures(const CGeniusAI::HypotheticalGameState & AI);
double getValue(const CGeniusAI::AIObjective & obj);
double getCost(vector<int> &resourceCosts,const CGHeroInstance * moved,int distOutOfTheWay);
vector<vector<Network> > objectNetworks;
vector<map<int,Network> > buildingNetworks;
};
}