2009-08-18 10:37:45 +03:00
|
|
|
#ifndef AIP_H
|
|
|
|
#define AIP_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "CGeniusAI.h"
|
|
|
|
#include "neuralNetwork.h"
|
|
|
|
|
2009-10-23 01:04:42 +03:00
|
|
|
namespace geniusai {
|
2009-08-18 10:37:45 +03:00
|
|
|
|
|
|
|
class Network
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Network();
|
|
|
|
Network(vector<unsigned int> whichFeatures);// random network
|
|
|
|
Network(istream & input);
|
|
|
|
vector<unsigned int> whichFeatures;
|
|
|
|
float feedForward(const vector<float> & stateFeatures);
|
|
|
|
neuralNetwork net; //a network with whichFeatures.size() inputs, and 1 output
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Priorities
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Priorities(const string & filename); //read brain from file
|
|
|
|
|
|
|
|
|
|
|
|
vector<float> stateFeatures;
|
|
|
|
int specialFeaturesStart;
|
|
|
|
int numSpecialFeatures;
|
|
|
|
void fillFeatures(const CGeniusAI::HypotheticalGameState & AI);
|
|
|
|
float getValue(const CGeniusAI::AIObjective & obj);
|
|
|
|
float getCost(vector<int> &resourceCosts,const CGHeroInstance * moved,int distOutOfTheWay);
|
2009-08-19 13:18:14 +03:00
|
|
|
vector<vector<Network> > objectNetworks;
|
2009-08-21 21:18:52 +03:00
|
|
|
vector<map<int,Network> > buildingNetworks;
|
2009-08-18 10:37:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|