Skip to content
Thibault Serti edited this page Sep 14, 2019 · 9 revisions

Welcome to the AwAI wiki! The AwAI project is an implementation of the awale game (Abapapa version). It's goal is to be an application that's will be deployed on web platform. We focus here on the IA part and our goal is to create several versions of IAs that will be able to fight each other. For now, we implemented a classical IA based on the minimax algorithm and we implemented the alpha beta IA.

The code has to be understood as three distinct part :

Get started

you can try :

from tests import *
t = Test("alea", "alea", 10)
t.run()
print(t.stat)

if you want to test parallelization you can try

from tests import *
t = Test("alea", "alea", 10)
t.run_on_all_cores()
print(t.stat)

To test the game with the GUI :

python3 main.py

How to add AIs to the code

  1. Create a new file src/AIs/myAI.py and a new class in that file
  2. Add a condition in the player.py file, in AI class init method to match the name of your AI
  3. Add your AI to the algo_available list (in engine.py)

How to add gains to minimax or alphabeta

  1. Open the right file (minimax.py or alphabeta.py)
  2. Write the gain as a method of the class
  3. Update gain and make sure that the variable you use are in the right scope
  4. Make sure that the list list_coeff_gain is of the right size (for now you have to modify manually the list in the file player.py, but in the future it will be automatically recalculated by the genetic algorithm.)
Clone this wiki locally