-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from igormcsouza/develop
Develop
- Loading branch information
Showing
25 changed files
with
813 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
relative_files = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Continuous Delivery | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install pre-requisites | ||
run: pip install poetry | ||
- name: Install python requirements | ||
run: poetry install | ||
- name: Build package | ||
run: poetry build | ||
- name: Publish builded package | ||
run: poetry publish -u ${{ secrets.USERNAME }} -p ${{ secrets.PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Continuous Integration | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install pre-requisites | ||
run: pip install poetry | ||
- name: Install python requirements | ||
run: poetry install | ||
- name: Run unit test and coverage | ||
run: sh scripts/test.sh | ||
- name: Update coveralls data | ||
uses: AndreMiras/coveralls-python-action@develop | ||
with: | ||
parallel: true | ||
flag-name: Unit Test | ||
|
||
coveralls_finish: | ||
needs: package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: AndreMiras/coveralls-python-action@develop | ||
with: | ||
parallel-finished: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2021 Igor Souza | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,59 @@ | ||
# PyMetaHeuristics | ||
# Pymetaheuristics | ||
|
||
Combinatorial Optimization problems with quickly good soving. | ||
|
||
[![Continuous Integration](https://github.com/igormcsouza/pymetaheuristics/actions/workflows/integration.yml/badge.svg)](https://github.com/igormcsouza/pymetaheuristics/actions/workflows/integration.yml) | ||
[![Coverage Status](https://coveralls.io/repos/github/igormcsouza/pymetaheuristics/badge.svg?branch=master)](https://coveralls.io/github/igormcsouza/pymetaheuristics?branch=master) | ||
|
||
|
||
## Introduction | ||
|
||
Pymetaheuristics is a package to help build and train Metaheuristics to solve | ||
real world problems mathematically modeled. It strives to generalize the | ||
overall idea of the technic and delivers to the user a friendly wrapper so the | ||
cientist may focus on the problem modeling rather than the heuristic | ||
implementation. This package is an open source project so feel free to send | ||
your implementations and fixes so they may be helpful for others too. | ||
|
||
|
||
## Subpackages | ||
|
||
What Metaheuristics can be found on this project. | ||
The idea is to implement all possible Metaheuristics found on the market today | ||
and some helper functions to improve what is already there. | ||
**Note: This package is under construction, new features will come up soon.** | ||
|
||
What Metaheuristics can be found on this project? | ||
|
||
1. Genetic Algorithm | ||
|
||
## How to use | ||
|
||
First install the package (available on pypi) | ||
```bash | ||
$ pip install pymetaheuristics | ||
``` | ||
|
||
Import the algorithm model you want to use to solve you problem. Implement the | ||
needed functions and pass to the model. Train and get the results. | ||
```python | ||
from pymetaheuristics.genetic_algorithm.model import GeneticAlgorithm | ||
|
||
model = GeneticAlgorithm( | ||
fitness_function=fitness_function, | ||
genome_generator=genome_generator | ||
) | ||
|
||
result = model.train( | ||
epochs=15, pop_size=10, crossover=pmx_single_point, verbose=True) | ||
``` | ||
|
||
Every module has its integration test, which I submit the model for testing | ||
with very know NP-Hard problems today (Knapsack, tsp, ...). If you want to see | ||
how it goes, check out the integrations under the model testing folder. | ||
|
||
## How to contribute | ||
|
||
1. Genetic Algorithm | ||
Your code and help is very appreciate! Please, send your issue and pr's | ||
whenever is good for you! If needed, send an | ||
[email](mailto:[email protected]) to me I'll be very glad to help. Let's | ||
build up together. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class CrossOverException(BaseException): | ||
pass |
Oops, something went wrong.