metaheuristic-designer


Namemetaheuristic-designer JSON
Version 0.1.4 PyPI version JSON
download
home_page
SummaryA python package to desing metaheuristic optimization algorithms from components.
upload_time2023-10-30 19:11:47
maintainer
docs_urlNone
author
requires_python>=3.10
licenseLICENSE
keywords optization genetic-algorithm evolutionary-algorithms metaheuristics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Metaheuristic-designer
[![Documentation Status](https://readthedocs.org/projects/metaheuristic-designer/badge/?version=latest)](https://metaheuristic-designer.readthedocs.io/en/latest/?badge=latest)

This is an object-oriented framework for the development, testing and analysis of metaheuristic optimization algorithms.

It defines the components of a general evolutionary algorithm and offers some implementations of algorithms along with components
that can be used directly. Those components will be explained below.

It was inspired by the article [Metaheuristics “in the large”](https://doi.org/10.1016/j.ejor.2021.05.042) that 
discusses some of the issues in the research on metaheuristic optimization, sugesting the development of libraries for the standarization
of metaheuristic algorithms.

Most of the design decisions are based on the book [Introduction to evolutionary computing by Eiben, Agoston E.,
and James E. Smith](https://doi.org/10.1007/978-3-662-44874-8) which is very well expained and is highly recomended to anyone willing to learn about the topic.

This framework doesn't claim to have a high performance, specially since the chosen language is Python and the code has not been 
designed for speed. This shouldn't really be an issue since the highest amount of time spent in these kind of algorithms
tends to be in the evaluation of the objective function. If you want to compare an algorithm made with this tool with another
one that is available by other means, it is recomended to use the number of evaluations of the objective function as a metric instead of execution time.

## Instalation

The package is available in the PyPi repository (https://pypi.org/project/metaheuristic-designer/).

To install it, use the pip command as follows:

```bash
pip install metaheuristic-designer
```

## Examples
- There are 2 scripts to test this repository:
    - "examples/exec_basic.py": Optimize a simple function, in this case, the "sphere" function that calculates the squared norm of a vector, we want a vector that minmizes this function. There are two possible flags that can be added:
        - "-a \[Alg\]" use one of the available algorithms, the choices are:
            - HillClimb: simple hill climbing algorithm.
            - LocalSearch: take the best of 20 randomly chosen neighbours.
            - ES: (100+150)-ES, basic evolutionary strategy.
            - HS: Harmony search algorithm.
            - GA: genetic algorithm.
            - SA: simulated annealing algorithm.
            - DE: DE/best/1, differential evolution algorithm.
            - PSO: simple particle swarm algorithm.
            - NoSearch: no search is done.
        - "-m" use a memetic search like structure, do local search after mutation.
    - "examples/exec_basic.py": Evolve an image so that it matches the one given as an input. 
        - The same parameters as the previous script.
        - "-i \[Image path\]" read the image and evolve a random image into this one.

It is recomended that you create a virtual environment to test the examples.

This is done with the following commands:
```bash
python -m venv venv
source venv/bin/activate
pip install .[examples]
```

Once you have activate the virtual environment, you can execute one of the examples like this:
```
python examples/example_basic.py
``` 

or

```
python examples/image_evolution.py
``` 

To run the tests you need to install nox, to execute the tests use the command

```bash
nox test
```

## Implemented components
This package comes with some already made components that can be used in any algorithm in this framework

### Search strategies
The algorithms implemented are:
| Class name | Strategy | Params | Other info |
|------------|-----------|--------|------------|
|NoSearch|Do nothing||For debugging purposes||
|RandomSearch|Random Search|||
|HillClimb|Hill climb |||
|LocalSearch|Local seach |**iters** (number of neighbors to test each time)||
|SA|Simulated annealing|**iter** (iterations per temperature change), **temp_init** (initial temperature), **alpha** (exponent of the temperature change) ||
|GA|Genetic algorithm|**pmut** (probability of mutation), **pcross** (probability of crossover)||
|ES|Evolution strategy|**offspringSize** (number of indiviuals to generate each generation)||
|HS|Harmony search|**HSM**, **HMCR**, **BW**, **PAR**||
|PSO|Particle Swarm optimization|**w**,**c1**,**c2**||
|DE|Differential evolution|||
|CRO|Coral Reef Optimization|**rho**,**Fb**,**Fd**,**Pd**,**attempts**||
|CRO_SL|Coral Reef Optimization with substrate layers|**rho**,**Fb**,**Fd**,**Pd**,**attempts**||
|PCRO_SL|probabilistic Coral Reef Optimization with substrate layers|**rho**,**Fb**,**Fd**,**Pd**,**attempts**||
|DPCRO_SL|Dynamic probabilistic Coral Reef Optimization with substrate layers|**rho**,**Fb**,**Fd**,**Pd**,**attempts**,**group_subs**,**dyn_method**,**dyn_steps**,**prob_amp**||
|VND| Variable neighborhood descent|||
|RVNS| Restricted variable neighborhood search||In progress|
|VNS| Variable neighborhood search||In progress|
|CMA_ES| Covariance matrix adaptation - Evolution strategy|| Not implemented yet|

### Survivor selection methods
These are methods of selecting the individuals to use in future generations.

The methods implemented are:
| Method name | Algorithm | Params | Other info |
|-------------|-----------|--------|------------|
|"Elitism"|Elitism|**amount**||
|"CondElitism"|Conditional Elitism|**amount**||
|"nothing" or "generational"|Replace all the parents with their children|| Needs the offspring size to be equal to the population size|
|"One-to-one" or "HillClimb"|One to one (compare each parent with its child)||Needs the offspring size to be equal to the population size|
|"Prob-one-to-one" or "ProbHillClimb"|Probabilitisc One to one (with a chance to always choose the child)|**p**|Needs the offspring size to be equal to the population size|
|"(m+n)" or "keepbest"|(λ+μ), or choosing the λ best individuals taking parents and children|||
|"(m,n)" or "keepoffspring"|(λ,μ), or taking the best λ children||λ must be smaller than μ|
|"CRO"|A 2 step survivor selection method used in the CRO algorithm. Each individual attempts to enter the population K times and then a percentage of the worse individuals will be eliminated from the population|**Fd**,**Pd**,**attempts**,**maxPopSize**|Can return a population with a variable number of individuals|

### Parent selection methods
These are methods of selecting the individuals that will be mutated/perturbed in each generation

The methods implemented are:
| Method name | Algorithm | Params | Other info |
|-------------|-----------|--------|------------|
|"Torunament"|Choose parents by tournament|**amount**, **p**||
|"Best"| Select the n best individuals|**amount**||
|"Random"| Take n individuals at random|**amount**||
|"Roulette"| Perform a selection with the roullette method|**amount**, **method**, **F**||
|"SUS"| Stochastic universal sampling|**amount**, **method**, **F**||
|"Nothing"| Take all the individuals from the population||

### Operators

| Class name | Domain | Other info|
|------------|--------|----|
|OperatorReal|Real valued vectors||
|OperatorInt|Integer valued vectors||
|OperatorBinary|Binary vectors||
|OperatorPerm|Permutations||
|OperatorList|Variable length lists||
|OperatorMeta|Other operators||
|OperatorLambda|Any|Lets you specify a function as an operator|

The Operators functions available in the operator classes are:
| Method name | Algorithm | Params | Domains |
|-------------|-----------|--------|---------|
|"1point"|1 point crossover||Real, Int, Bin|
|"2point"|2 point crossover||Real, Int, Bin|
|"Multipoint"|multipoint crossover||Real, Int, Bin|
|"WeightedAvg"|Weighted average crossover|**F**|Real, Int|
|"BLXalpha"|BLX-alpha crossover|**Cr**|Real|
|"Multicross"|multi-individual multipoint crossover|**Nindiv**|Real, Int, Bin|
|"XOR"|Bytewise XOR with a random vector|**N**|Int|
|"XORCross"|Bytewise XOR between 2 vectors component by component||Int|
|"sbx"|SBX crossover|**Cr**|Real|
|"Perm"|Permutate vector components|**N**|Real, Int, Bin, Perm|
|"Gauss"|Add Gaussian noise|**F**|Real, Int|
|"Laplace"|Add noise following a Laplace distribution|**F**|Real, Int|
|"Cauchy"|Add noise following a Cauchy distribution|**F**|Real, Int|
|"Poisson"|Add noise following a Cauchy distribution|**F**|Int|
|"Uniform"|Add Uniform noise|**Low**, **Up**|Real, Int|
|"MutRand" or "MutNoise"|Add random noise to a number of vector components|**method**, **N**, optionaly: **Low**, **Up**, **F**|Real, Int|
|"MutSample"|Take a sample from a probability distribution and put it on a number of vector components|**method**, **N**, optionaly: **Low**, **Up**, **F**|Real, Int|
|"RandNoise"|Add random noise|**method**, optionaly: **Low**, **Up**, **F**|Real, Int|
|"RandSample"|Sample from a probability distribution|**method**, optionaly: **Low**, **Up**, **F**|Real, Int|
|"DE/Rand/1"|Sample from a probability distribution|**F**, **Cr**|Real, Int|
|"DE/Best/1"|Sample from a probability distribution|**F**, **Cr**|Real, Int|
|"DE/Rand/2"|Sample from a probability distribution|**F**, **Cr**|Real, Int|
|"DE/Best/2"|Sample from a probability distribution|**F**, **Cr**|Real, Int|
|"DE/Current-to-rand/1"|Sample from a probability distribution|**F**, **Cr**|Real, Int|
|"DE/Current-to-best/1"|Sample from a probability distribution|**F**, **Cr**|Real, Int|
|"DE/Current-to-pbest/1"|Sample from a probability distribution|**F**, **Cr**, **p**|Real, Int|
|"PSO"|Sample from a probability distribution|**w**, **c1**, **c2**|Real, Int|
|"Firefly"|Sample from a probability distribution|**a**,**b**,**c**,**g**|Real, Int|
|"Random"|Sample from a probability distribution||Real, Int, Bin, Perm|
|"RandomMask"|Randomly sample a number of vector components|**N**|Real, Int||
|"Swap"|Swap two components||Perm||
|"Insert"|Insert a component and shift to the left||Perm||
|"Scramble"|Scramble permutation order|**N**|Perm||
|"Invert"|Reverse order of components||Perm||
|"Roll"|Roll components to the right|**N**|Perm||
|"PMX"|Partially mapped crossover||Perm||
|"OrderCross"|Ordered crossover||Perm||
|"branch"|Choose one of the provided operators randomly||Operators|
|"sequence"|Apply all the provided operators in order||Operators|
|"split"|Apply each operator to a subset of vector components following the mask provided||Operators|
|"pick"|Manually pick one of the operators provided (setting the ```chosen_idx``` attribute)||Operators|
|"Dummy"|Assing the vector to a predefined value||All|
|"Custom"|Provide a lambda function to apply as an operator|**function**|All|
|"Nothing"|Do nothing||All|

### Initializers
Initializers create the initial population that will be evolved in the optimization process.

Some of the implemente Initializers are:
| Class name | Description | Other info |
|------------|-----------|------------|
|DirectInitializer|Initialize the population to a preset list of individuals||
|SeedProbInitializer|Initializes the population with another initializer and inserts user-specified individuals with a probability||
|SeedDetermInitializer|Initializes the population with another initializer and inserts a number of user-specified individuals into the population||
|GaussianVectorInitializer|Initialize individuals with normally distributed vectors||
|UniformVectorInitializer|Initialize individuals with uniformly random distributed vectors||
|PermInitializer|Initialize individuals with random permuations||
|LambdaInitializer|Initialize individuals with a user-defined function||


### Encodings
Specifying the Encoding is optional but can be very helpful for some types of problems.

An encoding will represent each solution differently in the optimization process and the evaluation of the fintess, since most algorithm work only with vectors, but we might need other types of datatypes for our optimization.

Some of the implemented Encodings are:
| Class name | Encoding | Decoding | Other info |
|------------|----------|----------|------------|
|DefaultEncoding|Makes no changes to the input|Makes no changes to the input|
|TypeCastEncoding|Changes the datatype of the vector from **T1** to **T2**|Changes the datatype of the vectorfrom **T1** to **T2**||
|MatrixEncoding|Converts a vector into a matrix of size **NxM**|Converts a matrix to a vector with the ```.flatten()``` method||
|ImageEncoding|Converts a vector into a matrix of size **NxMx1** or **NxMx3**, each component is an unsigned 8bit number|Converts a matrix to a vector with the ```.flatten()``` method|
|LambdaEncoding|Applies the user-defined ```encode``` function|Applies the user-defined ```decode``` function||


### Benchmark functions
The benchmark functions you can use to test the algorithms are:
| Class name | Domain | Other info |
|------------|--------|------------|
|MaxOnes||Integer||
|DiophantineEq||Integer||
|MaxOnesReal||Real||
|Sphere||Real||
|HighCondElliptic||Real||
|BentCigar||Real||
|Discus||Real||
|Rosenbrock||Real||
|Ackley||Real||
|Weistrass||Real||
|Griewank||Real||
|Rastrigin||Real||
|ModSchwefel||Real||
|Katsuura||Real||
|HappyCat||Real||
|HGBat||Real||
|SumPowell||Real||
|N4XinSheYang||Real||
|ThreeSAT||Real||
|BinKnapsack||Binary||
|MaxClique||Permutation||
|TSP||Permutation||
|ImgApprox||Integer||
|ImgStd||Integer||
|ImgEntropy||Integer||


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "metaheuristic-designer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "optization,genetic-algorithm,evolutionary-algorithms,metaheuristics",
    "author": "",
    "author_email": "eugenioLR <eugeniolorente0@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/47/2c/780f417941400c4c46aef3a5bbf014ff24252f9c93689e3f65df7d799ffa/metaheuristic-designer-0.1.4.tar.gz",
    "platform": null,
    "description": "# Metaheuristic-designer\n[![Documentation Status](https://readthedocs.org/projects/metaheuristic-designer/badge/?version=latest)](https://metaheuristic-designer.readthedocs.io/en/latest/?badge=latest)\n\nThis is an object-oriented framework for the development, testing and analysis of metaheuristic optimization algorithms.\n\nIt defines the components of a general evolutionary algorithm and offers some implementations of algorithms along with components\nthat can be used directly. Those components will be explained below.\n\nIt was inspired by the article [Metaheuristics \u201cin the large\u201d](https://doi.org/10.1016/j.ejor.2021.05.042) that \ndiscusses some of the issues in the research on metaheuristic optimization, sugesting the development of libraries for the standarization\nof metaheuristic algorithms.\n\nMost of the design decisions are based on the book [Introduction to evolutionary computing by Eiben, Agoston E.,\nand James E. Smith](https://doi.org/10.1007/978-3-662-44874-8) which is very well expained and is highly recomended to anyone willing to learn about the topic.\n\nThis framework doesn't claim to have a high performance, specially since the chosen language is Python and the code has not been \ndesigned for speed. This shouldn't really be an issue since the highest amount of time spent in these kind of algorithms\ntends to be in the evaluation of the objective function. If you want to compare an algorithm made with this tool with another\none that is available by other means, it is recomended to use the number of evaluations of the objective function as a metric instead of execution time.\n\n## Instalation\n\nThe package is available in the PyPi repository (https://pypi.org/project/metaheuristic-designer/).\n\nTo install it, use the pip command as follows:\n\n```bash\npip install metaheuristic-designer\n```\n\n## Examples\n- There are 2 scripts to test this repository:\n    - \"examples/exec_basic.py\": Optimize a simple function, in this case, the \"sphere\" function that calculates the squared norm of a vector, we want a vector that minmizes this function. There are two possible flags that can be added:\n        - \"-a \\[Alg\\]\" use one of the available algorithms, the choices are:\n            - HillClimb: simple hill climbing algorithm.\n            - LocalSearch: take the best of 20 randomly chosen neighbours.\n            - ES: (100+150)-ES, basic evolutionary strategy.\n            - HS: Harmony search algorithm.\n            - GA: genetic algorithm.\n            - SA: simulated annealing algorithm.\n            - DE: DE/best/1, differential evolution algorithm.\n            - PSO: simple particle swarm algorithm.\n            - NoSearch: no search is done.\n        - \"-m\" use a memetic search like structure, do local search after mutation.\n    - \"examples/exec_basic.py\": Evolve an image so that it matches the one given as an input. \n        - The same parameters as the previous script.\n        - \"-i \\[Image path\\]\" read the image and evolve a random image into this one.\n\nIt is recomended that you create a virtual environment to test the examples.\n\nThis is done with the following commands:\n```bash\npython -m venv venv\nsource venv/bin/activate\npip install .[examples]\n```\n\nOnce you have activate the virtual environment, you can execute one of the examples like this:\n```\npython examples/example_basic.py\n``` \n\nor\n\n```\npython examples/image_evolution.py\n``` \n\nTo run the tests you need to install nox, to execute the tests use the command\n\n```bash\nnox test\n```\n\n## Implemented components\nThis package comes with some already made components that can be used in any algorithm in this framework\n\n### Search strategies\nThe algorithms implemented are:\n| Class name | Strategy | Params | Other info |\n|------------|-----------|--------|------------|\n|NoSearch|Do nothing||For debugging purposes||\n|RandomSearch|Random Search|||\n|HillClimb|Hill climb |||\n|LocalSearch|Local seach |**iters** (number of neighbors to test each time)||\n|SA|Simulated annealing|**iter** (iterations per temperature change), **temp_init** (initial temperature), **alpha** (exponent of the temperature change) ||\n|GA|Genetic algorithm|**pmut** (probability of mutation), **pcross** (probability of crossover)||\n|ES|Evolution strategy|**offspringSize** (number of indiviuals to generate each generation)||\n|HS|Harmony search|**HSM**, **HMCR**, **BW**, **PAR**||\n|PSO|Particle Swarm optimization|**w**,**c1**,**c2**||\n|DE|Differential evolution|||\n|CRO|Coral Reef Optimization|**rho**,**Fb**,**Fd**,**Pd**,**attempts**||\n|CRO_SL|Coral Reef Optimization with substrate layers|**rho**,**Fb**,**Fd**,**Pd**,**attempts**||\n|PCRO_SL|probabilistic Coral Reef Optimization with substrate layers|**rho**,**Fb**,**Fd**,**Pd**,**attempts**||\n|DPCRO_SL|Dynamic probabilistic Coral Reef Optimization with substrate layers|**rho**,**Fb**,**Fd**,**Pd**,**attempts**,**group_subs**,**dyn_method**,**dyn_steps**,**prob_amp**||\n|VND| Variable neighborhood descent|||\n|RVNS| Restricted variable neighborhood search||In progress|\n|VNS| Variable neighborhood search||In progress|\n|CMA_ES| Covariance matrix adaptation - Evolution strategy|| Not implemented yet|\n\n### Survivor selection methods\nThese are methods of selecting the individuals to use in future generations.\n\nThe methods implemented are:\n| Method name | Algorithm | Params | Other info |\n|-------------|-----------|--------|------------|\n|\"Elitism\"|Elitism|**amount**||\n|\"CondElitism\"|Conditional Elitism|**amount**||\n|\"nothing\" or \"generational\"|Replace all the parents with their children|| Needs the offspring size to be equal to the population size|\n|\"One-to-one\" or \"HillClimb\"|One to one (compare each parent with its child)||Needs the offspring size to be equal to the population size|\n|\"Prob-one-to-one\" or \"ProbHillClimb\"|Probabilitisc One to one (with a chance to always choose the child)|**p**|Needs the offspring size to be equal to the population size|\n|\"(m+n)\" or \"keepbest\"|(\u03bb+\u03bc), or choosing the \u03bb best individuals taking parents and children|||\n|\"(m,n)\" or \"keepoffspring\"|(\u03bb,\u03bc), or taking the best \u03bb children||\u03bb must be smaller than \u03bc|\n|\"CRO\"|A 2 step survivor selection method used in the CRO algorithm. Each individual attempts to enter the population K times and then a percentage of the worse individuals will be eliminated from the population|**Fd**,**Pd**,**attempts**,**maxPopSize**|Can return a population with a variable number of individuals|\n\n### Parent selection methods\nThese are methods of selecting the individuals that will be mutated/perturbed in each generation\n\nThe methods implemented are:\n| Method name | Algorithm | Params | Other info |\n|-------------|-----------|--------|------------|\n|\"Torunament\"|Choose parents by tournament|**amount**, **p**||\n|\"Best\"| Select the n best individuals|**amount**||\n|\"Random\"| Take n individuals at random|**amount**||\n|\"Roulette\"| Perform a selection with the roullette method|**amount**, **method**, **F**||\n|\"SUS\"| Stochastic universal sampling|**amount**, **method**, **F**||\n|\"Nothing\"| Take all the individuals from the population||\n\n### Operators\n\n| Class name | Domain | Other info|\n|------------|--------|----|\n|OperatorReal|Real valued vectors||\n|OperatorInt|Integer valued vectors||\n|OperatorBinary|Binary vectors||\n|OperatorPerm|Permutations||\n|OperatorList|Variable length lists||\n|OperatorMeta|Other operators||\n|OperatorLambda|Any|Lets you specify a function as an operator|\n\nThe Operators functions available in the operator classes are:\n| Method name | Algorithm | Params | Domains |\n|-------------|-----------|--------|---------|\n|\"1point\"|1 point crossover||Real, Int, Bin|\n|\"2point\"|2 point crossover||Real, Int, Bin|\n|\"Multipoint\"|multipoint crossover||Real, Int, Bin|\n|\"WeightedAvg\"|Weighted average crossover|**F**|Real, Int|\n|\"BLXalpha\"|BLX-alpha crossover|**Cr**|Real|\n|\"Multicross\"|multi-individual multipoint crossover|**Nindiv**|Real, Int, Bin|\n|\"XOR\"|Bytewise XOR with a random vector|**N**|Int|\n|\"XORCross\"|Bytewise XOR between 2 vectors component by component||Int|\n|\"sbx\"|SBX crossover|**Cr**|Real|\n|\"Perm\"|Permutate vector components|**N**|Real, Int, Bin, Perm|\n|\"Gauss\"|Add Gaussian noise|**F**|Real, Int|\n|\"Laplace\"|Add noise following a Laplace distribution|**F**|Real, Int|\n|\"Cauchy\"|Add noise following a Cauchy distribution|**F**|Real, Int|\n|\"Poisson\"|Add noise following a Cauchy distribution|**F**|Int|\n|\"Uniform\"|Add Uniform noise|**Low**, **Up**|Real, Int|\n|\"MutRand\" or \"MutNoise\"|Add random noise to a number of vector components|**method**, **N**, optionaly: **Low**, **Up**, **F**|Real, Int|\n|\"MutSample\"|Take a sample from a probability distribution and put it on a number of vector components|**method**, **N**, optionaly: **Low**, **Up**, **F**|Real, Int|\n|\"RandNoise\"|Add random noise|**method**, optionaly: **Low**, **Up**, **F**|Real, Int|\n|\"RandSample\"|Sample from a probability distribution|**method**, optionaly: **Low**, **Up**, **F**|Real, Int|\n|\"DE/Rand/1\"|Sample from a probability distribution|**F**, **Cr**|Real, Int|\n|\"DE/Best/1\"|Sample from a probability distribution|**F**, **Cr**|Real, Int|\n|\"DE/Rand/2\"|Sample from a probability distribution|**F**, **Cr**|Real, Int|\n|\"DE/Best/2\"|Sample from a probability distribution|**F**, **Cr**|Real, Int|\n|\"DE/Current-to-rand/1\"|Sample from a probability distribution|**F**, **Cr**|Real, Int|\n|\"DE/Current-to-best/1\"|Sample from a probability distribution|**F**, **Cr**|Real, Int|\n|\"DE/Current-to-pbest/1\"|Sample from a probability distribution|**F**, **Cr**, **p**|Real, Int|\n|\"PSO\"|Sample from a probability distribution|**w**, **c1**, **c2**|Real, Int|\n|\"Firefly\"|Sample from a probability distribution|**a**,**b**,**c**,**g**|Real, Int|\n|\"Random\"|Sample from a probability distribution||Real, Int, Bin, Perm|\n|\"RandomMask\"|Randomly sample a number of vector components|**N**|Real, Int||\n|\"Swap\"|Swap two components||Perm||\n|\"Insert\"|Insert a component and shift to the left||Perm||\n|\"Scramble\"|Scramble permutation order|**N**|Perm||\n|\"Invert\"|Reverse order of components||Perm||\n|\"Roll\"|Roll components to the right|**N**|Perm||\n|\"PMX\"|Partially mapped crossover||Perm||\n|\"OrderCross\"|Ordered crossover||Perm||\n|\"branch\"|Choose one of the provided operators randomly||Operators|\n|\"sequence\"|Apply all the provided operators in order||Operators|\n|\"split\"|Apply each operator to a subset of vector components following the mask provided||Operators|\n|\"pick\"|Manually pick one of the operators provided (setting the ```chosen_idx``` attribute)||Operators|\n|\"Dummy\"|Assing the vector to a predefined value||All|\n|\"Custom\"|Provide a lambda function to apply as an operator|**function**|All|\n|\"Nothing\"|Do nothing||All|\n\n### Initializers\nInitializers create the initial population that will be evolved in the optimization process.\n\nSome of the implemente Initializers are:\n| Class name | Description | Other info |\n|------------|-----------|------------|\n|DirectInitializer|Initialize the population to a preset list of individuals||\n|SeedProbInitializer|Initializes the population with another initializer and inserts user-specified individuals with a probability||\n|SeedDetermInitializer|Initializes the population with another initializer and inserts a number of user-specified individuals into the population||\n|GaussianVectorInitializer|Initialize individuals with normally distributed vectors||\n|UniformVectorInitializer|Initialize individuals with uniformly random distributed vectors||\n|PermInitializer|Initialize individuals with random permuations||\n|LambdaInitializer|Initialize individuals with a user-defined function||\n\n\n### Encodings\nSpecifying the Encoding is optional but can be very helpful for some types of problems.\n\nAn encoding will represent each solution differently in the optimization process and the evaluation of the fintess, since most algorithm work only with vectors, but we might need other types of datatypes for our optimization.\n\nSome of the implemented Encodings are:\n| Class name | Encoding | Decoding | Other info |\n|------------|----------|----------|------------|\n|DefaultEncoding|Makes no changes to the input|Makes no changes to the input|\n|TypeCastEncoding|Changes the datatype of the vector from **T1** to **T2**|Changes the datatype of the vectorfrom **T1** to **T2**||\n|MatrixEncoding|Converts a vector into a matrix of size **NxM**|Converts a matrix to a vector with the ```.flatten()``` method||\n|ImageEncoding|Converts a vector into a matrix of size **NxMx1** or **NxMx3**, each component is an unsigned 8bit number|Converts a matrix to a vector with the ```.flatten()``` method|\n|LambdaEncoding|Applies the user-defined ```encode``` function|Applies the user-defined ```decode``` function||\n\n\n### Benchmark functions\nThe benchmark functions you can use to test the algorithms are:\n| Class name | Domain | Other info |\n|------------|--------|------------|\n|MaxOnes||Integer||\n|DiophantineEq||Integer||\n|MaxOnesReal||Real||\n|Sphere||Real||\n|HighCondElliptic||Real||\n|BentCigar||Real||\n|Discus||Real||\n|Rosenbrock||Real||\n|Ackley||Real||\n|Weistrass||Real||\n|Griewank||Real||\n|Rastrigin||Real||\n|ModSchwefel||Real||\n|Katsuura||Real||\n|HappyCat||Real||\n|HGBat||Real||\n|SumPowell||Real||\n|N4XinSheYang||Real||\n|ThreeSAT||Real||\n|BinKnapsack||Binary||\n|MaxClique||Permutation||\n|TSP||Permutation||\n|ImgApprox||Integer||\n|ImgStd||Integer||\n|ImgEntropy||Integer||\n\n",
    "bugtrack_url": null,
    "license": "LICENSE",
    "summary": "A python package to desing metaheuristic optimization algorithms from components.",
    "version": "0.1.4",
    "project_urls": {
        "Homepage": "https://github.com/eugenioLR/metaheuristic-designer"
    },
    "split_keywords": [
        "optization",
        "genetic-algorithm",
        "evolutionary-algorithms",
        "metaheuristics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c6bb4b3c51d66317e5d4fb3ea784177d1a0bb4a8a77cb4902acdaa4b146ec5f7",
                "md5": "c9c779fc62137d465c4e19a8af6b75fa",
                "sha256": "0d53b1fc93ee09a4b3505e166293fa38a69ceac12aef1acf58f734cc8e4c3f57"
            },
            "downloads": -1,
            "filename": "metaheuristic_designer-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9c779fc62137d465c4e19a8af6b75fa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 91501,
            "upload_time": "2023-10-30T19:11:45",
            "upload_time_iso_8601": "2023-10-30T19:11:45.373414Z",
            "url": "https://files.pythonhosted.org/packages/c6/bb/4b3c51d66317e5d4fb3ea784177d1a0bb4a8a77cb4902acdaa4b146ec5f7/metaheuristic_designer-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "472c780f417941400c4c46aef3a5bbf014ff24252f9c93689e3f65df7d799ffa",
                "md5": "b66cb0429d1384b0f10055f22b89fd09",
                "sha256": "1d40eb937327c39955a164e995b82490d1178a9ef476ab1536e7af6fddbf8856"
            },
            "downloads": -1,
            "filename": "metaheuristic-designer-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b66cb0429d1384b0f10055f22b89fd09",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 60150,
            "upload_time": "2023-10-30T19:11:47",
            "upload_time_iso_8601": "2023-10-30T19:11:47.651349Z",
            "url": "https://files.pythonhosted.org/packages/47/2c/780f417941400c4c46aef3a5bbf014ff24252f9c93689e3f65df7d799ffa/metaheuristic-designer-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-30 19:11:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eugenioLR",
    "github_project": "metaheuristic-designer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "metaheuristic-designer"
}
        
Elapsed time: 0.13212s