This is a simple implementation of a Genetic Algorithm in C++. The algorithm optimizes a binary vector using basic genetic operators such as crossover and mutation.
Make sure you have a C++ compiler installed.
- Clone the repository:
- Compile the C++ code:
- Run the executable:
git clone https://github.com/bigoispj/C-Plus-Plus
g++ gen-alg.cpp -o gen-alg
./gen-alg
You can adjust the following parameters in the C++ code to customize the algorithm:
tamanhoPopulacao
: Population size (default: 100)tamanhoCromossomo
: Chromosome size (default: 20)taxaMutacao
: Mutation rate (default: 0.01)
This project is licensed under the MIT License - see the LICENSE file for details.
This code is a basic example and may be further developed for more complex applications. Feel free to contribute or use it as a starting point for your projects.