Skip to content

The project implements a genetic algorithm for pathfinding visualization in a game board environment using PyQt5. It evolves samples navigating from start to end while avoiding obstacles. Features include customizable parameters, dynamic obstacle placement.

Notifications You must be signed in to change notification settings

UmutDeniz26/Path_Finder_Genetic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm Path Finding Visualization

Introduction

This project implements a genetic algorithm to visualize pathfinding in a game board environment using PyQt5. The genetic algorithm generates samples (individuals) that navigate from a start point to an end point on the game board while avoiding obstacles.

![Screencast-from-28-03-2024-13_23_15](https://github.com/UmutDeniz26/Path_Finder_Genetic/assets/76654674/32c3b310-d07e-453e-b301-646d3958a58e)

Features

  • Genetic Algorithm: The pathfinding is achieved through a genetic algorithm that evolves a population of samples over generations.
  • Visualization: The PyQt5 framework is used to visualize the game board, samples, obstacles, and end point.
  • Customizable Parameters: Parameters such as learning rate, mutation rate, sample speed, and board size can be adjusted to fine-tune the pathfinding behavior.
  • Dynamic Obstacle Placement: Users can dynamically add obstacles by clicking and dragging on the game board.

Dependencies

  • Python 3.x
  • PyQt5

Installation

  1. Clone the repository:

    git clone https://github.com/your_username/genetic-algorithm-pathfinding.git
  2. Install dependencies:

    pip install mkl numpy PyQt5
    # See requirements.txt for detailed dependencies

Usage

  1. Run the main script:

    python main.py
  2. Use the following controls:

    • Left Click: Add obstacles by clicking and dragging on the game board.
    • Enter/Return Key: Pause/resume the pathfinding process.
    • Mouse Movement: Adjust the size and position of obstacles.
  3. Observe the pathfinding process as samples evolve and navigate towards the end point.

Customization

You can customize various parameters in the main.py file, such as:

  • Learning rate
  • Mutation rate
  • Sample_qt speed
  • Board size
  • Generation multiplier
  • Select per epoch

About

The project implements a genetic algorithm for pathfinding visualization in a game board environment using PyQt5. It evolves samples navigating from start to end while avoiding obstacles. Features include customizable parameters, dynamic obstacle placement.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages