Skip to main content

Python version of the ParadisEO framework for metaheuristic optimization

Project description

pipeline status

For the documentation of PyParadiseo see this.

This README only gives a very short introduction.

Table of Contents

Installation

The easiest way to get pyparadiseo is to install it via pip. Currently the following Python versions are supported: 3.6, 3.7, 3.8, 3.9, 3.10

1) Recommended : install with pip

You can install pyParadiseo with pip

    pip install pyparadiseo

2) Build from source

To build pyParadiseo, you'll need to have a few prerequisites installed on your system and set the corresponding paths in setup.py and CMakeLists.txt

To compile the binary extension you need:

  • cmake >= 3.14
  • python3 >= 3.6
  • boost-python
  • boost-numpy

If you want to build pyparadiseo from source, the easiest should be to use this manylinux2014_x86_64 Docker image with installed prerequisites.

Getting Started

The documentation of PyParadiseo is available here

Example of running EO's simple GA (SGA) for the One-Max test problem

from pyparadiseo import config

# problem dependent
from pyparadiseo import population
from pyparadiseo import initializer
from pyparadiseo import evaluator
from pyparadiseo import operator

from pyparadiseo.eo import algo,select_one,continuator

DIM=20
POP_SIZE=25
MAX_GEN=100

if __name__ == "__main__":
    #set global solution type 'bin'
    config.set_solution_type('bin')

    #make pyparadiseo evaluator from python function
    eval = evaluator.fitness(lambda sol: sum(sol))

    #generate and evaluate population
    pop=population.from_init(POP_SIZE,initializer.random(DIM))
    evaluator.pop_eval_from_fitness(eval)(pop,pop)

    #assemble simple GA
    sga = algo.simpleGA(
        select_one.det_tournament(4),
        operator.OnePtBitCrossover(),.1,
        operator.DetBitFlip(),.7,
        eval,
        continuator.max_generations(MAX_GEN)
    )
    # #run algo on pop and print best individual
    sga(pop)
    print(pop.best())

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyparadiseo-0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyparadiseo-0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyparadiseo-0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

pyparadiseo-0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

pyparadiseo-0.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

File details

Details for the file pyparadiseo-0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyparadiseo-0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c5a9bec7e9db517a1a9a924a357f67ad7461399db9297c67cadbdb48a51fb1e
MD5 86eeb9b3b992f4f03c56c94496e51d9b
BLAKE2b-256 4588652b58eaa88fa43c4ebe42ec021c1c165aaa5f0087d0a50ef51e7306949d

See more details on using hashes here.

File details

Details for the file pyparadiseo-0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyparadiseo-0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a92d5725778fe8fc490f541e6e3918eda642582d70b6c7dccce35f41ae030473
MD5 d0117ed64cf1064e948df7564c9317f2
BLAKE2b-256 ff7ba451d072b004781ee07ebb473c2c2bd1fa0c62c4e4346dd64a9708fc1033

See more details on using hashes here.

File details

Details for the file pyparadiseo-0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyparadiseo-0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73671b7ea0beb9eecbcb1d443eedc34140b31328fb02dd60265da5c3a2d6a99a
MD5 1c1ddf47a46c8c7638f91c64f8dbf4b6
BLAKE2b-256 8c5daae3763bf9e46ccd78d9f008421ffbc1b733566cde7e0400bb084ccd1ca9

See more details on using hashes here.

File details

Details for the file pyparadiseo-0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyparadiseo-0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 acca0614a23ca155aef03e710c00bc28e9eb463876313fc9945b7be3e50e8d78
MD5 3ca0b2f1244a2a6af258c921c93cce0f
BLAKE2b-256 6410e4472ca5fe215a3e3cbb7c91497e03d5cef586e6a3616a5bafb9a7beb31c

See more details on using hashes here.

File details

Details for the file pyparadiseo-0.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyparadiseo-0.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0be3cdee0c819bf7cf68ded6eaf3b8b13f6edfa28c44319d8e5320f59cfe3b0
MD5 7ad3bee17541478e456fbfb148f72ff2
BLAKE2b-256 257e86928284fd642c1e2a746cca991d39819ec6b0215632ec2ebaca1e3bb1c6

See more details on using hashes here.

Supported by

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