This commit is contained in:
Daniel Wilczak
2020-09-21 13:53:37 -04:00
5 changed files with 61 additions and 20 deletions

View File

@ -1,6 +1,6 @@
# EasyGA - A general solution to Genetic Algorithms
The projects has just started
The project has just started
## Installation
@ -12,34 +12,48 @@ pip3 install EasyGA
To use the package:
```python
import EasyGA as ga
import EasyGA
```
## Usage
```python
import EasyGA as ga
import random
import EasyGA
chromosome = ga.chromosome()
# The user defined gene function
def user_gene_function():
return random.randint(1, 100)
# Fill the chromosome with genes with Gene Number i'th number
for i in range(10):
gene_value = f"Gene Number {i}"
new_gene = ga.gene("gene_value")
chromosome.add_gene(new_gene)
# Standard user size requirements:
Population_size = 10
Chromosome_length = 10
# Chromosome has 10 genes in it
print(len(chromosome.genes))
# Create the Genetic algorithm
ga = EasyGA.GA(Population_size, Chromosome_length,user_gene_function)
ga.initialize()
# Get the first genes value
print(chromosome.genes[0].get_value())
# Looking at the first chromosome in the population:
ga.population.chromosomes[0].print_chromosome()
```
# Developing EasyGA
Download the repository to some folder - If you never used git. Look up a youtube tutorial. It will all make sense.
```
git clone https://github.com/danielwilczak101/EasyGA.git
```
Then install the repositroy using this command:
```
pip install -e .
```
# Working on developing a devel branch
To install EASY, along with the tools you need to develop and run tests, run the following in your virtual env:
```bash
<<<<<<< HEAD
$ pip install -e .[dev]
=======
$ pip install -e .[devel]
>>>>>>> 306f98d8664024828f5d094268f3da852e904262
```