https://github.com/jcfneto/metaevolv

https://github.com/jcfneto/metaevolv

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.5%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: jcfneto
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 158 KB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme

README.md

MetaEvolv

MetaEvolv is a Python library that implements various evolutionary metaheuristic optimization algorithms, including ABC (Artificial Bee Colony), Clonalg (Clonal Selection Algorithm), DE (Differential Evolution), GA (Genetic Algorithm), and PSO (Particle Swarm Optimization).

Installation

To install the library:

bash pip install metaevolv

Implemented Algorithms

Artificial Bee Colony (ABC)

ABC is an optimization algorithm based on the foraging behavior of honeybees. It is used to find minima of an objective function.

Clonal Selection Algorithm (Clonalg)

Clonalg is an algorithm inspired by the clonal selection process of the immune system. It is used for function minimization.

Differential Evolution (DE)

DE is an evolutionary algorithm that optimizes continuous problems. It uses mutation and crossover operations to evolve a population of solutions.

Genetic Algorithm (GA)

GA is an algorithm inspired by the theory of natural evolution. It uses genetic operators like selection, crossover, and mutation to find optimal solutions.

Particle Swarm Optimization (PSO)

PSO is inspired by the behavior of bird flocks and fish schools. It optimizes an objective function by moving particles through the search space.

How to Use

To use any of the algorithms, you need to import the specific module and configure the algorithm with the desired parameters.

Example: Genetic Algorithm (GA)

Here is an example of how to use the Genetic Algorithm (GA) with MetaEvolv:

```python import numpy as np from metaevolv.ga import GeneticAlgorithm, GAConfig

Define your objective function

def objective_function(x: np.ndarray) -> float: return np.sum(x**2)

Configure the genetic algorithm

config = GAConfig( bits=10, dimensions=2, npopulation=50, searchrange=(-10.0, 10.0), k=3, cp=0.8, mp=0.01, maxiter=100, selectiontype='tournament', crossovertype='onepoint', mutationtype='bitbybit', pcvariation='constant', cp_final=0.9 )

Instantiate the genetic algorithm with the configuration

ga = GeneticAlgorithm(config, objective_function)

Run the algorithm

ga.fit()

Display the results

print(f"Best solution found: {ga.bestind}") print(f"Objective function value at the best solution: {ga.besteval}") ```

License

This project is licensed under the terms of the MIT license.

Owner

  • Name: José Carlos
  • Login: jcfneto
  • Kind: user
  • Location: Lavras/MG

Data Science | Dev Python | MSc Student

GitHub Events

Total
Last Year