#ifndef BOTINTERFACE_HPP #define BOTINTERFACE_HPP #include "common.hpp" #include #include class AISnake { public: std::stack path; AISnake(); void GetNewPath(const sf::Vector2f& source); PlayerDirection GetInput(const sf::Vector2f* source); void UpdateProbability(int snakeSize); void AdjustProbability(double amount); void AddIteration(const int size); void ResetPath(void); int amountPlayed = 0; private: int totalLength = 0; double average = 0; double probabilityBFS = 0.800; bool pathFailed = false; // Generic search algorithms std::stack botPathUnsanitized; void BFS(const sf::Vector2f& source); void DFS(const sf::Vector2f& source); sf::Vector2f GetAnyOpenPath(const sf::Vector2f& source); void UnvisitBoard(void); void UpdateAverage(const int size); void TrimPath(void); void EmptyPath(void); // Unsupervised learning // Make decisions about current state of board double probabilityUp = 0.25; double probabilityDown = 0.25; double probabilityLeft = 0.25; double probabilityRight = 0.25; PlayerDirection CurrentBestDecision(void); void CheckLocalFreedom(void); void CheckFoodDirection(void); void RemoveImpossibleChoice(void); }; #endif