Skip to main content

This project is a collection of optimization algorithms.

Project description

This package is a collection of optimization algorithms. The aim is high diversity of optimizers and eased of use.

For documentation, Visit this.

Usage

from bejoor.genetic import BaseGeneticAlgorithm

def func(sol):
    return abs( (sol[0]**sol[3] + sol[1]**sol[3] - sol[2]**sol[3]))


solution_vector =  [{"type": "integer", "lower_bound": 1, "upper_bound": 500}] * 3 + \
                   [{"type": "integer", "lower_bound": 2, "upper_bound": 100}] + \
                   [{"type": "float", "lower_bound": 0, "upper_bound": 1}] * 2 + \
                   [{"type": "string", "possible_values": ["option1", "option2", "option3"]}]

bga = BaseGeneticAlgorithm(objective_function=func, solution_vector_size=7,
                           solution_vector=solution_vector, optimization_side="min", target_objective_upper_bound=5,
                           crossover_probability=0.9, mutation_probability=0.1,
                           elitism_rate=0.05, selection_strategy="roulette",
                           crossover_type="one-point", population_size=500, epochs=200)

bga.run()

print(bga.best_solution)
print(bga.best_objective_value)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bejoor-0.0.9.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

bejoor-0.0.9-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file bejoor-0.0.9.tar.gz.

File metadata

  • Download URL: bejoor-0.0.9.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for bejoor-0.0.9.tar.gz
Algorithm Hash digest
SHA256 a7e0772548fa13776ab62e3bbbc3d4b3c80611aafbeb1348156865e6cda34c62
MD5 9ddeb2eb0d75defced48014971a6ca88
BLAKE2b-256 7d3eae36f233cbe8bf79885f5949d3488796c1935a213c1a442cb298869793c3

See more details on using hashes here.

File details

Details for the file bejoor-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: bejoor-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for bejoor-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 79d21e9c3608931545c2e374938f3753e36edabd1365e6f7045ef37e6cd993bc
MD5 b9059abf612c4346d7ba13495a5f86da
BLAKE2b-256 c5f94eb1a7048df1f0d597325c172d29d79dfa7aabecb685abebb9a8fec1c7ba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page