2
0

AIPriorities.h 948 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef AIP_H
  2. #define AIP_H
  3. #include <string>
  4. #include "CGeniusAI.h"
  5. #include "neuralNetwork.h"
  6. namespace geniusai {
  7. class Network
  8. {
  9. public:
  10. Network();
  11. Network(vector<unsigned int> whichFeatures);// random network
  12. Network(istream & input);
  13. vector<unsigned int> whichFeatures;
  14. float feedForward(const vector<float> & stateFeatures);
  15. neuralNetwork net; //a network with whichFeatures.size() inputs, and 1 output
  16. };
  17. class Priorities
  18. {
  19. public:
  20. Priorities(const string & filename); //read brain from file
  21. vector<float> stateFeatures;
  22. int specialFeaturesStart;
  23. int numSpecialFeatures;
  24. void fillFeatures(const CGeniusAI::HypotheticalGameState & AI);
  25. float getValue(const CGeniusAI::AIObjective & obj);
  26. float getCost(vector<int> &resourceCosts,const CGHeroInstance * moved,int distOutOfTheWay);
  27. vector<vector<Network> > objectNetworks;
  28. vector<map<int,Network> > buildingNetworks;
  29. };
  30. }
  31. #endif