Mandatory Part

Error Management

  • During the defense, as soon as you need help verifying a point, the student evaluated must help you.
  • If the language used is Python you must check the norm (use the flag if there's a norm error) pip install flake8 alias norminette_python=flake8 norminette_python "student's project directory"

Part 1 Environment/Board

Does the board resemble a game of Snake?
You can start a training session with a new model to verify.

Check the board rules:
• Board size: 10 by 10.
• Two green apples in a random cell.
• One red apple in a random cell.
• The snake starts with a length of 3 cells and randomly placed.
• If the snake hits a wall: Game over.
• If the snake collides with its own tail: Game over.
• The snake eats a green apple: increase snake's length by 1 and place a new green apple.
• The snake eats a red apple: decrease snake's length by 1 and place a new red apple.
• If the snake’s length drops to 0: Game over.
(Verify the main rules; some, like dying by eating only red apples, are difficult to test).

The board's speed should be appropriate for human observation.

Part 2 State

The agent's vision (snake's head) should be displayed on the terminal with each movement of your snake.

The student should be able to demonstrate in their code that only the vision of the snake's head is provided to the agent (the AI making decisions).
If more information than just the state is sent to the agent, you must set the "Forbidden function" flag.
You are encouraged to review the subject thoroughly to fully understand which data is expected.

Part 3 Action

The agent must make choices between (UP, LEFT, DOWN, RIGHT), and display the choice in the terminal.
The snake should move on the board accordingly.

Part 4 Rewards

The student should be able to show you a training session where the snake eats apples.
They should also be able to explain how the rewards work
and the points given for each type of action:

• Eating a green apple
• Eating a red apple
• Snake's death
• ...

Part 5 Q-learning

The student should be able to explain the Q-value and how they calculate it.
Only a Q-table or a Neural Network is allowed.
Use the "Forbidden function" tag/flag if any other model is used.
The implemented algorithm includes some random from time to time.

Features and structure

Control that the remaining features are implemented:

  • it is possible to train your model with a defined set of training sessions
  • it is possible to import and export models before and after a series of training sessions, and multiple models with various training levels exist in the repository.
  • it is possible to simply use a model without training it, for verification purposes
  • a session can be carefully studied using the step-by-step flag. Verify also that the suggested architecture is present, or eventually a more suitable and/or efficient one.

Testing trained models

Launch a few rounds with the best "backup" of the model (multiple ones are allowed, using
various parameters in the Q learning). Use the "non-training" switch, to keep the model
untouched.
Is the snake's length equal to or greater than 10 at the end of a session?
(The snake must have eaten 7 green apples, for example, without eating any red apples.)
This should happen more than 50% of the time with at least one model.


Bonus part

Evaluate the bonus part if, and only if, the mandatory part has been entirely and perfectly done. In case all the mandatory points were not passed during the defense, bonus points must be totally ignored.

Bonus Length test

Launch a few rounds with the best "backup" of the model.
You should award one point for every 5 units of length.
For example:
• < 15 = 0 point
• 15 <= x < 20 = 1 point
• 20 <= x < 25 = 2 point
• 25 <= x < 30 = 3 point
• 30 <= x < 35 = 4 point
• => 35 = 5 points (you can give the "Outstanding project" flag in case of success in this test)

Rate it from 0 (failed) through 5 (excellent)

Bonus Part 1

Is the board visually appealing, with starting and ending interfaces showing the score?

Bonus Part 2

If the board size is modified using the same model file,
the snake should be able to continue playing without issues.
If the snake cannot achieve a minimum length of 7 for a map size between 8x8 and 15x15 (not 10x10),
this bonus should not be accepted.

Ratings

Don’t forget to check the flag corresponding to the defense

Conclusion

Leave a comment on this evaluation ( 2048 chars max )