Skip to content

Jon-Robb/genetic_algorithm

Repository files navigation

This project was init from this project(private) as part of the amazing JAAT team : Cryptoblivious, Alexis Provost and Thomas Pelletier

Genetic Algorithm

A program that uses a genetic algorithm to find the best solution to a given problem.

Table of Contents
  1. About The Project
  2. Usage
  3. Contact

About The Project

Genetic Algorithm Program Overview:

In our genetic algorithm program, a range of functionalities empowers users to direct evolutionary simulations with precision. Users possess the capability to initiate, pause, and terminate simulations at will, affording full control over the optimization process. Furthermore, users may specify crucial simulation parameters, encompassing the number of epochs, population size, elitism rate, selection rate, and mutation rate, thus customizing the algorithm's behavior to suit the demands of specific optimization tasks. The program offers multiple mutation strategies, promoting adaptability. A textual interface allows real-time tracking of simulation progress, while a graphical component provides a visual representation of evolutionary developments.

Problem 1: Maximizing Box Volume through Corner Folding:

A central problem addressed by our genetic algorithm is the quest for optimal corner folding of a box to maximize internal volume. This intricate challenge necessitates the exploration of diverse corner folding configurations to identify the arrangement that maximizes spatial utilization. The algorithm systematically explores the manifold possibilities of corner manipulation, considering the initial box configuration and the feasibility of folding. Via iterative evolution, it converges toward the most optimal folding arrangement, rendering valuable solutions for spatial optimization and box design dilemmas.

Problem 2: Shape Fitting within Obstacle-Laden Canvases:

Another significant problem addressed by our genetic algorithm involves the fitting of shapes within a canvas marked by obstacles. Users retain the capacity to specify the number of obstacles present on the canvas, ranging from none to a hundred, and select the shape to be fitted, with options including a rectangle, triangle, or the complex Pokémon Porygon shape. The algorithm confronts this challenge by iteratively adjusting the position and orientation of the chosen shape, while adhering to the boundaries defined by obstacles. The objective here is to maximize the coverage of the canvas while respecting the presence of obstacles, thereby offering a pertinent solution for a spectrum of spatial planning scenarios.

Problem 3: Image Cloning with Gradual Canvas Replication:

The final application within our program entails image cloning. Users are afforded the opportunity to select an image from a predefined set, instigating a process wherein the canvas incrementally replicates the chosen image. This visually captivating representation demonstrates the algorithm's proficiency in mimicking intricate patterns by the gradual introduction of shapes. It serves as both an artistic endeavor and a practical manifestation of the genetic algorithm's versatility in reproducing intricate designs.

(back to top)

Built With

VSCode Python Pillow Qt Pyside6 Numpy

Usage

Prerequisites

You need to have python installed, if not you can download it here: https://www.python.org/downloads/

Installation

  1. Clone the repo
    git clone "https:/Jon-Robb/genetic_algorithm.git"
    cd genetic_algorithm
    cd ga
  2. Install pillow
    pip install pillow
  3. Install numpy
     pip install numpy
  4. Install PySide6
     pip install PySide6
  5. Run the program
     python main.py

(back to top)


Box Solution

Box Solution


Shape solution

Shape Solution


Image cloning solution, watch the result come to life

Image main Image 133 epoch Image 266 epoch Image 5000 epoch Image 5000 epoch Image 5000 epoch


(back to top)

Contact

LinkedIn Gmail Portfolio

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages