Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 1.32 KB

README.md

File metadata and controls

15 lines (9 loc) · 1.32 KB

Genetic Algorithm Project

Small project for the "Fundamentals of AI" course at Politecnico di Milano.

Contents

The project consists of the following files:

  • Report.pdf (In italian): This document provides an overview of the project, explaining the code implemented in mastermind.cpp and the concepts of genetic algorithms. It also presents the application by hand of a genetic algorithm to optimize the parameters of mastermind.cpp.
  • mastermind.cpp: This C++ file contains the implementation of the game of Mastermind, which utilizes a genetic algorithm to solve itself. It prints out the number of generations required to find the correct solution.

Project Scope

The main objective of this project was to gain an understanding of genetic algorithms and their application. The mastermind.cpp file serves as a self-solving version of the game of Mastermind, providing the number of generations required for convergence.

In the report.pdf file, a genetic algorithm was manually applied to optimize the parameters used in mastermind.cpp. This optimization process involved adjusting variables such as the probability of mutation, type of crossover, type of fitness function and so on. The number of generations taken by mastermind.cpp served as the fitness function for the genetic algorithm described in the report.