Skip to content

Commit

Permalink
edit init files and md files
Browse files Browse the repository at this point in the history
  • Loading branch information
SevgiAkten committed Aug 14, 2024
1 parent ab871da commit aa13d30
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 12 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Here’s how we can define this problem in Python using the `ExampleProblem` cla

```python
from numpy import power as pw
import pycellga

class ExampleProblem:

Expand All @@ -68,18 +69,18 @@ class ExampleProblem:
**Usage:**

```python
result = optimizer.cga(
result = pycellga.optimizer.cga(
n_cols = 5,
n_rows = 5,
n_gen = 100,
ch_size = 5,
gen_type = GeneType.REAL,
gen_type = pycellga.optimizer.GeneType.REAL,
p_crossover = 0.9,
p_mutation = 0.2,
problem = ExampleProblem(), # Replace with a real problem instance as needed
selection = optimizer.TournamentSelection,
recombination = optimizer.ByteOnePointCrossover,
mutation = optimizer.ByteMutationRandom,
selection = pycellga.optimizer.TournamentSelection,
recombination = pycellga.optimizer.ByteOnePointCrossover,
mutation = pycellga.optimizer.ByteMutationRandom,
mins = [-32.768] * 5, # Minimum values for each gene
maxs = [32.768] * 5 # Maximum values for each gene
)
Expand Down
11 changes: 6 additions & 5 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Here’s how we can define this problem in Python using the `ExampleProblem` cla

```python
from numpy import power as pw
import pycellga

class ExampleProblem:

Expand All @@ -86,18 +87,18 @@ class ExampleProblem:
**Usage:**

```python
result = optimizer.cga(
result = pycellga.optimizer.cga(
n_cols = 5,
n_rows = 5,
n_gen = 100,
ch_size = 5,
gen_type = GeneType.REAL,
gen_type = pycellga.optimizer.GeneType.REAL,
p_crossover = 0.9,
p_mutation = 0.2,
problem = ExampleProblem(), # Replace with a real problem instance as needed
selection = optimizer.TournamentSelection,
recombination = optimizer.ByteOnePointCrossover,
mutation = optimizer.ByteMutationRandom,
selection = pycellga.optimizer.TournamentSelection,
recombination = pycellga.optimizer.ByteOnePointCrossover,
mutation = pycellga.optimizer.ByteMutationRandom,
mins = [-32.768] * 5, # Minimum values for each gene
maxs = [32.768] * 5 # Maximum values for each gene
)
Expand Down
12 changes: 12 additions & 0 deletions pycellga/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from . import example
from . import mutation
from . import neighborhoods
from . import problems
from . import recombination
from . import selection
from . import optimizer
from . import population
from . import individual
from . import grid
from . import byte_operators

5 changes: 5 additions & 0 deletions pycellga/example/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import optimizer
from individual import GeneType
from . import example_alpha_cga
from . import example_ccga
from . import example_cga
from . import example_mcccga
from . import example_sync_cga
9 changes: 9 additions & 0 deletions pycellga/mutation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from . import bit_flip_mutation
from . import byte_mutation
from . import byte_mutation_random
from . import float_uniform_mutation
from . import insertion_mutation
from . import mutation_operator
from . import shuffle_mutation
from . import swap_mutation
from . import two_opt_mutation
6 changes: 6 additions & 0 deletions pycellga/neighborhoods/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import compact_9
from . import compact_13
from . import compact_21
from . import compact_25
from . import linear_5
from . import linear_9
24 changes: 24 additions & 0 deletions pycellga/problems/single_objective/continuous/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from . import ackley
from . import bentcigar
from . import bohachevsky
from . import chichinadze
from . import dropwave
from . import fms
from . import griewank
from . import holzman
from . import levy
from . import matyas
from . import pow
from . import powell
from . import rastrigin
from . import rosenbrock
from . import rothellipsoid
from . import schaffer
from . import schaffer2
from . import schwefel
from . import sphere
from . import styblinskitang
from . import sumofdifferentpowers
from . import threehumps
from . import zakharov
from . import zettle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from . import count_sat
from . import ecc
from . import fms
from . import maxcut20_01
from . import maxcut20_09
from . import maxcut100
from . import mmdp
from . import one_max
from . import peak
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import tsp
12 changes: 12 additions & 0 deletions pycellga/recombination/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from . import arithmetic_crossover
from . import blxalpha_crossover
from . import byte_one_point_crossover
from . import byte_uniform_crossover
from . import flat_crossover
from . import linear_crossover
from . import one_point_crossover
from . import pmx_crossover
from . import recombination_operator
from . import two_point_crossover
from . import unfair_avarage_crossover
from . import uniform_crossover
3 changes: 3 additions & 0 deletions pycellga/selection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import roulette_wheel_selection
from . import selection_operator
from . import tournament_selection
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

setup(
name='pycellga',
version='0.1.8',
version='0.2.1',
description='A Python Package for Improved Cellular Genetic Algorithms',
author='Sevgi Akten Karakaya, Mehmet Hakan Satman',
author_email='sevgiakten@gmail.com, mhsatman@gmail.com',
packages=find_packages(),
packages=find_packages(where="."),
package_dir={'pycellga': 'pycellga'},
install_requires=required,
classifiers=[
'Programming Language :: Python :: 3',
Expand Down

0 comments on commit aa13d30

Please sign in to comment.