Skip to content

Commit

Permalink
feat: add test code in main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard-Prokhorikhin committed Apr 27, 2024
1 parent b4e8bad commit 22b514b
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
from src.agents.heuristic_trainer import train
from src.agents.geneticAlgAgentJon import GeneticAlgAgentJM

def test():
# algAgent = GeneticAlgAgentJM()
# algAgent.number_of_selection(2)
# print(algAgent.getBestPop())

board = Tetris()
agent = create_agent("heuristic")
manager = TetrisGameManager(board)
manager.startDemo(agent)

if __name__ == "__main__":

# game = Tetris()
Expand All @@ -25,16 +35,20 @@
# print(utility(boards, 0, -1, 0, 0, 0))
# boards.printBoard()

board = Tetris()
manager = TetrisGameManager(board)
agent = create_agent("heuristic")
# board = Tetris()
# manager = TetrisGameManager(board)
# agent = create_agent("heuristic")

# manager.startGame()
# # manager.startGame()

# train()
# # train()


algAgent = GeneticAlgAgentJM()
algAgent.number_of_selection(2)
print(algAgent.getBestPop())
# algAgent = GeneticAlgAgentJM()
# algAgent.number_of_selection(2)
# print(algAgent.getBestPop())

test()


# cProfile.run('main()', 'restats')

0 comments on commit 22b514b

Please sign in to comment.